|
101 | 101 | " \"diffusers_fine_tuning_v2\", \\\n",
|
102 | 102 | " \"diffusers_fine_tuning_v3\", \\\n",
|
103 | 103 | " \"diffusers_fine_tuning_v4\"]\n",
|
104 |
| - "version = \"diffusers_fine_tuning_v4\" #@param [\"diffusers_fine_tuning_v1\",\"diffusers_fine_tuning_v2\",\"diffusers_fine_tuning_v3\",\"diffusers_fine_tuning_v4\"]\n", |
| 104 | + "version = \"diffusers_fine_tuning_v3\" #@param [\"diffusers_fine_tuning_v1\",\"diffusers_fine_tuning_v2\",\"diffusers_fine_tuning_v3\",\"diffusers_fine_tuning_v4\"]\n", |
105 | 105 | "\n",
|
106 | 106 | "customVersion.append((versionDir[versionList.index(version)]))\n",
|
107 | 107 | "\n",
|
|
311 | 311 | " \"Stable-Diffusion-v1-4\", \\\n",
|
312 | 312 | " \"Stable-Diffusion-v1-5-pruned-emaonly\" \\\n",
|
313 | 313 | " \"Waifu-Diffusion-v1-3-fp32\"]\n",
|
314 |
| - "modelName = \"Anything-V3.0-pruned\" #@param [\"\", \"Animefull-final-pruned\", \"Animesfw-final-pruned\", \"Anything-V3.0-pruned-fp16\", \"Anything-V3.0-pruned-fp32\", \"Anything-V3.0-pruned\", \"Stable-Diffusion-v1-4\", \"Stable-Diffusion-v1-5-pruned-emaonly\", \"Waifu-Diffusion-v1-3-fp32\"]\n", |
| 314 | + "modelName = \"\" #@param [\"\", \"Animefull-final-pruned\", \"Animesfw-final-pruned\", \"Anything-V3.0-pruned-fp16\", \"Anything-V3.0-pruned-fp32\", \"Anything-V3.0-pruned\", \"Stable-Diffusion-v1-4\", \"Stable-Diffusion-v1-5-pruned-emaonly\", \"Waifu-Diffusion-v1-3-fp32\"]\n", |
315 | 315 | "\n",
|
316 | 316 | "#@markdown ### Custom model\n",
|
317 | 317 | "#@markdown The model URL should be a direct download link.\n",
|
318 |
| - "customName = \"\" #@param {'type': 'string'}\n", |
319 |
| - "customUrl = \"\"#@param {'type': 'string'}\n", |
| 318 | + "customName = \"herigaru5k\" #@param {'type': 'string'}\n", |
| 319 | + "customUrl = \"https://huggingface.co/Linaqruf/herigaru/resolve/main/herigaru5k.ckpt\"#@param {'type': 'string'}\n", |
320 | 320 | "\n",
|
321 | 321 | "if customName == \"\" or customUrl == \"\":\n",
|
322 | 322 | " pass\n",
|
|
390 | 390 | "source": [
|
391 | 391 | "#@title Training begin\n",
|
392 | 392 | "num_cpu_threads_per_process = 8 #@param {'type':'integer'}\n",
|
393 |
| - "pre_trained_model_path =\"/content/kohya-trainer/checkpoint/Anything-V3.0-pruned.ckpt\" #@param {'type':'string'}\n", |
| 393 | + "pre_trained_model_path =\"/content/herigaru/herigaru10k.ckpt\" #@param {'type':'string'}\n", |
394 | 394 | "meta_lat_json_dir = \"/content/herigaru-tag/meta_lat.json\" #@param {'type':'string'}\n",
|
395 | 395 | "train_data_dir = \"/content/herigaru-tag/train_data\" #@param {'type':'string'}\n",
|
396 | 396 | "output_dir =\"/content/kohya-trainer/fine_tuned\" #@param {'type':'string'}\n",
|
|
415 | 415 | " --shuffle_caption \\\n",
|
416 | 416 | " --train_batch_size={train_batch_size} \\\n",
|
417 | 417 | " --learning_rate={learning_rate} \\\n",
|
| 418 | + " --logging_dir=logs \\\n", |
418 | 419 | " --max_token_length={max_token_length} \\\n",
|
419 | 420 | " --clip_skip={clip_skip} \\\n",
|
420 | 421 | " --mixed_precision={mixed_precision} \\\n",
|
|
423 | 424 | " --xformers \\\n",
|
424 | 425 | " --gradient_checkpointing \\\n",
|
425 | 426 | " --save_state \\\n",
|
426 |
| - " --resume {resume_path} \\\n", |
427 |
| - " --gradient_accumulation_steps {gradient_accumulation_steps} \\\n", |
428 |
| - " --save_precision={save_precision} \n" |
| 427 | + " --gradient_accumulation_steps {gradient_accumulation_steps}\n", |
| 428 | + " # --save_precision={save_precision}\n", |
| 429 | + " # --resume {resume_path} \\\n" |
429 | 430 | ],
|
430 | 431 | "metadata": {
|
431 | 432 | "id": "X_Rd3Eh07xlA",
|
|
495 | 496 | "\n",
|
496 | 497 | "prune = True #@param {'type':'boolean'}\n",
|
497 | 498 | "\n",
|
498 |
| - "model_src = \"/content/kohya-trainer/fine_tuned/last.ckpt\" #@param {'type' : 'string'}\n", |
499 |
| - "model_dst = \"/content/kohya-trainer/fine_tuned/last-pruned.ckpt\" #@param {'type' : 'string'}\n", |
| 499 | + "model_src = \"/content/kohya-trainer/checkpoint/herigaru5k.ckpt\" #@param {'type' : 'string'}\n", |
| 500 | + "model_dst = \"/content/kohya-trainer/checkpoint/herigaru5k.ckpt\" #@param {'type' : 'string'}\n", |
500 | 501 | "\n",
|
501 | 502 | "if prune == True:\n",
|
502 | 503 | " import os\n",
|
|
506 | 507 | " !wget https://raw.githubusercontent.com/lopho/stable-diffusion-prune/main/prune.py\n",
|
507 | 508 | "\n",
|
508 | 509 | "\n",
|
509 |
| - "!python3 prune.py -p {model_src} {model_dst}\n" |
| 510 | + "!python3 prune.py {model_src} {model_dst}\n" |
510 | 511 | ],
|
511 | 512 | "metadata": {
|
512 | 513 | "id": "LUOG7BzQVLKp",
|
|
532 | 533 | "execution_count": null,
|
533 | 534 | "outputs": []
|
534 | 535 | },
|
| 536 | + { |
| 537 | + "cell_type": "code", |
| 538 | + "source": [ |
| 539 | + "#@title Visualize loss graph (Optional)\n", |
| 540 | + "%cd /content/kohya-trainer\n", |
| 541 | + "%load_ext tensorboard\n", |
| 542 | + "%tensorboard --logdir logs" |
| 543 | + ], |
| 544 | + "metadata": { |
| 545 | + "cellView": "form", |
| 546 | + "id": "PeWyOG73DR4T" |
| 547 | + }, |
| 548 | + "execution_count": null, |
| 549 | + "outputs": [] |
| 550 | + }, |
535 | 551 | {
|
536 | 552 | "cell_type": "markdown",
|
537 | 553 | "source": [
|
|
0 commit comments