kailashtryonlabs
commited on
Commit
•
badfb7e
1
Parent(s):
94093c7
Update README.md
Browse files
README.md
CHANGED
@@ -23,6 +23,32 @@ FLUX.1-dev LoRA Lehenga Generator can create an image of Lehenga by detailing th
|
|
23 |
AI Toolkit by Ostris
|
24 |
https://github.com/ostris/ai-toolkit
|
25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
## Download model
|
27 |
|
28 |
Weights for this model are available in Safetensors format.
|
|
|
23 |
AI Toolkit by Ostris
|
24 |
https://github.com/ostris/ai-toolkit
|
25 |
|
26 |
+
|
27 |
+
## Use it with the [🧨 diffusers library](https://github.com/huggingface/diffusers)
|
28 |
+
|
29 |
+
```py
|
30 |
+
import random
|
31 |
+
from diffusers import FluxPipeline
|
32 |
+
import torch
|
33 |
+
|
34 |
+
MAX_SEED=42
|
35 |
+
PRE_TRAINED_MODEL = "black-forest-labs/FLUX.1-dev"
|
36 |
+
FINE_TUNED_MODEL = "tryonlabs/FLUX.1-dev-LoRA-Lehenga-Generator"
|
37 |
+
|
38 |
+
# Load Flux.1-dev
|
39 |
+
pipe = FluxPipeline.from_pretrained(PRE_TRAINED_MODEL, torch_dtype=torch.float16).to("cuda")
|
40 |
+
|
41 |
+
# Load fine-tuned model
|
42 |
+
pipe.load_lora_weights(FINE_TUNED_MODEL, adapter_name="default", weight_name="lehenga-generator.safetensors")
|
43 |
+
|
44 |
+
seed = random.randint(0, MAX_SEED)
|
45 |
+
generator = torch.Generator().manual_seed(seed)
|
46 |
+
prompt = "A flat lay image of a lehenga with a pink solid pattern and traditional style is elegantly fitted, showcasing a floor-length hemline that flows beautifully. Crafted from luxurious silk, this garment features a stretchy fabric that ensures comfort and a flattering fit. The lehenga is sleeveless, allowing for unrestricted movement, and it is adorned with a sweetheart neckline that adds a touch of femininity. The fitted waistline accentuates the wearer's silhouette, making it a stunning choice for special occasions."
|
47 |
+
image = pipe(prompt, height=1024, width=1024, num_images_per_prompt=1, generator=generator, guidance_scale=4.5, num_inference_steps=40).images[0]
|
48 |
+
|
49 |
+
image.save("gen_image.jpg")
|
50 |
+
```
|
51 |
+
|
52 |
## Download model
|
53 |
|
54 |
Weights for this model are available in Safetensors format.
|