Created using Colaboratory

This commit is contained in:
nawnie 2023-02-18 11:32:25 -06:00
parent 9dc3b2d65a
commit 341263b7a7
1 changed files with 35 additions and 26 deletions

View File

@ -134,7 +134,7 @@
"from IPython.display import clear_output\n",
"!mkdir input\n",
"%cd /content/EveryDream2trainer\n",
"MODEL_URL = \"https://huggingface.co/panopstor/EveryDream/resolve/main/sd_v1-5_vae.ckpt\" #@param [\"https://huggingface.co/panopstor/EveryDream/resolve/main/sd_v1-5_vae.ckpt\", \"https://huggingface.co/hakurei/waifu-diffusion-v1-3/resolve/main/wd-v1-3-float16.ckpt\"] {allow-input: true}\n",
"MODEL_URL = \"https://huggingface.co/panopstor/EveryDream/resolve/main/sd_v1-5_vae.ckpt\" #@param [\"https://huggingface.co/panopstor/EveryDream/resolve/main/sd_v1-5_vae.ckpt\", \"https://huggingface.co/hakurei/waifu-diffusion-v1-3/resolve/main/wd-v1-3-float16.ckpt\", \"stabilityai/stable-diffusion-2-1-base\", \"stabilityai/stable-diffusion-2-1\"] {allow-input: true}\n",
"print(\"Downloading \")\n",
"!wget $MODEL_URL\n",
"\n",
@ -256,7 +256,8 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "j9pEI69WXS9w"
"id": "j9pEI69WXS9w",
"cellView": "form"
},
"outputs": [],
"source": [
@ -268,20 +269,13 @@
"Save_to_Gdrive = True #@param{type:\"boolean\"}\n",
"#@markdown * Use resume to contnue training you just ran, will also find latest diffusers log in your Gdrive to continue.\n",
"resume = False #@param{type:\"boolean\"}\n",
"#@markdown * Checkpointing Saves Vram to allow larger batch sizes minor slow down on a single batch size but will can allow room for a higher traning resolution (suggested on Colab Free tier, turn off for A100)\n",
"Gradient_checkpointing = True #@param{type:\"boolean\"}\n",
"Disable_Xformers = False\n",
"#@markdown * Tag shuffling, mainly for booru training. Best to just read this if interested in shufflng tags /content/EveryDream2trainer/doc/SHUFFLING_TAGS.md\n",
"shuffle_tags = False #@param{type:\"boolean\"}\n",
"#@markdown * You can turn off the text encoder training (generally not suggested)\n",
"Disable_text_Encoder= False #@param{type:\"boolean\"}\n",
"#@markdown * Name your project so you can find it in your logs\n",
"Project_Name = \"My_Project\" #@param{type: 'string'}\n",
"\n",
"#@markdown * The learning rate affects how much \"training\" is done on the model per training step. It is a very careful balance to select a value that will learn your data and not wreck the model. \n",
"#@markdown Leave this default unless you are very comfortable with training and know what you are doing.\n",
"\n",
"Learning_Rate = 1e-6 #@param{type: 'number'}\n",
"Learning_Rate = 1.e-6 #@param{type: 'number'}\n",
"\n",
"#@markdown * A learning rate scheduler can change your learning rate as training progresses.\n",
"\n",
@ -322,23 +316,41 @@
"#@markdown You can set your own sample prompts by adding them, one line at a time, to `/content/EveryDream2trainer/sample_prompts.txt`. If left empty, it will use the captions from your training images.\n",
"\n",
"#@markdown Use the steps_between_samples to set how often the samples are generated.\n",
"Steps_between_samples = 100 #@param{type:\"integer\"}\n",
"Steps_between_samples = 300 #@param{type:\"integer\"}\n",
"\n",
"#@markdown * That's it! Run the cell! or configure these advance options\n",
"#@ Check the Documents for an explanation for these advance config options\n",
"\n",
"Clip_skip=0 #@param{type:\"integer\"}\n",
"Conditional_DropOut=4 #@param{type:\"integer\"}\n",
"#@markdown # ________________ ADV SETTINGS _________________\n",
"#@markdown These are the default Every Dream 2 settings, changing these without learning what they do will likley waste compute credits\n",
"#@markdown please read the doc folder before changing these!\n",
"\n",
"#@markdown * A tip using the sliders, to finely adjust these click them with your mouse then use your keyboard arrows\n",
"\n",
"#@markdown * Using the same seed each time you train allows for more accurate a/b comparison of models, leave at -1 for random\n",
"#@markdown * The seed also effects your training samples, if you want the same seed each sample you will need to change it from -1\n",
"Training_Seed = -1 #@param{type:\"integer\"}\n",
"\n",
"#@markdown * Checkpointing Saves Vram to allow larger batch sizes minor slow down on a single batch size but will can allow room for a higher traning resolution (suggested on Colab Free tier, turn off for A100)\n",
"Gradient_checkpointing = True #@param{type:\"boolean\"}\n",
"Disable_Xformers = False #@param{type:\"boolean\"}\n",
"#@markdown * Tag shuffling, mainly for booru training. Best to just read this if interested in shufflng tags /content/EveryDream2trainer/doc/SHUFFLING_TAGS.md\n",
"shuffle_tags = False #@param{type:\"boolean\"}\n",
"#@markdown * You can turn off the text encoder training (generally not suggested)\n",
"Disable_text_Encoder= False #@param{type:\"boolean\"}\n",
"#@markdown * Skip the nth last layer of CLIP.\n",
"Clip_skip = 0 #@param {type:\"slider\", min:0, max:4, step:1}\n",
"Clip_skip=int(Clip_skip)\n",
"#@markdown * n% to drop a random image caption.\n",
"Conditional_DropOut = 4 #@param {type:\"slider\", min:0, max:30, step:1}\n",
"cd=Conditional_DropOut/100\n",
"Picture_flip=0 #@param{type:\"integer\"}\n",
"#@markdown * Randomly flips n% of images.\n",
"Picture_flip = 0 #@param {type:\"slider\", min:0, max:50, step:5}\n",
"Flip=Picture_flip/100\n",
"#@markdown use a contrast ratio between 0-10% for Best results \n",
"Training_Contrast_manipulation_Ratio=10 #@param{type:\"integer\"}\n",
"Ratio=Training_Contrast_manipulation_Ratio/100\n",
"#@markdown * Use a contrast ratio between 0-10% for Best results.\n",
"Ratio = 0 #@param {type:\"slider\", min:0, max:20, step:1}\n",
"\n",
"#@markdown *Weights and Biases logging token. \n",
"\n",
"# #@markdown Paste your token here if you have an account so you can use it to track your training progress. If you don't have an account, you can create one for free at https://wandb.ai/site. Log will use your project name from above. This is a free online logging utility.\n",
"\n",
"# #@markdown Your key is on this page: https://wandb.ai/settings under \"Danger Zone\" \"API Keys\"\n",
"wandb_token = '' #@param{type:\"string\"}\n",
"\n",
@ -385,24 +397,21 @@
" $DX \\\n",
" $wandb_settings \\\n",
" --amp \\\n",
" --clip_skip 1 \\\n",
" --clip_skip $Clip_skip \\\n",
" --batch_size $Batch_Size \\\n",
" --grad_accum $Gradient_steps \\\n",
" --cond_dropout $cd \\\n",
" --data_root \"$dataset\" \\\n",
" --flip_p $Flip \\\n",
" --lr $Learning_Rate \\\n",
" --lr_decay_steps 0 \\\n",
" --lr_scheduler \"$Schedule\" \\\n",
" --lr_warmup_steps 0 \\\n",
" --max_epochs $Max_Epochs \\\n",
" --project_name \"$Project_Name\" \\\n",
" --resolution $Resolution \\\n",
" --sample_prompts \"sample_prompts.txt\" \\\n",
" --sample_steps $Steps_between_samples \\\n",
" --save_every_n_epoch $Save_every_N_epoch \\\n",
" --seed 555 \\\n",
" --shuffle_tags \\\n",
" --seed $Training_Seed \\\n",
" --zero_frequency_noise_ratio $Ratio \\\n",
" --useadam8bit \n",
"\n"
@ -422,7 +431,7 @@
"#@markdown * Edit chain0.json to make use of chaining\n",
"#@markdown * make sure to check each confguration you will need 1 Json per chain length 3 are provided\n",
"#@markdown * make sure your .Json contain the line Notebook: true\n",
"\n",
"#@markdown * your locations in the .json can be done in this format /content/drive/MyDrive/ - then the sub folder you wish to use\n",
"\n",
"%cd /content/EveryDream2trainer\n",
"Chain_Length=0 #@param{type:\"integer\"}\n",