Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Edit SEG_ELT" Node unable to deal with SEGS not found? #905

Open
gobshyte opened this issue Feb 9, 2025 · 5 comments
Open

"Edit SEG_ELT" Node unable to deal with SEGS not found? #905

gobshyte opened this issue Feb 9, 2025 · 5 comments

Comments

@gobshyte
Copy link

gobshyte commented Feb 9, 2025

Unless I'm missing something, it seems there is no way to use the "Edit SEG_ELT" in a workflow where segs are not found?

If I decompose empty segs then assemble, there is no issue.

Image

But if I put "from SEG_ELT" into "edit SEG_ELT" (in cases where no SEGS were found) we get

'NoneType' object has no attribute 'cropped_image'

ComfyUI\custom_nodes\ComfyUI-Impact-Pack\modules\impact\segs_nodes.py", line 953, in doit
cropped_image = seg_elt.cropped_image if cropped_image_opt is None else cropped_image_opt
^^^^^^^^^^^^^^^^^^^^^

Image

This seems to make it impossible to use the "SEG's isn't empty" node when using "Edit SEG_ELT" ?

@ltdrdata
Copy link
Owner

ltdrdata commented Feb 9, 2025

Why don't use apply SEG's isn't empty before Decompose (SEGS)?

@gobshyte
Copy link
Author

I have tried with the SEG's isn't empty node in many places, here are some examples:

Same error on the Edit SEG_ELT node ('NoneType' object has no attribute 'cropped_image')
Image

Same error on the Edit SEG_ELT node ('NoneType' object has no attribute 'cropped_image')
Image

This one almost seems to be getting there, as it stops complaining about each node as I connect them, however, the crop_region_opt input is a custom class with no primitive so I got a bit stumped.
The error at this point is ('tuple' object has no attribute 'crop_region')
Image

@gobshyte
Copy link
Author

OK, so I now have a functional workflow that can edit the SEGS and still handle missing SEGS, but it is dependent on a change in the segs_nodes.py

The worflow looks like this:

Image

But it requires this exception to handle a 'none' input into the Edit SEG_ELT node:

Image

I did look at possibly returning an empty SEG_ELT class or something, so the Assemble (SEGS) would essentially return the same thing as EmptySEGS, but I couldn't figure out how to do that, sorry!

@ltdrdata
Copy link
Owner

Actually you should not approach that way.

Image

@gobshyte
Copy link
Author

That does not seem to work? I get no output and SEGS test boolean after the switches seems to be "DisplayText"?

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants