chestnutlzj commited on
Commit
4fe6d22
·
verified ·
1 Parent(s): 6044019

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +61 -3
README.md CHANGED
@@ -1,3 +1,61 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ - zh
6
+ library_name: diffusers
7
+ pipeline_tag: image-to-image
8
+ ---
9
+
10
+ # UniWorld-R1
11
+
12
+ <p align="center">
13
+ <a href="https://github.com/PKU-YuanGroup/Edit-R1"><b>Code</b></a> | <a href="https://github.com/PKU-YuanGroup/Edit-R1"><b>Dataset</b></a>
14
+ </p>
15
+
16
+
17
+ # Performance
18
+ |Benchmark| Qwen-Image-Edit-2509 | **Edit-R1-Qwen-Image-Edit-2509** |
19
+ | ---- | ---- | ----|
20
+ | GEdit-Bench | 7.54 | **7.76** |
21
+ | ImgEdit | 4.35 | **4.48** |
22
+
23
+ # Usage
24
+
25
+ ```python
26
+ import os
27
+ import torch
28
+ from PIL import Image
29
+ from diffusers import QwenImageEditPlusPipeline
30
+
31
+ pipeline = QwenImageEditPlusPipeline.from_pretrained("Qwen/Qwen-Image-Edit-2509", torch_dtype=torch.bfloat16)
32
+ print("pipeline loaded")
33
+
34
+ pipeline.load_lora_weights(
35
+ "chestnutlzj/Edit-R1-Qwen-Image-Edit-2509",
36
+ adapter_name="lora",
37
+ )
38
+ pipeline.set_adapters(["lora"], adapter_weights=[1])
39
+
40
+ pipeline.to('cuda')
41
+ pipeline.set_progress_bar_config(disable=None)
42
+ image1 = Image.open("input1.png")
43
+ image2 = Image.open("input2.png")
44
+ prompt = "The magician bear is on the left, the alchemist bear is on the right, facing each other in the central park square."
45
+ inputs = {
46
+ "image": [image1, image2],
47
+ "prompt": prompt,
48
+ "generator": torch.manual_seed(0),
49
+ "true_cfg_scale": 4.0,
50
+ "negative_prompt": " ",
51
+ "num_inference_steps": 40,
52
+ "guidance_scale": 1.0,
53
+ "num_images_per_prompt": 1,
54
+ }
55
+ with torch.inference_mode():
56
+ output = pipeline(**inputs)
57
+ output_image = output.images[0]
58
+ output_image.save("output_image_edit_plus.png")
59
+ print("image saved at", os.path.abspath("output_image_edit_plus.png"))
60
+
61
+ ```