|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export MODEL_DIR="stabilityai/stable-diffusion-2-base" |
|
export OUTPUT_DIR="sd_v2_caption_kl_output" |
|
export DATASET="nickpai/coco2017-colorization" |
|
export REVISION="main" |
|
export VAL_IMG_NAME="'./000000295478.jpg' './000000122962.jpg' './000000000285.jpg' './000000007991.jpg' './000000018837.jpg' './000000000724.jpg'" |
|
export VAL_PROMPT="'Woman walking a small dog behind her.' 'A group of children sitting at a long table eating pizza.' 'A close up picture of a bear face.' 'A plate on a table is filled with carrots and beans.' 'A large truck on a city street with two works sitting on top and one worker climbing in through door.' 'An upside down stop sign by the road.'" |
|
|
|
|
|
accelerate launch train_controlnet.py \ |
|
--pretrained_model_name_or_path=$MODEL_DIR \ |
|
--output_dir=$OUTPUT_DIR \ |
|
--seed=123123 \ |
|
--dataset_name=$DATASET \ |
|
--dataset_revision=$REVISION \ |
|
--image_column="file_name" \ |
|
--conditioning_image_column="file_name" \ |
|
--caption_column="captions" \ |
|
--max_train_samples=100000 \ |
|
--num_validation_images=1 \ |
|
--resolution=512 \ |
|
--num_train_epochs=5 \ |
|
--dataloader_num_workers=8 \ |
|
--learning_rate=1e-5 \ |
|
--validation_image './000000295478.jpg' './000000122962.jpg' './000000000285.jpg' './000000007991.jpg' './000000018837.jpg' './000000000724.jpg' \ |
|
--validation_prompt 'Woman walking a small dog behind her.' 'A group of children sitting at a long table eating pizza.' 'A close up picture of a bear face.' 'A plate on a table is filled with carrots and beans.' 'A large truck on a city street with two works sitting on top and one worker climbing in through door.' 'An upside down stop sign by the road.' \ |
|
--train_batch_size=2 \ |
|
--gradient_accumulation_steps=8 \ |
|
--proportion_empty_prompts=0 \ |
|
--validation_steps=500 \ |
|
--checkpointing_steps=2500 \ |
|
--mixed_precision="fp16" \ |
|
--gradient_checkpointing \ |
|
--use_8bit_adam |