Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,47 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
- zh
|
| 6 |
+
base_model:
|
| 7 |
+
- FireRedTeam/FireRed-Image-Edit-1.0
|
| 8 |
+
pipeline_tag: image-to-image
|
| 9 |
+
tags:
|
| 10 |
+
- FireRed-Image-Edit-1.0
|
| 11 |
+
- distillation
|
| 12 |
+
- LoRA
|
| 13 |
+
library_name: diffusers
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
Please refer to [FireRed-Image-Edit-1.0](https://huggingface.co/FireRedTeam/FireRed-Image-Edit-1.0) to learn how to use the distilled edit lora.
|
| 17 |
+
|
| 18 |
+
use with diffusers 🧨:
|
| 19 |
+
|
| 20 |
+
make sure to install diffusers from `main` (`pip install git+https://github.com/huggingface/diffusers.git`)
|
| 21 |
+
```
|
| 22 |
+
from diffusers import QwenImageEditPlusPipeline
|
| 23 |
+
import torch
|
| 24 |
+
from PIL import Image
|
| 25 |
+
|
| 26 |
+
pipe = pipe = QwenImageEditPlusPipeline.from_pretrained(
|
| 27 |
+
"FireRedTeam/FireRed-Image-Edit-1.0", torch_dtype=torch.bfloat16,
|
| 28 |
+
).to("cuda")
|
| 29 |
+
pipe.load_lora_weights(
|
| 30 |
+
"FireRedTeam/FireRed-Image-Edit-1.0-Lightning", weight_name="FireRed-Image-Edit-1.0-Lightning-8steps-v1.0.safetensors"
|
| 31 |
+
)
|
| 32 |
+
|
| 33 |
+
prompt = "在书本封面Python的下方,添加一行英文文字2nd Edition"
|
| 34 |
+
input_image_path = "./examples/edit_example.png"
|
| 35 |
+
input_image_raw = Image.open(input_image_path).convert('RGB')
|
| 36 |
+
|
| 37 |
+
image = pipe(
|
| 38 |
+
image = [input_image_raw],
|
| 39 |
+
prompt = instruction,
|
| 40 |
+
height = None,
|
| 41 |
+
width = None,
|
| 42 |
+
num_inference_steps = 8,
|
| 43 |
+
generator=torch.manual_seed(0),
|
| 44 |
+
true_cfg_scale=1.0, # 不使用标准 CFG
|
| 45 |
+
).images[0]
|
| 46 |
+
image.save("firered_image_edit_fewsteps.png")
|
| 47 |
+
```
|