KvLove commited on
Commit
ff9abff
·
verified ·
1 Parent(s): 4e7e00a

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +75 -3
README.md CHANGED
@@ -1,3 +1,75 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## LORA Qwen-Image example
2
+
3
+ World first lora for [Qwen-Image](https://huggingface.co/Qwen/Qwen-Image)
4
+ Trigger word: **Valentin**
5
+
6
+ ## 🧪 Usage
7
+ ---
8
+ ### 🔧 Initialization
9
+
10
+ ```python
11
+ from diffusers import DiffusionPipeline
12
+ import torch
13
+
14
+ model_name = "Qwen/Qwen-Image"
15
+
16
+ # Load the pipeline
17
+ if torch.cuda.is_available():
18
+ torch_dtype = torch.bfloat16
19
+ device = "cuda"
20
+ else:
21
+ torch_dtype = torch.float32
22
+ device = "cpu"
23
+
24
+ pipe = DiffusionPipeline.from_pretrained(model_name, torch_dtype=torch_dtype)
25
+ pipe = pipe.to(device)
26
+ ```
27
+
28
+ ### 🔌 Load LoRA Weights
29
+
30
+ ```python
31
+ # Load LoRA weights
32
+ pipe.load_lora_weights('pytorch_lora_weights.safetensors', adapter_name="lora")
33
+ ```
34
+
35
+ ### 🎨 Generate Image with lora trained on person
36
+
37
+ ```python
38
+ prompt = '''Valentin in a natural daylight selfie at a cafe entrance. He looks seriously into the camera, wearing a black coat or jacket and wireless earbud. Background includes wooden frames, warm pendant lights, and urban cafe details. With text "FLYMY AI"'''
39
+ negative_prompt = " "
40
+ image = pipe(
41
+ prompt=prompt,
42
+ negative_prompt=negative_prompt,
43
+ width=1024,
44
+ height=1024,
45
+ num_inference_steps=50,
46
+ true_cfg_scale=5,
47
+ generator=torch.Generator(device="cuda").manual_seed(346346)
48
+ )
49
+
50
+ # Display the image (in Jupyter or save to file)
51
+ image.show()
52
+ # or
53
+ image.save("output.png")
54
+ ```
55
+
56
+ ### 🖼️ Sample Output
57
+
58
+ ![Sample Output](./assets/Valentin.jpg)
59
+
60
+
61
+ ## 🤝 Support
62
+
63
+ If you have questions or suggestions, join our community:
64
+ - 🌐 [FlyMy.AI](https://flymy.ai)
65
+ - 💬 [Discord Community](https://discord.com/invite/t6hPBpSebw)
66
+ - 🐦 [Follow us on X](https://x.com/flymyai)
67
+ - 💼 [Connect on LinkedIn](https://linkedin.com/company/flymyai)
68
+ - 📧 [Support](mailto:[email protected])
69
+
70
+ **⭐ Don't forget to star the repository if you like it!**
71
+
72
+
73
+ ---
74
+ license: apache-2.0
75
+ ---