Update app.py
Browse files
app.py
CHANGED
@@ -37,7 +37,7 @@ def process_prompt(prompt):
|
|
37 |
"""简单的提示词处理函数"""
|
38 |
return add_comma_after_pattern_ti(prompt)
|
39 |
|
40 |
-
DESCRIPTION = "梦羽的模型生成器 - 快速生成
|
41 |
|
42 |
if not torch.cuda.is_available():
|
43 |
DESCRIPTION += "\n<p>你现在运行在CPU上 但是此项目只支持GPU.</p>"
|
@@ -48,9 +48,6 @@ MAX_IMAGE_SIZE = 2048
|
|
48 |
if torch.cuda.is_available():
|
49 |
dtype = torch.bfloat16
|
50 |
device = "cuda"
|
51 |
-
else:
|
52 |
-
dtype = torch.float32
|
53 |
-
device = "cpu"
|
54 |
|
55 |
pipe = DiffusionPipeline.from_pretrained("Qwen/Qwen-Image", torch_dtype=dtype).to(device)
|
56 |
|
@@ -114,7 +111,7 @@ def infer(
|
|
114 |
"true_cfg_scale": guidance_scale,
|
115 |
"num_inference_steps": num_inference_steps,
|
116 |
"model": "qwen-image",
|
117 |
-
"PreUrl": "https://huggingface.co/
|
118 |
}
|
119 |
# Add metadata to the image
|
120 |
image_with_metadata = add_metadata_to_image(image, metadata)
|
|
|
37 |
"""简单的提示词处理函数"""
|
38 |
return add_comma_after_pattern_ti(prompt)
|
39 |
|
40 |
+
DESCRIPTION = "梦羽的模型生成器 - 快速生成 Qwen-image 模型的图片"
|
41 |
|
42 |
if not torch.cuda.is_available():
|
43 |
DESCRIPTION += "\n<p>你现在运行在CPU上 但是此项目只支持GPU.</p>"
|
|
|
48 |
if torch.cuda.is_available():
|
49 |
dtype = torch.bfloat16
|
50 |
device = "cuda"
|
|
|
|
|
|
|
51 |
|
52 |
pipe = DiffusionPipeline.from_pretrained("Qwen/Qwen-Image", torch_dtype=dtype).to(device)
|
53 |
|
|
|
111 |
"true_cfg_scale": guidance_scale,
|
112 |
"num_inference_steps": num_inference_steps,
|
113 |
"model": "qwen-image",
|
114 |
+
"PreUrl": "https://huggingface.co/spaces/Menyu/QwenImage"
|
115 |
}
|
116 |
# Add metadata to the image
|
117 |
image_with_metadata = add_metadata_to_image(image, metadata)
|