Skip to content

Instantly share code, notes, and snippets.

@VolkerH
VolkerH / stable_diffusion_walk.py
Created September 1, 2022 15:07 — forked from nateraw/stable_diffusion_walk.py
Walk between stable diffusion text prompts
"""
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
@VolkerH
VolkerH / PY-CircleFitting.ipynb
Created March 29, 2023 11:21 — forked from WetHat/PY-CircleFitting.ipynb
Fitting a Circle to a 2d Point Cloud by Linear Least Squares
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@VolkerH
VolkerH / pprint_numpy.py
Created September 5, 2023 14:51 — forked from eric-wieser/pprint_numpy.py
A super janky example of how _repr_html_ could be implemented
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(