This file contains 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
# stable diffusion tool | |
# @htoyryla github twitter instagram | |
# requires diffusers 0.3.0 and a trained model | |
# relies heavily on code from https://github.com/huggingface/diffusers | |
# neurokuvatreenit, stable diffusion, example 1b using LDM scheduler and 1c saving image at each iteration | |
# 1d: multiple subprompts with weights |
This file contains 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
# stable diffusion tool | |
# @htoyryla github twitter instagram | |
# requires diffusers 0.4.0 and a trained model | |
# relies heavily on code from https://github.com/huggingface/diffusers | |
# neurokuvatreenit, stable diffusion, example 1b using LDM scheduler and 1c saving image at each iteration | |
# 1d: multiple subprompts with weights |
This file contains 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
# stable diffusion tool | |
# @htoyryla github twitter instagram | |
# requires diffusers 0.3.0 and a trained model | |
# relies heavily on code from https://github.com/huggingface/diffusers | |
# for prompt weighting use prompts like "a subprompt like this:10 / in the style of that:25" |
This file contains 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
from torch import autocast | |
import torch | |
import requests | |
from PIL import Image | |
import sys | |
from diffusers import StableDiffusionImg2ImgPipeline #, preprocess | |
import random | |
import argparse | |
# image to image generation using StableDiffusion 0.3.0 dev |
This file contains 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
from torch import autocast | |
import torch | |
import requests | |
from PIL import Image | |
import sys | |
from image_to_image import StableDiffusionImg2ImgPipeline, preprocess | |
import random | |
# script to generate 100 frames transition from init image towards the prompt |
This file contains 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
# | |
# Usage: | |
# | |
# python vid2.py "prompt" video_in_path output_dir [strength scale seed] | |
# | |
# requires image_to_image.py from https://github.com/huggingface/diffusers/blob/main/examples/inference/image_to_image.py | |
# | |
from torch import autocast |
This file contains 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
# %% | |
# !! {"metadata":{ | |
# !! "id": "view-in-github", | |
# !! "colab_type": "text" | |
# !! }} | |
""" | |
<a href="https://colab.research.google.com/github/alembics/disco-diffusion/blob/main/Disco_Diffusion.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> | |
""" | |
# %% |
This file contains 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
code for a gan trainer | |
adding an encoder to assist in generator training | |
htoyryla 8 Jun 2018 | |
support for progressive training with larger image size | |
htoyryla 11.6.2018 | |
This file contains 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
-- modified version of @jcjohnson's neural-style | |
-- by @htoyryla 14 Feb 2018 | |
-- allows exploring the effect of equalizing the activations of different channels in a style layer | |
require 'torch' | |
require 'nn' | |
require 'image' | |
require 'optim' |
This file contains 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
-- modified version of @jcjohnson's neural-style | |
-- by @htoyryla 13 Feb 2018 | |
-- allows giving emphasis to nc best channel(s) in each style layer | |
-- use -style_layers to select layer as usual, using a single layer is recommended | |
-- -nc to set how many of the best channels are used per layer | |
-- during target capture, tests the model using the style image | |
-- and selects nc channels with strongest activations to be given emphasis during iterations | |
-- not tested with multiple style images | |
require 'torch' |
NewerOlder