FireRedTeam's picture
Update README.md
454b1b1 verified
metadata
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 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")