---
title: FLUX.1-Kontext-dev-lora-highresfix
canonical_url: "https://www.modelscope.cn/models/DiffSynth-Studio/FLUX.1-Kontext-dev-lora-highresfix"
md_url: "https://www.modelscope.cn/models/DiffSynth-Studio/FLUX.1-Kontext-dev-lora-highresfix.md"
repository: DiffSynth-Studio/FLUX.1-Kontext-dev-lora-highresfix
chinese_name: "高分辨率修复 - Kontext 图像编辑 LoRA"
last_updated: 2025-07-07
license: "Apache License 2.0"
pipeline_tag: text-to-image-synthesis
tasks:
  - text-to-image-synthesis
base_model:
  - "MusePublic/FLUX.1-Kontext-Dev@v1"
base_model_relation: adapter
parameters: 153.2M
tensor_type:
  - BF16
  - F32
library_name:
  - pytorch
  - lora
  - safetensors
frameworks:
  - Pytorch
supports_inference: img2img
downloads: 2121
stars: 72
tags:
  - LoRA
  - text-to-image
---

# FLUX.1-Kontext-dev-lora-highresfix

> FLUX.1-Kontext-dev-lora-highresfix - DiffSynth-Studio 在 ModelScope 开源的模型。高分辨率修复 - Kontext 图像编辑 LoRA

DiffSynth-Studio/FLUX.1-Kontext-dev-lora-highresfix 是 ModelScope 魔搭社区上的 153.2M 参数text-to-image-synthesis模型，采用 Apache License 2.0 许可，基于 MusePublic/FLUX.1-Kontext-Dev@v1 构建，并支持在线推理（img2img）。

- **Repository**: DiffSynth-Studio/FLUX.1-Kontext-dev-lora-highresfix
- **License**: Apache License 2.0
- **Tasks**: text-to-image-synthesis
- **Parameters**: 153.2M
- **Base model**: MusePublic/FLUX.1-Kontext-Dev@v1
- **Online inference**: img2img
- **Tags**: LoRA, text-to-image
- **Downloads**: 2121
- **Stars**: 72
- **Last updated**: 2025-07-07

Source: https://www.modelscope.cn/models/DiffSynth-Studio/FLUX.1-Kontext-dev-lora-highresfix

---

# 高分辨率修复 - Kontext 图像编辑 LoRA

## 模型介绍

本 LoRA 模型是基于 [Kontext](https://www.modelscope.cn/models/black-forest-labs/FLUX.1-Kontext-dev) 模型和 [DiffSynth-Studio](https://github.com/modelscope/DiffSynth-Studio) 训练的 LoRA 模型，使用本模型后，可输入指令 `Improve the clarity.` 提高图像的清晰度。

## 模型效果

||样例 1|样例 2|样例 3|
|-|-|-|-|
|原图|![](./assets/image_0.jpg)|![](./assets/image_6.jpg)|![](./assets/image_14.jpg)|
|生成图|![](./assets/image_0_fix.jpg)|![](./assets/image_6_fix.jpg)|![](./assets/image_14_fix.jpg)|

||样例 4|样例 5|样例 6 (是的，可以处理正常图片)|
|-|-|-|-|
|原图|![](./assets/image_1.jpg)|![](./assets/image_3.jpg)|![](./assets/image_2.jpg)|
|生成图|![](./assets/image_1_fix.jpg)|![](./assets/image_3_fix.jpg)|![](./assets/image_2_fix.jpg)|

## 使用说明

本模型基于框架 [DiffSynth-Studio](https://github.com/modelscope/DiffSynth-Studio/tree/main/examples/flux) 训练，请先安装

```
git clone https://github.com/modelscope/DiffSynth-Studio.git  
cd DiffSynth-Studio
pip install -e .
```

```python
import torch
from diffsynth.pipelines.flux_image_new import FluxImagePipeline, ModelConfig
from PIL import Image
from modelscope import snapshot_download

snapshot_download("DiffSynth-Studio/FLUX.1-Kontext-dev-lora-highresfix", cache_dir="./models")
pipe = FluxImagePipeline.from_pretrained(
    torch_dtype=torch.bfloat16,
    device="cuda",
    model_configs=[
        ModelConfig(model_id="black-forest-labs/FLUX.1-Kontext-dev", origin_file_pattern="flux1-kontext-dev.safetensors"),
        ModelConfig(model_id="black-forest-labs/FLUX.1-dev", origin_file_pattern="text_encoder/model.safetensors"),
        ModelConfig(model_id="black-forest-labs/FLUX.1-dev", origin_file_pattern="text_encoder_2/"),
        ModelConfig(model_id="black-forest-labs/FLUX.1-dev", origin_file_pattern="ae.safetensors"),
    ],
)
pipe.load_lora(pipe.dit, "models/DiffSynth-Studio/FLUX.1-Kontext-dev-lora-highresfix/model.safetensors", alpha=1)

image = Image.open("your_image.jpg")
image = pipe(
    prompt="Improve the clarity.",
    kontext_images=image,
    embedded_guidance=2.5,
    seed=0,
)
image.save("output.jpg")
```
