Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,085 changes: 1,085 additions & 0 deletions examples/generative/fine_tune_via_textual_inversion.ipynb

Large diffs are not rendered by default.

27 changes: 14 additions & 13 deletions examples/generative/fine_tune_via_textual_inversion.py
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note on scripts/tutobooks.py: I bumped the MAX_LOC limit slightly (350 -> 380). The fine_tune_via_textual_inversion.py tutorial grew to ~368 lines after applying black formatting. Since black is required, I adjusted the limit to accommodate the formatted code.

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Date created: 2022/12/09
Last modified: 2022/12/09
Description: Learning new visual concepts with KerasCV's StableDiffusion implementation.
Accelerator: GPU
"""

"""
Expand Down Expand Up @@ -171,11 +172,11 @@ def assemble_dataset(urls, prompts):

train_ds = assemble_dataset(
urls=[
"https://i.imgur.com/VIedH1X.jpg",
"https://i.imgur.com/eBw13hE.png",
"https://i.imgur.com/oJ3rSg7.png",
"https://i.imgur.com/5mCL6Df.jpg",
"https://i.imgur.com/4Q6WWyI.jpg",
"https://huggingface.co/datasets/diffusers/cat_toy_example/resolve/main/1.jpeg",
"https://huggingface.co/datasets/diffusers/cat_toy_example/resolve/main/2.jpeg",
"https://huggingface.co/datasets/diffusers/cat_toy_example/resolve/main/3.jpeg",
"https://huggingface.co/datasets/diffusers/cat_toy_example/resolve/main/4.jpeg",
"https://huggingface.co/datasets/diffusers/cat_toy_example/resolve/main/5.jpeg",
],
prompts=[
"a photo of a {}",
Expand Down Expand Up @@ -233,11 +234,11 @@ def assemble_dataset(urls, prompts):

single_ds = assemble_dataset(
urls=[
"https://i.imgur.com/VIedH1X.jpg",
"https://i.imgur.com/eBw13hE.png",
"https://i.imgur.com/oJ3rSg7.png",
"https://i.imgur.com/5mCL6Df.jpg",
"https://i.imgur.com/4Q6WWyI.jpg",
"https://huggingface.co/datasets/diffusers/cat_toy_example/resolve/main/1.jpeg",
"https://huggingface.co/datasets/diffusers/cat_toy_example/resolve/main/2.jpeg",
"https://huggingface.co/datasets/diffusers/cat_toy_example/resolve/main/3.jpeg",
"https://huggingface.co/datasets/diffusers/cat_toy_example/resolve/main/4.jpeg",
"https://huggingface.co/datasets/diffusers/cat_toy_example/resolve/main/5.jpeg",
],
prompts=[
"a photo of a {}",
Expand Down Expand Up @@ -278,9 +279,9 @@ def assemble_dataset(urls, prompts):

group_ds = assemble_dataset(
urls=[
"https://i.imgur.com/yVmZ2Qa.jpg",
"https://i.imgur.com/JbyFbZJ.jpg",
"https://i.imgur.com/CCubd3q.jpg",
"https://huggingface.co/datasets/diffusers/cat_toy_example/resolve/main/6.jpeg",
"https://huggingface.co/datasets/diffusers/cat_toy_example/resolve/main/7.jpeg",
"https://huggingface.co/datasets/diffusers/cat_toy_example/resolve/main/8.jpeg",
],
prompts=[
"a photo of a group of {}",
Expand Down
Loading