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

node to create wildcard label prompt from string list #536

Merged

Conversation

jkrauss82
Copy link
Contributor

The idea behind this node is to automatically create a wildcard prompt for the SEGS detailer. The purpose is to have a single prompt per tile/SEG which guides a denoising process for upscaling an image (in addition to the regular upscale prompt).

This strategy should help to either increase the denoising strength for added details or protect against hallucinations at the same denoise level.

The WD14 tagger of pythongosssss works nicely for assigning tags on the fly for each tile. It is required to use that or something else to create the string list for the node input.

A prototype workflow is attached to this PR.

prompt-per-tile-sample.json

def doit(self, string_list, prefix_all, postfix_all, restrict_to_tags, exclude_tags):
# need to access as list due to INPUT_IS_LIST
# some sanity checks and normalization for later processing
if prefix_all[0] == None: prefix_all[0] = ""
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Python, when checking if something is None, you should use is None.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved by 43e1bbb

},
}

INPUT_IS_LIST = True
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The behavior seems unclear because string_list is received as a list while the others are not being considered as lists.

It might be better to add a node such as StringListToString instead of directly receiving string_list in this node, and receive input as a concatenated string.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review was pending due to my mistake.

Copy link
Contributor Author

@jkrauss82 jkrauss82 May 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense.

I have added this node here: e41788a (used WAS node suite WAS_Text_List_to_Text as template).

A new workflow making use of the added node is attached.

prompt-per-tile-sample.json

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's awesome

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's awesome

thanks!

I have finally found the time to write up a short tutorial in the impact examples on how I imagine this node to be used, check it out here

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

Successfully merging this pull request may close these issues.

3 participants