đ reddy-v3
This project is a standard PEFT LoRA derived from black-forest-labs/FLUX.1-dev, which is mainly used for text - to - image generation tasks, offering high - quality image generation capabilities.
đ Quick Start
Installation
The installation mainly involves setting up the necessary Python environment and installing relevant libraries. You need to ensure that Python and PyTorch are installed, and then install the diffusers
library.
Inference
import torch
from diffusers import DiffusionPipeline
model_id = 'black-forest-labs/FLUX.1-dev'
adapter_id = 'Unmapped2895/reddy-v3'
pipeline = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16)
pipeline.load_lora_weights(adapter_id)
prompt = "Realistic wide shot photo of woman posing in a luxurious satin lingerie set, featuring a plunging bra, delicate thong and a classic garter belt with black stockings. The satin lingerie shimmers softly in the light, and the cut emphasizes both sophistication and a hint of allure. The lingerie is detailed with fine lace edges, highlighting her alluring figure. She elegantly styled hair as if getting ready for a formal event. The photo has a cinematic quality with rays of light and dramatic play of shadow and light"
from optimum.quanto import quantize, freeze, qint8
quantize(pipeline.transformer, weights=qint8)
freeze(pipeline.transformer)
pipeline.to('cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu')
model_output = pipeline(
prompt=prompt,
num_inference_steps=20,
generator=torch.Generator(device='cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu').manual_seed(42),
width=832,
height=1216,
guidance_scale=3.5,
).images[0]
model_output.save("output.png", format="PNG")
⨠Features
- Text - to - Image Generation: Capable of generating high - quality images based on text prompts.
- LoRA Adaptation: Utilizes the LoRA technique for efficient model adaptation.
- Multiple Image Styles: Can generate various image styles, such as photography, cyberpunk, etc.
đĻ Installation
The installation mainly involves setting up the Python environment and installing relevant libraries. You need to ensure that Python and PyTorch are installed, and then install the diffusers
library.
đģ Usage Examples
Basic Usage
import torch
from diffusers import DiffusionPipeline
model_id = 'black-forest-labs/FLUX.1-dev'
adapter_id = 'Unmapped2895/reddy-v3'
pipeline = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16)
pipeline.load_lora_weights(adapter_id)
prompt = "Realistic wide shot photo of woman posing in a luxurious satin lingerie set, featuring a plunging bra, delicate thong and a classic garter belt with black stockings. The satin lingerie shimmers softly in the light, and the cut emphasizes both sophistication and a hint of allure. The lingerie is detailed with fine lace edges, highlighting her alluring figure. She elegantly styled hair as if getting ready for a formal event. The photo has a cinematic quality with rays of light and dramatic play of shadow and light"
pipeline.to('cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu')
model_output = pipeline(
prompt=prompt,
num_inference_steps=20,
generator=torch.Generator(device='cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu').manual_seed(42),
width=832,
height=1216,
guidance_scale=3.5,
).images[0]
model_output.save("output.png", format="PNG")
Advanced Usage
model_output = pipeline(
prompt=prompt,
num_inference_steps=20,
generator=torch.Generator(device='cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu').manual_seed(42),
width=832,
height=1216,
guidance_scale=5.0,
).images[0]
model_output.save("output_advanced.png", format="PNG")
đ Documentation
Validation settings
Property |
Details |
CFG |
3.5 |
CFG Rescale |
0.0 |
Steps |
20 |
Sampler |
FlowMatchEulerDiscreteScheduler |
Seed |
42 |
Resolution |
832x1216 |
Skip - layer guidance |
None |
Note: The validation settings are not necessarily the same as the training settings.
Training settings
Property |
Details |
Training epochs |
10 |
Training steps |
2000 |
Learning rate |
0.0001 |
Learning rate schedule |
constant |
Warmup steps |
500 |
Max grad value |
2.0 |
Effective batch size |
1 |
Micro - batch size |
1 |
Gradient accumulation steps |
1 |
Number of GPUs |
1 |
Gradient checkpointing |
True |
Prediction type |
flow - matching (extra parameters=['shift=3', 'flux_guidance_mode=constant', 'flux_guidance_value=1.0', 'flow_matching_loss=compatible', 'flux_lora_target=all']) |
Optimizer |
adamw_bf16 |
Trainable parameter precision |
Pure BF16 |
Base model precision |
int8 - quanto |
Caption dropout probability |
1.0% |
LoRA Rank |
32 |
LoRA Alpha |
None |
LoRA Dropout |
0.1 |
LoRA initialisation style |
default |
Datasets
reddy - v2 - 512
Property |
Details |
Repeats |
10 |
Total number of images |
13 |
Total number of aspect buckets |
1 |
Resolution |
0.262144 megapixels |
Cropped |
False |
Crop style |
None |
Crop aspect |
None |
Used for regularisation data |
No |
reddy - v2 - 1024
Property |
Details |
Repeats |
10 |
Total number of images |
5 |
Total number of aspect buckets |
1 |
Resolution |
1.048576 megapixels |
Cropped |
False |
Crop style |
None |
Crop aspect |
None |
Used for regularisation data |
No |
đ§ Technical Details
The model is a PEFT LoRA model based on the black - forest - labs/FLUX.1 - dev
base model. During training, a series of parameter settings are used, such as learning rate, batch size, etc., to optimize the model. The prediction type uses flow - matching, which is a new generation method that can generate high - quality images. The text encoder is not trained, and the text encoder of the base model can be reused for inference.
đ License
The license type is other. For detailed license information, please refer to the relevant documentation of the base model.