Enter this in the search box along with your search terms:
Get all gists from the user santisbon.
user:santisbon
Find all gists with a .yml extension.
extension:yml
Find all gists with HTML files.
language:html
""" | |
stable diffusion dreaming | |
creates hypnotic moving videos by smoothly walking randomly through the sample space | |
example way to run this script: | |
$ python stablediffusionwalk.py --prompt "blueberry spaghetti" --name blueberry | |
to stitch together the images, e.g.: | |
$ ffmpeg -r 10 -f image2 -s 512x512 -i blueberry/frame%06d.jpg -vcodec libx264 -crf 10 -pix_fmt yuv420p blueberry.mp4 |
## gen() function for proc.stdout ( run_commands, vdl_run ) | |
## async read from proc.stdout | |
if True: | |
def gen(proc): | |
remains = b'' # remaining from prev read | |
while proc.poll() is None: | |
rlist, _, _ = select([proc.stdout],[],[],500) | |
if proc.stdout not in rlist: | |
continue | |
data = os.read(proc.stdout.fileno(), 16384) |
""" | |
# https://gist.github.com/rhee/c038393822eabec681092b6941ef1f1e | |
# fake_ipython.py | |
Usage: | |
from fake_ipython import get_ipython | |
""" | |
from inspect import stack | |
def get_ipython(): |
#!/usr/bin/env python | |
# coding: utf-8 | |
# // update: 2022-04-15 - single-cell python version | |
# // gist: https://gist.github.com/rhee/f42aa18c8e3dcb7b6c03c23e750124f7 | |
with open('__nb-convert__.bash', 'w') as fout: | |
fout.write('''#!/bin/bash | |
try_nbconvert() { | |
local prefix="$1"; shift; | |
if test ! -z "$prefix" | |
then |
## monitor GPU usage in jupyter notebook -- [email protected] | |
## migrated to: https://gist.github.com/rhee-elten/1a1070e3a812ca863c3b937b5180b2f8 |
# -*- coding: utf-8 -*- | |
# --- | |
# jupyter: | |
# jupytext: | |
# text_representation: | |
# extension: .py | |
# format_name: percent | |
# format_version: '1.3' | |
# jupytext_version: 1.3.0+dev | |
# kernelspec: |
# coding: utf-8 | |
from traceback import print_exc | |
import os | |
import stat | |
import sys | |
from struct import pack, unpack, pack_into, unpack_from | |
import mmap | |
import ctypes |
: | |
export TF_FORCE_GPU_ALLOW_GROWTH=true |
# from : https://github.com/tensorflow/tensorflow/blob/master/tensorflow/contrib/graph_editor/examples/edit_graph_example.py | |
import numpy as np | |
import tensorflow as tf | |
from tensorflow.contrib import graph_editor as ge | |
# create a graph | |
g = tf.Graph() | |
with g.as_default(): |
Enter this in the search box along with your search terms:
Get all gists from the user santisbon.
user:santisbon
Find all gists with a .yml extension.
extension:yml
Find all gists with HTML files.
language:html