Skip to content

Instantly share code, notes, and snippets.

@garystafford
Last active December 1, 2023 07:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garystafford/f45862b8ed60b2711d531459bc219884 to your computer and use it in GitHub Desktop.
Save garystafford/f45862b8ed60b2711d531459bc219884 to your computer and use it in GitHub Desktop.
import os
# project configuration
project_name = "mb_amg_gt_oue_dreambooth"
model_name_base = "stabilityai/stable-diffusion-xl-base-1.0"
model_name_refiner = "stabilityai/stable-diffusion-xl-refiner-1.0"
# fine-tuning prompts
# 'oue' is a rare tokens, 'car' is a class
instance_prompt = "photo of oue car"
class_prompt = "photo of a car"
image_path = "./images/car/"
# fine-tuning hyperparameters
learning_rate = 1e-4
num_steps = 500
batch_size = 1
gradient_accumulation = 4
resolution = 1024
# set env. vars for autotrain
os.environ["PROJECT_NAME"] = project_name
os.environ["MODEL_NAME"] = model_name_base
os.environ["INSTANCE_PROMPT"] = instance_prompt
os.environ["CLASS_PROMPT"] = class_prompt
os.environ["IMAGE_PATH"] = image_path
os.environ["LEARNING_RATE"] = str(learning_rate)
os.environ["NUM_STEPS"] = str(num_steps)
os.environ["BATCH_SIZE"] = str(batch_size)
os.environ["GRADIENT_ACCUMULATION"] = str(gradient_accumulation)
os.environ["RESOLUTION"] = str(resolution)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment