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
""" | |
Examples: | |
(1) python benchmark_distilled_sd.py --pipeline_id CompVis/stable-diffusion-v1-4 | |
(2) python benchmark_distilled_sd.py --pipeline_id CompVis/stable-diffusion-v1-4 --vae_path sayakpaul/taesd-diffusers | |
(3) python benchmark_distilled_sd.py --pipeline_id nota-ai/bk-sdm-small | |
(4) python benchmark_distilled_sd.py --pipeline_id nota-ai/bk-sdm-small --vae_path sayakpaul/taesd-diffusers | |
""" | |
import argparse | |
import time |
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
""" | |
Examples: | |
(1) python benchmark_controlnet_sdxl.py --controlnet_id diffusers/controlnet-depth-sdxl-1.0 | |
(2) python benchmark_controlnet_sdxl.py --controlnet_id diffusers/controlnet-depth-sdxl-1.0-small | |
(3) python benchmark_controlnet_sdxl.py --controlnet_id diffusers/controlnet-depth-sdxl-1.0-mid | |
""" | |
import argparse | |
import time |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# To run the script, first install `diffusers` like so: | |
# pip install git+https://github.com/huggingface/diffusers@temp/lora-debug | |
# Then grab the LoRA file: | |
# wget https://huggingface.co/datasets/sayakpaul/sample-datasets/resolve/main/vividWatercolors_10.safetensors | |
import torch | |
from diffusers import StableDiffusionPipeline, DPMSolverMultistepScheduler |
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 imgaug import augmenters as iaa | |
import imgaug as ia | |
ia.seed(4) | |
import tensorflow as tf | |
tf.random.set_seed(666) | |
aug = iaa.RandAugment(n=2, m=9) | |
BATCH_SIZE = 224 |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# Adapted from https://github.com/borisdayma/dalle-mini/blob/main/tools/train/train.py | |
import random | |
from dataclasses import dataclass, field | |
from functools import partial | |
import jax | |
import jax.numpy as jnp | |
import numpy as np | |
from datasets import Dataset, load_dataset |