Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model: HiDream-ai/HiDream-I1-Full
|
3 |
+
library_name: diffusers
|
4 |
+
license: mit
|
5 |
+
instance_prompt: a dog, yarn art style
|
6 |
+
widget: []
|
7 |
+
tags:
|
8 |
+
- text-to-image
|
9 |
+
- diffusers-training
|
10 |
+
- diffusers
|
11 |
+
- lora
|
12 |
+
- hidream
|
13 |
+
- hidream-diffusers
|
14 |
+
- template:sd-lora
|
15 |
+
---
|
16 |
+
|
17 |
+
<!-- This model card has been generated automatically according to the information the training script had access to. You
|
18 |
+
should probably proofread and complete it, then remove this comment. -->
|
19 |
+
|
20 |
+
|
21 |
+
# HiDream Image DreamBooth LoRA - linoyts/HiDream-yarn-art-LoRA
|
22 |
+
|
23 |
+
<Gallery />
|
24 |
+
|
25 |
+
## Model description
|
26 |
+
|
27 |
+
These are linoyts/dog-hidream-lora-offload-mini-test DreamBooth LoRA weights for HiDream-ai/HiDream-I1-Full.
|
28 |
+
|
29 |
+
The weights were trained using [DreamBooth](https://dreambooth.github.io/) with the [HiDream Image diffusers trainer](https://github.com/huggingface/diffusers/blob/main/examples/dreambooth/README_hidream.md).
|
30 |
+
|
31 |
+
## Trigger words
|
32 |
+
|
33 |
+
You should use `yarn art style` to trigger the image generation.
|
34 |
+
|
35 |
+
## Download model
|
36 |
+
|
37 |
+
[Download the *.safetensors LoRA](https://huggingface.co/linoyts/HiDream-yarn-art-LoRA/tree/main) in the Files & versions tab.
|
38 |
+
|
39 |
+
## Use it with the [🧨 diffusers library](https://github.com/huggingface/diffusers)
|
40 |
+
|
41 |
+
```py
|
42 |
+
>>> import torch
|
43 |
+
>>> from transformers import PreTrainedTokenizerFast, LlamaForCausalLM
|
44 |
+
>>> from diffusers import HiDreamImagePipeline
|
45 |
+
|
46 |
+
>>> tokenizer_4 = PreTrainedTokenizerFast.from_pretrained("meta-llama/Meta-Llama-3.1-8B-Instruct")
|
47 |
+
>>> text_encoder_4 = LlamaForCausalLM.from_pretrained(
|
48 |
+
... "meta-llama/Meta-Llama-3.1-8B-Instruct",
|
49 |
+
... output_hidden_states=True,
|
50 |
+
... output_attentions=True,
|
51 |
+
... torch_dtype=torch.bfloat16,
|
52 |
+
... )
|
53 |
+
|
54 |
+
>>> pipe = HiDreamImagePipeline.from_pretrained(
|
55 |
+
... "HiDream-ai/HiDream-I1-Full",
|
56 |
+
... scheduler=scheduler,
|
57 |
+
... tokenizer_4=tokenizer_4,
|
58 |
+
... text_encoder_4=text_encoder_4,
|
59 |
+
... torch_dtype=torch.bfloat16,
|
60 |
+
... )
|
61 |
+
>>> pipe.enable_model_cpu_offload()
|
62 |
+
>>> pipe.load_lora_weights(f"linoyts/HiDream-yarn-art-LoRA")
|
63 |
+
>>> image = pipe(f"yoda, yarn art style").images[0]
|
64 |
+
|
65 |
+
|
66 |
+
```
|
67 |
+
|
68 |
+
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)
|