修改步数

This commit is contained in:
zhxiao 2025-05-08 09:27:01 +08:00
parent a51d1fd2d5
commit bf877c81fe
1 changed files with 6 additions and 4 deletions

View File

@ -178,7 +178,7 @@ def setup_environment():
raise RuntimeError("无法导入自定义节点,程序无法继续运行")
# 主要图像生成函数
def generate_image(prompt, prompt_negative, structure_image_path, style_image_path, depth_strength=15, style_strength=0.5, edge_mode="depth"):
def generate_image(prompt, prompt_negative, structure_image_path, style_image_path, depth_strength=15, style_strength=0.5, edge_mode="depth", steps=28):
"""
主要生成函数处理输入并返回生成图像的路径
@ -455,7 +455,7 @@ def generate_image(prompt, prompt_negative, structure_image_path, style_image_pa
# 调度器决定了如何从噪声逐步生成图像
schedule = basicscheduler.get_sigmas(
scheduler="simple", # 简单调度器
steps=28, # 采样步数
steps=steps, # 采样步数
denoise=1, # 去噪强度
model=get_value_at_index(UNET_MODEL, 0), # UNET模型
)
@ -544,8 +544,9 @@ async def create_image(
structure_image: UploadFile = File(...),
style_image: UploadFile = File(...),
depth_strength: float = Form(15.0),
steps: int = Form(28),
style_strength: float = Form(0.5),
edge_mode: str = Form("")
edge_mode: str = Form("depth")
):
# 保存上传的文件
logger.info("模式为:"+edge_mode)
@ -565,7 +566,8 @@ async def create_image(
style_image_path=style_path,
depth_strength=depth_strength,
style_strength=style_strength,
edge_mode=edge_mode
edge_mode=edge_mode,
steps=steps
)
# 返回生成的图像