File size: 1,324 Bytes
afe4c72
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
454b1b1
afe4c72
 
 
 
 
 
 
 
 
 
 
 
454b1b1
afe4c72
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
---
license: apache-2.0
language:
- en
- zh
base_model:
- FireRedTeam/FireRed-Image-Edit-1.0
pipeline_tag: image-to-image
tags:
- FireRed-Image-Edit-1.0
- distillation
- LoRA
library_name: diffusers
---

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.

use with diffusers 🧨:

make sure to install diffusers from `main` (`pip install git+https://github.com/huggingface/diffusers.git`)
```
from diffusers import QwenImageEditPlusPipeline
import torch 
from PIL import Image

pipe = QwenImageEditPlusPipeline.from_pretrained(
    "FireRedTeam/FireRed-Image-Edit-1.0", torch_dtype=torch.bfloat16,
).to("cuda")
pipe.load_lora_weights(
    "FireRedTeam/FireRed-Image-Edit-1.0-Lightning", weight_name="FireRed-Image-Edit-1.0-Lightning-8steps-v1.0.safetensors"
)

prompt = "在书本封面Python的下方,添加一行英文文字2nd Edition"
input_image_path = "./examples/edit_example.png"
input_image_raw = Image.open(input_image_path).convert('RGB')

image = pipe(
    image = [input_image_raw],
    prompt = prompt,
    height = None,
    width = None,
    num_inference_steps = 8,
    generator=torch.manual_seed(0),
    true_cfg_scale=1.0,  # 不使用标准 CFG
).images[0]
image.save("firered_image_edit_fewsteps.png")
```