File size: 2,913 Bytes
d4f6074
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
---
license: apache-2.0
language:
- en
base_model:
- Qwen/Qwen-Image-Edit-2509
tags:
- image-generation
- lora
- Qwen-Image
pipeline_tag: image-to-image
library_name: diffusers
widget:
- text: >-
    Upscale this picture to 4K resolution. 
  output:
    url: result/result1.png
- text: >-
    Upscale this picture to 4K resolution.
  output:
    url: result/result2.png
- text: >-
    Upscale this picture to 4K resolution.  
  output:
    url: result/result3.png

---
# starsfriday Qwen-Image-Edit-2509 LoRA

<Gallery />

## Model Card for Model ID

<!-- Provide a quick summary of what the model is/does. -->

This is a model for High-definition magnification of the picture, trained on ```Qwen/Qwen-Image-Edit-2509```, and it is mainly used for losslessly enlarging images to approximately 2K size.For use in ```ComfyUI```.

<div style="background-color: white; padding: 15px; border-radius: 8px; margin: 15px 0; box-shadow: 0 2px 4px rgba(0,0,0,0.1);">
  <h2 style="color: #24292e; margin-top: 0;">ComfyUI Workflow</h2>
  <p>This LoRA works with a modified version of <a href="https://huggingface.co/starsfriday/Qwen-Image-Edit-2509-Upscale2K/blob/main/Upscale.json" style="color: #0366d6; text-decoration: none;">Comfy's Qwen/Qwen-Image-Edit-2509 workflow</a>. The main modification is adding a Qwen/Qwen-Image-Edit-2509 LoRA node connected to the base model.</p>
  <p>See the Downloads section above for the modified workflow.</p>
</div>

### Direct Use

```
from diffusers import QwenImageEditPipeline
import torch
from PIL import Image

# Load the pipeline
pipeline = QwenImageEditPipeline.from_pretrained("Qwen/Qwen-Image-Edit-2509")
pipeline.to(torch.bfloat16)
pipeline.to("cuda")

# Load trained LoRA weights for in-scene editing
pipeline.load_lora_weights("starsfriday/Qwen-Image-Edit-2509-Upscale2K", weight_name="qwen_image_edit_2509_upscale.safetensors")

# Load input image
image = Image.open("./result/test.jpg").convert("RGB")

# Define in-scene editing prompt
prompt = "Upscale this picture to 4K resolution."

# Generate edited image with enhanced scene understanding
inputs = {
    "image": image,
    "prompt": prompt,
    "generator": torch.manual_seed(12345),
    "true_cfg_scale": 4.0,
    "negative_prompt": " ",
    "num_inference_steps": 50,
}

with torch.inference_mode():
    output = pipeline(**inputs)
    output_image = output.images[0]
    output_image.save("edited_image.png")


```

## Trigger phrase

```Upscale this picture to 4K resolution.```

There is no fixed trigger word. The specific removal prompt needs to be tested more

## Download model

Weights for this model are available in Safetensors format.

[Download](https://huggingface.co/starsfriday/Qwen-Image-Edit-2509-Upscale2K)

## Training at Chongqing Valiant Cat

This model was trained by the AI Laboratory of Chongqing Valiant Cat Technology Co., LTD(```https://vvicat.com/```).Business cooperation is welcome