alfredplpl
commited on
Commit
•
a5a34d5
1
Parent(s):
d05c541
Update README.md
Browse files
README.md
CHANGED
@@ -22,6 +22,35 @@ tags:
|
|
22 |
6. Get the following image.
|
23 |
![example](example.jpg)
|
24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
### Examples
|
26 |
|
27 |
**Please use ChatGPT or Claude to make a prompt!**
|
|
|
22 |
6. Get the following image.
|
23 |
![example](example.jpg)
|
24 |
|
25 |
+
- diffusers
|
26 |
+
1. Download [v0.1 lora](modern-anime-lora_diffusers.safetensors).
|
27 |
+
2. Run the script:
|
28 |
+
```python
|
29 |
+
import torch
|
30 |
+
import peft
|
31 |
+
from diffusers import FluxPipeline, FluxTransformer2DModel
|
32 |
+
|
33 |
+
pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16)
|
34 |
+
pipe.load_lora_weights("/mnt/NVM/flux/modern-anime-lora_diffusers.safetensors")
|
35 |
+
pipe=pipe.to("cuda")
|
36 |
+
|
37 |
+
prompt = "modern anime style, An anime girl holding a sword. She is wearing school uniform. She is saying \"Hello World\" with the speech bubble."
|
38 |
+
image = pipe(
|
39 |
+
prompt,
|
40 |
+
height=1344,
|
41 |
+
width=768,
|
42 |
+
guidance_scale=3.5,
|
43 |
+
output_type="pil",
|
44 |
+
num_inference_steps=50,
|
45 |
+
max_sequence_length=512,
|
46 |
+
generator=torch.Generator(device="cuda").manual_seed(0),
|
47 |
+
joint_attention_kwargs={"scale": 1.0}
|
48 |
+
).images[0]
|
49 |
+
image.save("flux-dev.png")
|
50 |
+
```
|
51 |
+
3. Get the following image:
|
52 |
+
![flux-dev](flux-dev.jpg)
|
53 |
+
|
54 |
### Examples
|
55 |
|
56 |
**Please use ChatGPT or Claude to make a prompt!**
|