This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Built on top of this gist by @karpathy: | |
https://gist.github.com/karpathy/00103b0037c5aaea32fe1da1af553355 | |
stable diffusion dreaming over text prompts | |
creates hypnotic moving videos by smoothly walking randomly through the sample space | |
example way to run this script: | |
$ python stable_diffusion_walk.py --prompts "['blueberry spaghetti', 'strawberry spaghetti']" --seeds 243,523 --name berry_good_spaghetti |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
def _html_repr_helper(contents, index=()): | |
dims_left = contents.ndim - len(index) | |
if dims_left == 0: | |
s = contents[index] | |
else: | |
s = ''.join(_html_repr_helper(contents, index + (i,)) for i in range(contents.shape[len(index)])) | |
return "<div class='numpy-array-ndim-{} numpy-array-ndim-m{}' title='[{}]'>{}</div>".format( |
OlderNewer