Edit-R1
Collection
5 items
•
Updated
•
6
This model is part of the work presented in the paper Uniworld-V2: Reinforce Image Editing with Diffusion Negative-aware Finetuning and MLLM Implicit Feedback.
| Benchmark | FLUX.1-Kontext-dev | Edit-R1-FLUX.1-Kontext-dev |
|---|---|---|
| GEdit-Bench | 6.00 | 6.74 |
| ImgEdit | 3.71 | 4.02 |
import torch
from diffusers import FluxKontextPipeline
from diffusers.utils import load_image
pipe = FluxKontextPipeline.from_pretrained("black-forest-labs/FLUX.1-Kontext-dev", torch_dtype=torch.bfloat16)
pipe.load_lora_weights(
"chestnutlzj/Edit-R1-FLUX.1-Kontext-dev",
adapter_name="lora",
)
pipe.set_adapters(["lora"], adapter_weights=[1])
pipe.to("cuda")
input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png")
image = pipe(
image=input_image,
prompt="Add a hat to the cat",
guidance_scale=2.5
).images[0]
FLUX.1-Kontext-dev falls under the FLUX.1 [dev] Non-Commercial License.