chflame163 / ComfyUI_LayerStyle

A set of nodes for ComfyUI that can composite layer and mask to achieve Photoshop like functionality.
MIT License
682 stars 33 forks source link

Ignored Mask-SegmentanythingUltraV2 node #148

Closed StableQuestion closed 11 hours ago

StableQuestion commented 3 days ago

Hello everyone, Why is the mask ignored in the second segmentanythingUltraV2 node?

I will explain the steps in stages so that comments can easily refer to each step. 1)SegementAnythingUltraV2 cuts out the object of my choice 2)I open Mask Editor in preview Bridge node 3)Delete the existing mask (The mask that is displayed in this step does not correspond to the mask that comes from the mask(output) of the first SegementAnythingUltraV2 node) 4)Draw a new mask manually 5)CutbyMask cuts out the unwanted image elements 6)Pass the cut image to the second SegementAnythingUltraV2 node 7)Wondering why the pixels that were actually cut out are back in the image

Overview: SegmentAnythingUltra V2 +Cut by Mask

Mask output from the first SegmentAnythingUltra V2: Mask output from Segment anything V2

Mask which I see in the mask editor of the preview bridge: Screenshot of the Picture in open in Mask editor after first segment anything node

chflame163 commented 3 days ago

The output of the preview bridge node still does not contain masks. To include masks, the following can be done: 微信图片_20240705093958

StableQuestion commented 2 days ago

Hello chflame163,

I build the flow as you suggested. I think there are two options. 1)I missunderstand what cut by mask means, the way I understand it is that image B dont have the pixels anymore because I cut them out of the image A. 2)The SegmentAnythingUltra V2 node somehow ignores the cut because image C still have the pixels from A. new flow

StableQuestion commented 2 days ago

Hello chflame163,

I think I understand the cut by mask node better now and the problem is not in the segmentanythingultraV2 node.

Cutbymask crops the image depending on the outermost borders of the white mask area see pictures. My expectation was that the image coming out of the Node: Cutbymask would match the crop but the node only looks at the outer boundaries of the white mask area and crops it accordingly.

Thanks for your help your node was innocent No additional Mask

additional Mask which affects the borders of the white mask