---
title: Qwen-Image-Edit-Lowres-Fix
canonical_url: "https://www.modelscope.cn/models/DiffSynth-Studio/Qwen-Image-Edit-Lowres-Fix"
md_url: "https://www.modelscope.cn/models/DiffSynth-Studio/Qwen-Image-Edit-Lowres-Fix.md"
repository: DiffSynth-Studio/Qwen-Image-Edit-Lowres-Fix
chinese_name: "Qwen-Image-Edit 低分辨率输入修复 LoRA"
last_updated: 2025-08-21
license: "Apache License 2.0"
base_model:
  - Qwen/Qwen-Image-Edit
base_model_relation: adapter
parameters: 235.9M
tensor_type:
  - BF16
library_name:
  - pytorch
  - safetensors
frameworks:
  - Pytorch
downloads: 1141
stars: 12
---

# Qwen-Image-Edit-Lowres-Fix

> Qwen-Image-Edit-Lowres-Fix - DiffSynth-Studio 在 ModelScope 开源的模型。Qwen-Image-Edit 低分辨率输入修复 LoRA

DiffSynth-Studio/Qwen-Image-Edit-Lowres-Fix 是 ModelScope 魔搭社区上的 235.9M 参数机器学习模型，采用 Apache License 2.0 许可，基于 Qwen/Qwen-Image-Edit 构建。

- **Repository**: DiffSynth-Studio/Qwen-Image-Edit-Lowres-Fix
- **License**: Apache License 2.0
- **Parameters**: 235.9M
- **Base model**: Qwen/Qwen-Image-Edit
- **Downloads**: 1141
- **Stars**: 12
- **Last updated**: 2025-08-21

Source: https://www.modelscope.cn/models/DiffSynth-Studio/Qwen-Image-Edit-Lowres-Fix

---

# Qwen-Image-Edit 低分辨率输入修复 LoRA

## 模型介绍

[Qwen-Image-Edit](https://www.modelscope.cn/models/Qwen/Qwen-Image-Edit) 是一个强大的开源图像编辑模型。然而，当模型的输入分辨率低于图像生成的目标分辨率时，模型的图像细节保持能力较差。为此，我们做了以下两点改动：
1. Rope 插值: 将 Qwen-Image DiT 的输入图像的位置编码改为在目标分辨率下位置编码的插值采样，这一改动可独立于改动2生效。
2. LoRA 微调: 快速训练一个 LoRA 模型，让 DiT 增强该插值编码的泛化性。

经过以上两点改动，模型可以输入低分辨率图像的情况下，得到图像一致的编辑图像。同时，相比于高分辨率输入，模型推理时长大大降低。
## 效果展示
图像编辑指令: 将裙子变为粉色。
|输入分辨率|A100推理时长|输入图|原模型|Rope 插值|Rope 插值 + LoRA 微调|
|-|-|-|-|-|-|
|256x256| 39 s |![](./assets/image1.jpg)|![](./assets/origin_256.jpg)|![](./assets/rope_256.jpg)|![](./assets/lora_256.jpg)|
|512x512| 50 s |![](./assets/image1.jpg)|![](./assets/origin_512.jpg)|![](./assets/rope_512.jpg)|![](./assets/lora_512.jpg)|
|768x768| 67 s |![](./assets/image1.jpg)|![](./assets/origin_768.jpg)|![](./assets/rope_768.jpg)|![](./assets/lora_768.jpg)|
|1024x1024| 98 s|![](./assets/image1.jpg)|![](./assets/origin_1024.jpg)|![](./assets/origin_1024.jpg)|![](./assets/lora_1024.jpg)|

## 局限性
1. 以低分辨率输入，高分辨率生成，推理时长会大大降低，但可能会降低模型编辑性能。
2. 以上分析仅针对图像的细节保持能力。

## 推理代码
```
git clone https://github.com/modelscope/DiffSynth-Studio.git  
cd DiffSynth-Studio
pip install -e .
```

```python
from diffsynth.pipelines.qwen_image import QwenImagePipeline, ModelConfig
import torch
from modelscope import snapshot_download

pipe = QwenImagePipeline.from_pretrained(
    torch_dtype=torch.bfloat16,
    device="cuda",
    model_configs=[
        ModelConfig(model_id="Qwen/Qwen-Image-Edit", origin_file_pattern="transformer/diffusion_pytorch_model*.safetensors"),
        ModelConfig(model_id="Qwen/Qwen-Image", origin_file_pattern="text_encoder/model*.safetensors"),
        ModelConfig(model_id="Qwen/Qwen-Image", origin_file_pattern="vae/diffusion_pytorch_model.safetensors"),
    ],
    tokenizer_config=None,
    processor_config=ModelConfig(model_id="Qwen/Qwen-Image-Edit", origin_file_pattern="processor/"),
)
snapshot_download("DiffSynth-Studio/Qwen-Image-Edit-Lowres-Fix", local_dir="models/DiffSynth-Studio/Qwen-Image-Edit-Lowres-Fix", allow_file_pattern="model.safetensors")
pipe.load_lora(pipe.dit, "models/DiffSynth-Studio/Qwen-Image-Edit-Lowres-Fix/model.safetensors")

prompt = "精致肖像，水下少女，蓝裙飘逸，发丝轻扬，光影透澈，气泡环绕，面容恬静，细节精致，梦幻唯美。"
image = pipe(prompt=prompt, seed=0, num_inference_steps=40, height=1024, width=768)
image.save("image.jpg")

prompt = "将裙子变成粉色"
image = image.resize((512, 384))
image = pipe(prompt, edit_image=image, seed=1, num_inference_steps=40, height=1024, width=768, edit_rope_interpolation=True, edit_image_auto_resize=False)
image.save(f"image2.jpg")
```
