A set of custom nodes that pause the flow to allow you to pick images, edit parameters, set masks etc..
If you are reporting a bug, please read how to report a bug well first!
A set of nodes designed to pause execution of the workflow to allow you to make selections and/or edits before continuing. There's an example workflow that illustrates all of them at the end.
There are also some helper nodes.
If you prefer trying a workflow to reading docs, use of the nodes is illustrated in this seahorse (drag the image into Comfy):
<img src="https://github.com/chrisgoringe/cg-image-filter/raw/main/images/seahorse.png" alt="Seahorse" width="200" height="200">Image Filter
Mask Image Filter
Split String by Commas
Pick from List
to allow you to select matching items from any listBatch from Image List
and Image List from Batch
to work with image batchesAutosendIdentical
In the ImageFilter node, if all images are identical (including if there is just one image) then send
an image without user interaction.ClickSends
In the ImageFilter node, clicking an image sends it instead of selecting it. Useful if you know you only ever want to send one image at most.PlaySound
Play a 'ding' sound when any of the filter nodes becomes active.SmallWindow
Instead of taking over the whole screen immediately, display a tiny version of the image in the top left. Click that image to go into the full screen mode.The image filter node pauses execution of the workflow while you choose which, if any, of the images produced, you want to progress.
Insert it like this:
When you run the workflow, and get to this point, a popup window will appear displaying the image(s) for you to select which, if any, you want to progress:
Click the images that you want to keep (their border will turn green) and then click 'Send' (or press 's') to continue the workflow. If you don't want to keep any of the images, click 'Cancel' (or press 'x') to terminate the workflow.
The node also has a timeout specified, and a countdown is shown on the left hand side. If you don't Send or Cancel before the timeout, the node will either cancel or send all the images, depending on the option you have selected.
Here's a simple use: generate a batch of images and pick which ones you want to save:
The Latent and Mask inputs are optional. If used, they should have the same number of latents (or masks) as the image batch, and the latents (or masks) corresponding to the selected images will be output. Use this if (for instance) you want to select from a batch of images, but the next stage uses the latent - that way you avoid the decode-recode loss, or if you want to pick a mask (perhaps from options automatically generated)
Other things (like prompts, segs etc.) that have been used can be selected using the Pick from List
helper node.
Sometimes you know which images you are going to want. If you provide a comma separated list of integers in pick_list
,
these images will be selected without user input. Values will be taken modulo the number of images (which means you can use -1
for the last image).
You could also use this to make a larger batch of images (repeat a value and the image will appear repeated times in the output).
Note that this uses zero indexing (the first image is '0').
Designed for a single image, when executed the Mask Image Filter node will automatically launch the mask editor.
When you finish mask editing the image and mask will be output. Here's a simple use - generate an image, and then mask the bit you don't like, before doing an img2img step.
Again, there is a timeout, and if you don't save a mask before the end of the timeout (or if you press the cancel button in the mask editor), it will either cancel, or send a blank mask, depending on the option chosen.
There is an optional mask input (added in 1.3), which allows you to specify the mask when the editor is launched:
Note that the Mask Image Filter works with the new Mask Editor; it does not work with the old one
Also designed for a single image, this node will show the image and a string of text; you can edit the text and then press send.
The image and (edited) text are output. The intended use is for captioning workflows; you can read and edit each caption as it is generated. Here's a trivial workflow:
'Text Image Filter' and 'Image Filter', each provide three extra text fields, intended for short form - like specifying the denoising you want on the next step, or a prefix to save the file with.
If you use the optional 'tip' input, the contents will be displayed under the extras input fields, so you can remind yourself what they are for!
Split String by Commas
allows you to split a text string into up to five pieces, splitting on ,
, |
, or ^
. It also strips whitespace, so that the strings can be easily parsed, especially by...String to Int
and String to Float
convert a string to an int or a float, with a fallback defaultTogether, these nodes allow you to specify lots of information in the extras
fields. For instance, if doing an inpaint, you might have an extras field that takes the format 0.4, 20
meaning 'denoise 0.4, 20 steps'. Split the string, feed the pieces into the converters, and feed that into other nodes. Like this:
Split String by Commas
produces five string outputs. If there are fewer than five terms, the extra ones will havee an empty string; if there are more than five terms the fifth output will be a comma separated list of the fifth and subsequent terms.
There is also a sixth output which is a list of all the strings.
The Image Filter
node outputs a string, indexes
, which is a comma separated list of the indexes (0 based) of the images selected. Connect this to a Pick from List
node, and connect a list of anything to the anything
input, and the Pick from List
node will output a list corresponding to the selected images.
For instance, if you create a set of images using a list of prompts, this can be used to select the prompts that correspond to the selected images. But you might well want to batch the images if you did use lists - see below.
So something like this:
If you are using lists, each node will run once for each list. This means that normally you will want a single batch of images for the Image Filter
(so if you generate a load of images using lists of, for instance, prompts, you will want to combine them with the helper node Batch from Image List
)
If you generate a batch of images and want to use the Mask Image Filter
or Text Image Filter
, which only show a single image, you will want to do the opposite - convert the batch to a list with Image List From Batch
. Then the images will be shown sequentially.
This workflow:
The workflow is embedded in the seahorse in a bottle:
<img src="https://github.com/chrisgoringe/cg-image-filter/raw/main/images/seahorse.png" alt="Seahorse" width="200" height="200">Take a look at the issues list to see what I'm thinking of, to report problems, or to make suggestions.
Please read this guide before you post a bug!