if args.disable_trigger_vercel_deploy is None:

This commit is contained in:
bilt 2025-07-31 16:54:23 +08:00
parent 5c531364c2
commit ffa1b09ae7
3 changed files with 24 additions and 23 deletions

View File

@ -49,7 +49,7 @@ parser.add_argument("--temp-directory", type=str, default=None, help="Set the Co
parser.add_argument("--input-directory", type=str, default=None, help="Set the ComfyUI input directory. Overrides --base-directory.")
parser.add_argument("--auto-launch", action="store_true", help="Automatically launch ComfyUI in the default browser.")
parser.add_argument("--disable-auto-launch", action="store_true", help="Disable auto launching the browser.")
parser.add_argument("--disable_trigger_vercel_deploy", action="store_true", help="Disable vercel deploy.")
parser.add_argument("--disable_trigger_vercel_deploy", default=None, action="store_true", help="Disable vercel deploy.")
parser.add_argument("--frp_remote_port_idx", type=int, default=None, help="Set remote port idx.")
parser.add_argument("--cuda-device", type=int, default=None, metavar="DEVICE_ID", help="Set the id of the cuda device this instance will use.")

View File

@ -157,6 +157,7 @@ if __name__ == "__main__":
notion.add_record_to_notion_database("http://111.170.148.226:21663/")
notion.add_record_to_notion_database("http://111.170.148.226:21664/")
print("disable_trigger_vercel_deploy: ", args.disable_trigger_vercel_deploy)
if args.disable_trigger_vercel_deploy is None:
trigger_vercel_deploy()

View File

@ -525,30 +525,30 @@ class PromptServer():
return web.Response(body=alpha_buffer.read(), content_type='image/png',
headers={"Content-Disposition": f"filename=\"{filename}\""})
# elif channel == 'rgba':
# with Image.open(file) as img:
# # 确保图像是 RGBA 模式
# if img.mode != 'RGBA':
# if img.mode == 'RGB':
# # RGB -> RGBAAlpha=255
# new_img = img.convert('RGBA')
# else:
# # 其他模式(如 L/LA/P-> RGBA
# new_img = Image.new('RGBA', img.size, (0, 0, 0, 255))
# new_img.paste(img, (0, 0), img) # 保留原图的 Alpha如果有
elif channel == 'rgba':
with Image.open(file) as img:
# 确保图像是 RGBA 模式
if img.mode != 'RGBA':
if img.mode == 'RGB':
# RGB -> RGBAAlpha=255
new_img = img.convert('RGBA')
else:
# 其他模式(如 L/LA/P-> RGBA
new_img = Image.new('RGBA', img.size, (0, 0, 0, 255))
new_img.paste(img, (0, 0), img) # 保留原图的 Alpha如果有
# else:
# new_img = img # 已经是 RGBA无需转换
else:
new_img = img # 已经是 RGBA无需转换
# # 保存为 PNG 并返回
# buffer = BytesIO()
# new_img.save(buffer, format='PNG')
# buffer.seek(0)
# return web.Response(
# body=buffer.read(),
# content_type='image/png',
# headers={"Content-Disposition": f"filename=\"{filename}\""}
# )
# 保存为 PNG 并返回
buffer = BytesIO()
new_img.save(buffer, format='PNG')
buffer.seek(0)
return web.Response(
body=buffer.read(),
content_type='image/png',
headers={"Content-Disposition": f"filename=\"{filename}\""}
)
else:
# Get content type from mimetype, defaulting to 'application/octet-stream'