dnl13 / ComfyUI-dnl13-seg

I'm working on enabling SAM-HQ and Dino for ComfyUI to easily generate masks automatically, either through automation or prompts.
18 stars 3 forks source link

[FEATURE REQUEST] - Masks/SEGS Drop Shadow #9

Open alessandroperilli opened 11 months ago

alessandroperilli commented 11 months ago

Admittedly, this is a long shot, very low priority, and possibly out of scope for this node suite. But I'll try anyway.

One of the use cases I'm using this custom node suite for is to automate the creation of a collage. I ask GroundingDINO to identify a few elements in a source image, then I pass the masks through a ControlNet + Detailer pipeline and, finally, I recombine all the SEGS into the original image.

You can see the pipeline in the Object Swapper function of my AP Workflow 6.1 if that helps.

To improve the collage effect, it would be super cool if each mask or, in the future, segs would come out with a drop shadow in a certain direction. To achieve that, today, I have to pass each segs through another long pipeline that creates a blurred border, but it's far from ideal. A blurred border is not a drop shadow, and it's a very convoluted process.

Probably, it's too specific for Mask with prompt node, but something cool to consider.

dnl13 commented 11 months ago

A very interesting idea and a fascinating use case.

I'll jot down some notes. One possibility could be to create an additional node that takes an RGBA image as input and produces a shadow.

This node could have additional parameters such as:

The node could also directly take a second image as input, serving as a background. Optionally, it could output either a direct RGB image with a background or, if no background is provided, again an RGBA image including the shadow.

alessandroperilli commented 11 months ago

An independent node would be great, so that I could use it to receive the SEGS coming out of the Detailer node. I just didn't think such node would fit the scope of this suite.

The number of options you suggest is more than I hoped for. All very welcome.

The image background option is nice for all-in-one solutions. Today I do that with a SEGSPaste node or a Paste by Mask node, depending on the input I have to work with.

dnl13 commented 11 months ago

If I manage to resolve the Mac issues with the SwinB model, I wouldn't mind developing some nodes here. These could be optionally enabled through configuration, and I'd also be open to passing the nodes to relevant Node-Suites where they might fit better. I'm just thinking out loud.