File size: 4,233 Bytes
e6d3cbe
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29241f9
e6d3cbe
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29241f9
e6d3cbe
 
 
 
 
29241f9
e6d3cbe
 
 
 
 
 
29241f9
e6d3cbe
29241f9
 
e6d3cbe
 
 
 
 
 
 
 
 
29241f9
e6d3cbe
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29241f9
 
 
 
 
 
 
 
 
e6d3cbe
29241f9
e6d3cbe
29241f9
e6d3cbe
29241f9
e6d3cbe
29241f9
e6d3cbe
29241f9
e6d3cbe
29241f9
e6d3cbe
29241f9
e6d3cbe
29241f9
e6d3cbe
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
---
license: apache-2.0
language:
- en
base_model:
- black-forest-labs/FLUX.1-dev
pipeline_tag: text-to-image
tags:
- lora
- flux
- flux-dev
- realism
- character
- portrait
library_name: diffusers
---
## LORA FLUX.1-dev example

Lora for [FLUX.1-dev](https://huggingface.co/black-forest-labs/FLUX.1-dev)

**valentin** trigger word required

## 🌟 About FlyMy.AI

Agentic Infra for GenAI. FlyMy.AI is a B2B infrastructure for building and running GenAI Media agents.

**πŸ”— Useful Links:**
- 🌐 [Official Website](https://flymy.ai)
- πŸ“š [Documentation](https://docs.flymy.ai/intro)
- πŸ’¬ [Discord Community](https://discord.com/invite/t6hPBpSebw)
- πŸ€— [LoRA Training Repository](https://github.com/FlyMyAI/flymyai-lora-trainer)
- 🐦 [X (Twitter)](https://x.com/flymyai)
- πŸ’Ό [LinkedIn](https://linkedin.com/company/flymyai)
- πŸ“Ί [YouTube](https://youtube.com/@flymyai)
- πŸ“Έ [Instagram](https://www.instagram.com/flymy_ai)

# πŸ§ͺ Usage
---
### πŸ”§ Initialization

```python
from diffusers import DiffusionPipeline
import torch

model_name = "black-forest-labs/FLUX.1-dev"

# Load the pipeline
if torch.cuda.is_available():
    torch_dtype = torch.bfloat16
    device = "cuda"
else:
    torch_dtype = torch.float32
    device = "cpu"

pipe = DiffusionPipeline.from_pretrained(model_name, torch_dtype=torch_dtype)
pipe = pipe.to(device)
```

### πŸ”Œ Load LoRA Weights

```python
# Load LoRA weights
pipe.load_lora_weights('character_lora.safetensors', adapter_name="lora")
```

### 🎨 Generate Image with lora trained on person

```python
prompt = '''valentin sitting on a chair, portrait'''
negative_prompt = "blurry, low quality, distorted, bad anatomy"
image = pipe(
    prompt=prompt,
    negative_prompt=negative_prompt,
    width=1024,
    height=1024,
    num_inference_steps=28,
    guidance_scale=3.5,
    generator=torch.Generator(device="cuda").manual_seed(42)
).images[0]

# Display the image (in Jupyter or save to file)
image.show()
# or
image.save("output.png")
```

### πŸ–ΌοΈ Sample Output

![Sample Output](./assets/generations/gen2.jpg)

### Workflow Features

- βœ… Pre-configured for FLUX.1-dev + LoRA inference
- βœ… Optimized settings for best quality output
- βœ… Easy prompt and parameter adjustment
- βœ… Compatible with all our trained LoRA models

The ComfyUI workflow provides a user-friendly interface for generating images with our trained LoRA models without needing to write Python code.

### πŸ–ΌοΈ Workflow Screenshot

![ComfyUI Workflow](./assets/comfyui_workflow.png)

## 🎨 Generation Examples

Below are examples of images generated with our Valentin LoRA model:

### Official Style Portrait

**Prompt**: *"valentin official style portrait"*

![Official Style Portrait](./assets/generations/gen1.jpg)

### Cyberpunk Close-up

**Prompt**: *"valentin close up in a cyberpunk aesthetic, neon lighting, holographic elements, wearing futuristic clothing, standing in a neon-lit alley, sci-fi atmosphere, digital art"*

![Cyberpunk Close-up](./assets/generations/gen3.jpg)

### Greek City Portrait

**Prompt**: *"valentin wearing sunglasses and a hat in a Greek city"*

![Greek City Portrait](./assets/generations/gen5.jpg)

### Fluorescent Garden Editorial

**Prompt**: *"valentin, waist-up, standing in a fluorescent garden under blacklight, glowing bioluminescent plants, saturated purple and green hues, reflective sunglasses catching UV glints, surreal fashion editorial aesthetic, hyperreal depth, cinematic 85mm photography"*

![Fluorescent Garden Editorial](./assets/generations/gen7.jpg)

## πŸš€ Try it Online

Test this LoRA model directly in your browser:
- 🌐 [Try on FlyMy.AI Platform](https://app.flymy.ai/models/flymyai/flux-lora-trainer-fast)

## 🀝 Support

If you have questions or suggestions, join our community:
- 🌐 [FlyMy.AI](https://flymy.ai)
- πŸ“š [Documentation](https://docs.flymy.ai)
- πŸ’» [GitHub](https://github.com/flymy-ai)
- πŸ’¬ [Discord Community](https://discord.com/invite/t6hPBpSebw)
- 🐦 [Follow us on X](https://x.com/flymyai)
- πŸ’Ό [Connect on LinkedIn](https://linkedin.com/company/flymyai)
- πŸ“§ [Support](mailto:support@flymy.ai)

**⭐ Don't forget to star the repository if you like it!**

---
license: apache-2.0
---