Edit model card

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

import torch
from diffusers import StableDiffusionXLPipeline, StableDiffusionXLImg2ImgPipeline

# Ana model yükleme
pipeline = StableDiffusionXLPipeline.from_single_file(
    "https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/blob/main/sd_xl_base_1.0.safetensors",
    torch_dtype=torch.float16
).to("cuda")

# Refiner model yükleme
refiner = StableDiffusionXLImg2ImgPipeline.from_single_file(
    "https://huggingface.co/stabilityai/stable-diffusion-xl-refiner-1.0/blob/main/sd_xl_refiner_1.0.safetensors", 
    torch_dtype=torch.float16
).to("cuda")

# LoRA ağırlıklarını yükleme ve birleştirme
pipeline.load_lora_weights('codermert/mert2_flux', weight_name='flux_train_replicate.safetensors')
pipeline.fuse_lora(lora_scale=0.9)

# Prompt tanımlama
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."

# İlk aşama görüntü oluşturma
image = pipeline(
    prompt=prompt,
    num_inference_steps=24,
    guidance_scale=3.5,
    width=768,
    height=1024,
).images[0]

# Refiner ile görüntüyü iyileştirme
refined_image = refiner(
    prompt=prompt,
    image=image,
    num_inference_steps=30,
    guidance_scale=3.5,
).images[0]

# Son görüntüyü kaydetme
refined_image.save("example_refined.png")

For more details, including weighting, merging and fusing LoRAs, check the documentation on loading LoRAs in diffusers

Downloads last month
409
Inference API
Examples

Model tree for codermert/mert2_flux

Adapter
(8133)
this model