linoyts HF Staff commited on
Commit
c9544a0
·
verified ·
1 Parent(s): c0b53b6

End of training

Browse files
README.md CHANGED
@@ -8,28 +8,28 @@ tags:
8
  - template:sd-lora
9
  widget:
10
 
11
- - text: 'a TOK ad for lego with a T2K emoji'
12
  output:
13
  url:
14
  "image_0.png"
15
 
16
- - text: 'a TOK ad for lego with a T2K emoji'
17
  output:
18
  url:
19
  "image_1.png"
20
 
21
- - text: 'a TOK ad for lego with a T2K emoji'
22
  output:
23
  url:
24
  "image_2.png"
25
 
26
- - text: 'a TOK ad for lego with a T2K emoji'
27
  output:
28
  url:
29
  "image_3.png"
30
 
31
  base_model: stabilityai/stable-diffusion-xl-base-1.0
32
- instance_prompt: a TOK ad for lego with a T2K emoji
33
  license: openrail++
34
  ---
35
 
@@ -48,34 +48,51 @@ license: openrail++
48
  - **LoRA**: download **[`ad_huggy.safetensors` here 💾](/linoyts/ad_huggy/blob/main/ad_huggy.safetensors)**.
49
  - Place it on your `models/Lora` folder.
50
  - On AUTOMATIC1111, load the LoRA by adding `<lora:ad_huggy:1>` to your prompt. On ComfyUI just [load it as a regular LoRA](https://comfyanonymous.github.io/ComfyUI_examples/lora/).
51
-
 
 
 
 
52
 
53
  ## Use it with the [🧨 diffusers library](https://github.com/huggingface/diffusers)
54
 
55
  ```py
56
  from diffusers import AutoPipelineForText2Image
57
  import torch
58
-
 
 
59
  pipeline = AutoPipelineForText2Image.from_pretrained('stabilityai/stable-diffusion-xl-base-1.0', torch_dtype=torch.float16).to('cuda')
60
  pipeline.load_lora_weights('linoyts/ad_huggy', weight_name='pytorch_lora_weights.safetensors')
61
-
62
- image = pipeline('a TOK ad for lego with a T2K emoji').images[0]
 
 
 
 
63
  ```
64
 
65
  For more details, including weighting, merging and fusing LoRAs, check the [documentation on loading LoRAs in diffusers](https://huggingface.co/docs/diffusers/main/en/using-diffusers/loading_adapters)
66
 
67
  ## Trigger words
68
 
69
- You should use a TOK ad for lego with a T2K emoji to trigger the image generation.
 
 
 
 
 
 
 
70
 
71
  ## Details
72
  All [Files & versions](/linoyts/ad_huggy/tree/main).
73
 
74
  The weights were trained using [🧨 diffusers Advanced Dreambooth Training Script](https://github.com/huggingface/diffusers/blob/main/examples/advanced_diffusion_training/train_dreambooth_lora_sdxl_advanced.py).
75
 
76
- LoRA for the text encoder was enabled. True.
77
 
78
- Pivotal tuning was enabled: False.
79
 
80
  Special VAE used for training: madebyollin/sdxl-vae-fp16-fix.
81
 
 
8
  - template:sd-lora
9
  widget:
10
 
11
+ - text: 'a <s0><s1> ad for lego with a <s2><s3> emoji'
12
  output:
13
  url:
14
  "image_0.png"
15
 
16
+ - text: 'a <s0><s1> ad for lego with a <s2><s3> emoji'
17
  output:
18
  url:
19
  "image_1.png"
20
 
21
+ - text: 'a <s0><s1> ad for lego with a <s2><s3> emoji'
22
  output:
23
  url:
24
  "image_2.png"
25
 
26
+ - text: 'a <s0><s1> ad for lego with a <s2><s3> emoji'
27
  output:
28
  url:
29
  "image_3.png"
30
 
31
  base_model: stabilityai/stable-diffusion-xl-base-1.0
32
+ instance_prompt: a <s0><s1> ad for lego with a <s2><s3> emoji
33
  license: openrail++
34
  ---
35
 
 
48
  - **LoRA**: download **[`ad_huggy.safetensors` here 💾](/linoyts/ad_huggy/blob/main/ad_huggy.safetensors)**.
49
  - Place it on your `models/Lora` folder.
50
  - On AUTOMATIC1111, load the LoRA by adding `<lora:ad_huggy:1>` to your prompt. On ComfyUI just [load it as a regular LoRA](https://comfyanonymous.github.io/ComfyUI_examples/lora/).
51
+ - *Embeddings*: download **[`ad_huggy_emb.safetensors` here 💾](/linoyts/ad_huggy/blob/main/ad_huggy_emb.safetensors)**.
52
+ - Place it on it on your `embeddings` folder
53
+ - Use it by adding `ad_huggy_emb` to your prompt. For example, `a ad_huggy_emb ad for lego with a emoji`
54
+ (you need both the LoRA and the embeddings as they were trained together for this LoRA)
55
+
56
 
57
  ## Use it with the [🧨 diffusers library](https://github.com/huggingface/diffusers)
58
 
59
  ```py
60
  from diffusers import AutoPipelineForText2Image
61
  import torch
62
+ from huggingface_hub import hf_hub_download
63
+ from safetensors.torch import load_file
64
+
65
  pipeline = AutoPipelineForText2Image.from_pretrained('stabilityai/stable-diffusion-xl-base-1.0', torch_dtype=torch.float16).to('cuda')
66
  pipeline.load_lora_weights('linoyts/ad_huggy', weight_name='pytorch_lora_weights.safetensors')
67
+ embedding_path = hf_hub_download(repo_id='linoyts/ad_huggy', filename='ad_huggy_emb.safetensors', repo_type="model")
68
+ state_dict = load_file(embedding_path)
69
+ pipeline.load_textual_inversion(state_dict["clip_l"], token=["<s0>", "<s1>", "<s2>", "<s3>"], text_encoder=pipeline.text_encoder, tokenizer=pipeline.tokenizer)
70
+ pipeline.load_textual_inversion(state_dict["clip_g"], token=["<s0>", "<s1>", "<s2>", "<s3>"], text_encoder=pipeline.text_encoder_2, tokenizer=pipeline.tokenizer_2)
71
+
72
+ image = pipeline('a <s0><s1> ad for lego with a <s2><s3> emoji').images[0]
73
  ```
74
 
75
  For more details, including weighting, merging and fusing LoRAs, check the [documentation on loading LoRAs in diffusers](https://huggingface.co/docs/diffusers/main/en/using-diffusers/loading_adapters)
76
 
77
  ## Trigger words
78
 
79
+ To trigger image generation of trained concept(or concepts) replace each concept identifier in you prompt with the new inserted tokens:
80
+
81
+ to trigger concept `TOK` → use `<s0><s1>` in your prompt
82
+
83
+
84
+ to trigger concept `T2K` → use `<s2><s3>` in your prompt
85
+
86
+
87
 
88
  ## Details
89
  All [Files & versions](/linoyts/ad_huggy/tree/main).
90
 
91
  The weights were trained using [🧨 diffusers Advanced Dreambooth Training Script](https://github.com/huggingface/diffusers/blob/main/examples/advanced_diffusion_training/train_dreambooth_lora_sdxl_advanced.py).
92
 
93
+ LoRA for the text encoder was enabled. False.
94
 
95
+ Pivotal tuning was enabled: True.
96
 
97
  Special VAE used for training: madebyollin/sdxl-vae-fp16-fix.
98
 
ad_huggy.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:5771c0256bacd30d9083a50e07c68df2894980ef7d4b7c99568ed848fd1f5c71
3
- size 237421752
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ac9a344e053c8a01a8ac40134260844c912fc07c3e028f2a5d1579c1711571a6
3
+ size 186046568
ad_huggy_emb.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b2a7251dc71b0c2caee9ec07a3fae6ac30ad09fc1f5341308adffbbd09f027b0
3
+ size 32920
image_0.png CHANGED

Git LFS Details

  • SHA256: 801426d6a00ed1d948070d9936bfd9d9faaa4d068c704615d6e64832ade48217
  • Pointer size: 132 Bytes
  • Size of remote file: 1.35 MB

Git LFS Details

  • SHA256: 403d2410ea1562828892420515ae3c45f1b862bf13cfac1283f64fd4a6412a5a
  • Pointer size: 132 Bytes
  • Size of remote file: 1.31 MB
image_1.png CHANGED

Git LFS Details

  • SHA256: e9b0b325e6d13ca135080d6fc84bda9100a9a3d0a838c69e94acb2d5a9f68d7f
  • Pointer size: 132 Bytes
  • Size of remote file: 1.41 MB

Git LFS Details

  • SHA256: 3acacbc90262a92de03183c15e8d30664c266c931c7fdcb76c48feda16b765d1
  • Pointer size: 132 Bytes
  • Size of remote file: 1.27 MB
image_2.png CHANGED

Git LFS Details

  • SHA256: d21b1123e92a85500125b24a21a74d9efaeaf959048b5fea0ec2fab5dadfc5f9
  • Pointer size: 132 Bytes
  • Size of remote file: 1.46 MB

Git LFS Details

  • SHA256: 07573383e3004a9600e28b1f5839350817126fe2fbc61736fe233dc32dc58929
  • Pointer size: 132 Bytes
  • Size of remote file: 1.17 MB
image_3.png CHANGED

Git LFS Details

  • SHA256: ad802dc7c389f8f9d16af2ae975c4597000b37d8abaf3c84e76d220e56718a77
  • Pointer size: 132 Bytes
  • Size of remote file: 1.41 MB

Git LFS Details

  • SHA256: 221d289fb15ebad752321cd818e909b55af44b9e3f45a4cd0f0f9aad2f6a6a55
  • Pointer size: 132 Bytes
  • Size of remote file: 1.29 MB
pytorch_lora_weights.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:e437d6271e20d8ed9ab51282460f35f28f36974277560b79c06afc17ab89f409
3
- size 237400944
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dfc3974ab283e79969db2679de2ba3052abcbcddbc6314a79d936f35222c9553
3
+ size 185963768