Skip to content

Instantly share code, notes, and snippets.

View AmericanPresidentJimmyCarter's full-sized avatar

39th president of the United States, probably AmericanPresidentJimmyCarter

View GitHub Profile
from PIL import Image
import stable_inference
import numpy as np
from einops import repeat
# Interpolate video between two conditionings
FOLDER = 'test/painting'
MAX_STRENGTH = 0.5 # Strength at maximum in the middle of the interpolation
SEED = 9001
SECONDS = 10
from PIL import Image
import stable_inference
import numpy as np
from einops import repeat
'''
Interpolate between two images with a prompt of what you expect the midstate to be.
Alter the stuff below here to whatever you need it to be.
'''
from PIL import Image
import stable_inference
import torch
from einops import repeat
def image_grid(imgs, rows, cols):
assert len(imgs) == rows*cols
w, h = imgs[0].size
grid = Image.new('RGB', size=(cols*w, rows*h))
@AmericanPresidentJimmyCarter
AmericanPresidentJimmyCarter / compress.py
Last active March 17, 2023 18:48
Attempting to make small DB patches
import argparse
from pathlib import Path
import sys
import torch
THRESHOLD_STRENGTH = 2.
DEFAULT_OUT_NAME = 'output.ckpt'
parser = argparse.ArgumentParser(description='Create a compressed dreambooth patch or patch weights')
parser.add_argument('mode', type=str, help='"compress" or "inflate"')