diff --git a/comfy/cli_args.py b/comfy/cli_args.py index 381d5a6bd..ffb03cd40 100644 --- a/comfy/cli_args.py +++ b/comfy/cli_args.py @@ -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.") diff --git a/main.py b/main.py index 6a39db6e4..6a5d61300 100644 --- a/main.py +++ b/main.py @@ -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() diff --git a/server.py b/server.py index ac0b15f2c..f5d3df988 100644 --- a/server.py +++ b/server.py @@ -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 -> RGBA(Alpha=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 -> RGBA(Alpha=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'