[English][ζ₯ζ¬θͺ][ηΉδ½δΈζ]
D2 Nodes ComfyUI is a collection of custom nodes that make ComfyUI slightly more convenient.
It's suitable for those who want to create simple workflows.
I have consolidated the following custom nodes that I previously created, and added nodes such as D2 KSampler.
If you have already installed the following custom nodes, please delete them as the node names will conflict.
- A button to generate a specified number of images (Batch count)
- Can be moved by dragging the left edge of the palette
Details
- To hide it, configure in the "D2" category of the ComfyUI settings screen
- The number of images can also be specified from the settings screen
- Separate the numbers with commas (,)
- Searches input text with regular expressions and outputs matching text
- Can also perform string concatenation
Details
- The main purpose is to switch quality tags for each Checkpoint
- When a matching string is found in the input
text
, it outputs the target string and which match it was (starting from 0) - In the image above, it received
ioliPonyMixV4.safetensors
, matched the search conditionpony
, soscore_9
is output - Since it matched the first search condition,
index
outputs0
- If it doesn't match any conditions,
-1
is output - Can also concatenate strings at the front and back
text
- Target string for searching
prefix
- String to concatenate at the front
suffix
- String to concatenate at the back
regex_and_output
- List of search strings and output strings
- Enter in the following format:
pre_delim
- The character inserted between
prefix
andregex_and_output
when connecting them Comma
:,
/Line break
: newline /None
: no character inserted
- The character inserted between
suf_delim
- The character inserted between
suffix
andregex_and_output
when connecting them
- The character inserted between
Search string 1 (regex can be used)
--
Output string 1
--
Search string 2 (regex can be used)
--
Output string 2
--
--
String to output when nothing matches
combined_text
- String combining
prefix
+ output string +suffix
- String combining
prefix
/suffix
- Pass-through from Input
In this example, the matched number (index
) is passed to the Text Index Switch of Easy Use for switching.
Since it becomes -1
when there's no match, we use the regular expression .+
that matches all strings as a default output.
- A node that searches and replaces input text and returns it as a list
- A custom node for using Prompt S/R with XY Plot
- Compatible with qq-nodes-comfyui
Details
prompt
- Prompt. Can include line breaks
search_txt
- Text to search for. Can include multiple words
- Cannot use line breaks
replace
- Text for replacement
- Since it's separated by line breaks, it's OK if it contains ","
- LIST
- Outputs replaced text in list format
- A node that outputs general parameters like seed and cfg in list format
Details
type
FLOAT
: Floating point number. For CFG, etc.INT
: Integer. For steps, etc.STRING
: String. For sampler, etc.SEED
: Can input seed value with random number generation button
Add Random
- Adds random numbers to the input field
- Only displayed when
type
isSEED
- A Checkpoint Loader that outputs the full path of the model file
Details
model
/clip
/vae
- Same as the conventional CheckpointLoader.
ckpt_name
/ckpt_hash
/ckpt_fullpath
- Checkpoint name, hash, full path.
The implementation mostly uses code from mikey_nodes.
- A KSampler that can input prompts as STRING
Details
model
/clip
/vae
/ ..etc- Same as standard KSampler
negative
/positive
- Prompts in STRING format
IMAGE
- Image output
positive
/negative
- Pass-through from Input
- Load Image node that can extract prompts from images
- Compatible with images created by StableDiffusion webui A1111 and NovelAI
- A button to open the mask editor has been added
Details
IMAGE / MASK
- Image and mask
width / height
- Image size
positive
/negative
- Prompts
Note: Depending on the workflow configuration, it may not always be possible to retrieve prompts. For example, prompts cannot be retrieved without a node containing the word "KSampler" (e.g., Tiled KSampler).
- A node that allows selecting image size from presets
Details
This is an example of obtaining the size from an image, enlarging it by 1.255 times, and then rounding the result.images
- Used to obtain size from images
- Requires setting
preset
tocustom
preset
- Size presets
- Must be set to
custom
when usingwidth
,height
, orimages
size - To change presets, edit
/custom_nodes/D2-nodes-ComfyUI/config/sizeselector_config.yaml
width
/height
- Vertical and horizontal dimensions
- Requires setting
preset
tocustom
swap_dimensions
- Swaps width and height
upscale_factor
- Value passed to other resize-related nodes
prescale_factor
- Multiplier for resizing width / height
round_method
Round
: Rounds to the nearest integerFloor
: Rounds down
batch_size
- Batch size to set for empty_latent
width / height
- Multiplies input
width
andheight
byprescale_factor
- Multiplies input
upscale_factor
/prescale_factor
- Passes through what was Input
empty_latent
- Outputs latent created with specified size and batch size
batch_size
- Passes through what was Input
- A node that outputs steps for Refiner
Details
steps
- Total number of steps
start
- Steps where the first KSampler starts
end
- Steps where the first KSampler ends
steps
/start
/end
- Pass-through from Input
refiner_start
- Steps where the second KSampler starts
- A node that can also specify denoise for Refiner in img2img
Details
steps
- Total number of steps
denoise
- Specifies denoise for img2img
switch_at
- At what percentage of total steps to switch to the next KSampler
steps
/- Pass-through from Input
start
- Starting steps for the first KSampler
end
- Ending steps for the first KSampler
refiner_start
- Steps where the second KSampler starts
- A node for checking steps
You can recreate the workflow by dropping the image into ComfyUI.
SDXL XY Plot
Switching quality tags based on Checkpoint's full path name
Switching Checkpoint midway with Refiner
ComfyUI Manager β Custom Node Manager β Search for D2 Nodes
and install
In the custom_nodes folder, git clone
> git clone https://github.com/da2el-ai/D2-nodes-ComfyUI.git
2024.10.19
- Added D2 Queue Button
2024.10.18
- D2 Size Selector: Added feature to obtain size from images
- D2 Size Selector: Made it possible to choose between "rounding" and "flooring" for resizing methods
2024.10.14
- D2 Load Image: Fixed an error that occurred when loading images without Exif data (such as those pasted from clipboard)
2024.10.11
- D2 Regex Switcher: Added the ability to specify the character to be inserted when concatenating strings
2024.10.10
- D2 Load Image: An "Open Mask Editor" button has been added.
2024.10.08
- D2 Load Image: Newly added
2024.10.03
- D2 Regex Switcher: Fixed a bug where matches were being overlooked during search
2024.10.02
- Created by integrating existing nodes