ComfyUI icon indicating copy to clipboard operation
ComfyUI copied to clipboard

post upload/mask not work

Open kanbekotori opened this issue 3 years ago • 2 comments

The restful tool has returned the correct result, but there are no images in the dir.

{ name: "demo-mask.png", subfolder: "123", type: "input" }
WechatIMG48

Is this a bug?

kanbekotori avatar Nov 30 '23 08:11 kanbekotori

A current-source path can produce this success-without-file symptom: at 7f7fd918ed0815c5d5ef2ccfe44bfc8e72cfd217, the shared image_upload helper discards the mask callback return. The callback returns HTTP400/403 for rejected original references, but the outer helper proceeds to asset registration and success JSON. A missing original file also performs no save and implicitly returns None.

An offline test executing the exact nested helper/route definitions with temporary synthetic files reproduced HTTP200 for invalid filename, rejected original subfolder and missing-original cases. Valid masks and plain uploads remained successful. This establishes the mechanism, not that it caused the original 2023 report.

A separate local source proposal bb0ac286b0803d4d745c3e94a1b7f5b327b8edc0 returns the callback's non-None response before registration, and returns404 when the original file is missing. Independent review passed 3 unittest tests covering 5 cases, including preserved original RGB/uploaded alpha and zero registration on failure. Full PromptServer/dependency integration remains unrun; source is local and has not been submitted as a PR or deployed.

Open #13743 overlaps the mask callback's containment validation and should be coordinated; it does not change the helper's discarded return. #16771 concerns registration after saving. No live request, service, model, provider or user workflow was used for this evidence.

denio-machete avatar Oct 11 '26 03:10 denio-machete

I'm looking at this. In current master /upload/mask ignores the response the mask save callback returns for rejected original refs, so the request reports success without writing a file. I'll put up a small fix with a test.

vangel76 avatar Oct 17 '26 17:10 vangel76