|
--- |
|
license: other |
|
license_name: flux-1-dev-non-commercial-license |
|
license_link: https://huggingface.co/black-forest-labs/FLUX.1-dev/blob/main/LICENSE.md |
|
language: |
|
- en |
|
tags: |
|
- flux |
|
- diffusers |
|
- lora |
|
base_model: "black-forest-labs/FLUX.1-dev" |
|
pipeline_tag: text-to-image |
|
instance_prompt: mert |
|
--- |
|
|
|
# mert LoRa Trainer (developing...) |
|
|
|
Trained on Replicate using: |
|
|
|
https://replicate.com/ostris/flux-dev-lora-trainer/train |
|
|
|
|
|
## Trigger words |
|
You should use `mert` to trigger the image generation. |
|
|
|
|
|
## Use it with the [🧨 diffusers library](https://github.com/huggingface/diffusers) |
|
|
|
```py |
|
import torch |
|
from diffusers import FluxPipeline |
|
|
|
pipe = FluxPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-0.9", torch_dtype=torch.bfloat16) |
|
pipe.load_lora_weights('codermert/mert_flux', weight_name='flux_train_replicate.safetensors') |
|
pipe.fuse_lora(lora_scale=0.9) |
|
pipe.to("cuda") |
|
|
|
prompt = "close up portrait, Amidst the interplay of light and shadows in a photography studio,a soft spotlight traces the contours of a face,highlighting a figure clad in a sleek black turtleneck. The garment,hugging the skin with subtle luxury,complements the Caucasian model's understated makeup,embodying minimalist elegance. Behind,a pale gray backdrop extends,its fine texture shimmering subtly in the dim light,artfully balancing the composition and focusing attention on the subject. In a palette of black,gray,and skin tones,simplicity intertwines with profundity,as every detail whispers untold stories." |
|
|
|
image = pipe(prompt, |
|
num_inference_steps=24, |
|
guidance_scale=3.5, |
|
width=768, height=1024, |
|
).images[0] |
|
image.save(f"example.png") |
|
``` |
|
|
|
For more details, including weighting, merging and fusing LoRAs, check the [documentation on loading LoRAs in diffusers](https://huggingface.co/docs/diffusers/main/en/using-diffusers/loading_adapters) |