ComfyUI-Sn0w-Scripts

ComfyUI-Sn0w-Scripts
★ 16

扩展节点Lora管理提示工程Booru标签
为ComfyUI提供一组实用扩展节点,简化流程与lora管理,侧重booru标签的提示处理与兼容性,提高制作效率。
💡 在ComfyUI中管理lora并用booru标签构建与优化提示。
🍴 3 Forks💻 Python🔄 2026-03-06
📦
网盘下载
复制链接后前往夸克网盘下载
https://pan.quark.cn/s/f414772aa5c3
📦 requirements.txt
onnxruntime
Custom Lora Loader
Favourite Showcase
Textbox
Textbox
Textbox
Sigmoid Comparison
Sigmoid Comparison
Sigmoid Comparison
Sigmoid Graph
Simple Sampler
Lora Tester
Load Lora
Load Lora Folder
Lora Selector
Lora Stacker
Character Selector
Prompt Combine
Get Font Size
Textbox
Upscaler
Filter Tags
Lora Tester
T2I
📄 README

sn0w-scripts

This extension contains a collection of nodes and improvements created for lora management and general quality of life.

[!IMPORTANT]

All highlighting/ favourite handling has been moved to ComfyUI-Syntax-Highlighting

Get Started

Install

  • Install ComfyUi.
  • Clone this repo into custom_nodes:
  • “`

    git clone https://github.com/sn0w12/ComfyUI-Sn0w-Scripts

    “`

  • Start up ComfyUI.
  • Alternatively install through ComfyUI-Manager.

    Configuration

    In the ComfyUI settings, you can modify various settings. Some changes will apply immediately, while others require a refresh to take effect.

    Settings

    | Setting | Options | Definition |

    | ————————————– | ———————————- | —————————————————————————————- |

    | Animagine Prompt Style | True / False | Places “1girl/1boy” at the beginning of your prompts in the “Prompt Combine” node. |

    | Custom Lora Loaders SD… | Textbox | Allows creation of new LoRa loaders by specifying their name and path. |

    | Disable Default Characters | True / False | Disables the loading of the default characters in the “Character Selector” node. |

    | Logging Level | Warnings
    Informational
    Debug | Sets the severity level of logs that will be printed. |

    | Max Difference in Lora Loading | 0 – 100 | Specifies the maximum allowable difference between a tag and a LoRa for it to be loaded. |

    | Random Characters from Favourites Only | True / False | Ensures random characters are selected only from your favorited characters. |

    | Remove Lora Path | True / False | Removes the path information from loras and only keeps the name. |

    | Sort Characters By | Alphabetically
    Series | Sorts characters either alphabetically or by their series. |

    | Sort Loras By | Alphabetically
    Last Changed | Sorts loras either alphabetically or by latest changed. |

    [!IMPORTANT]

    The custom lora loaders require these paths to be in your extra_model_paths.yaml (with your real directories of course). You only need to add the ones you are actively using.

    loras:
        base_path: D:/Ai/Lora/loras
    
        loras_15: /1.5 # SD1.5
        loras_xl: /XL # SDXL
        loras_3: /3 # SD3

    Major Features

    Lora Management

    A major focus for me was making loras more manageable by letting users create their own lora loaders with specific folder paths and automatically loading loras based on tags. This makes browsing through your Loras much easier, though it may limit which Loras you can use depending on your configuration. You can configure custom Lora loaders in the ComfyUI settings with the following format:

    ExampleName1:Value1

    To create a Lora stack, add a number to the end:

    Styles XL:style:2

    Favourite Loras & Characters

    The custom Lora loaders and the character selector feature allow you to mark Loras and characters as favorites, placing them at the top of the loaders for easy access. Favorite Loras are accessible across all your custom Lora loaders and the standard Lora loader, although the standard loader does not sort them correctly.

    Sort Loras

    There are options to sort your loras either alphabetically or by the latest changed file. You can also remove the path information to keep the loader clean. Do note that if you remove the path information and have two loras with the same filename in different paths it will not be able to differentiate them.

    Text Highlighting

    Text in the copy/paste textbox will be highlighted when the text is in parentheses. You can change the colors of the highlighting by changing the [Sn0w] Custom Textbox Colors setting, there should be one either rgb rgb(0, 0, 0) or hex #000000 color per line. You can choose to either do the highlighting by the strength of the text or the nested level it is in.

    | Nesting | Strength |

    | :—————————————-: | :————————————-: |

    | | |

    If you have unclosed parentheses it will be highlighted in red.

    Custom Schedulers

    You can write your own custom scheduler in src/custom_schedulers and they will be added as a custom node, just make sure to follow the example in get_sigmas_sigmoid.py

    Sigmoid Scheduler

    A custom scheduler that generally produces similar quality results as most other schedulers in my testing. However it works very poorly at low steps which may be an issue for some. Mostly written as an example for custom schedulers.

    Sigmoid vs Align your steps

    Comparisons

    Images generated at 20 steps, 8 cfg, 1152 x 896, no upscaling.
    Sigmoid settings at 20 sigma max, 0 sigma min, 3.5 steepness and 0.8 midpoint ratio.

    “`

    (score_9, score_8_up, score_7_up, score_6_up, source_anime, BREAK:1.1), 1girl, lips, long hair, grey eyes, black coat, medium breasts, cowboy shot, black robe, gold jewelry, looking at viewer, simple background, solo, white background, closed mouth, arms behind back, (red hair, dress, long dress, robe, white dress, gold trim:1.1)

    “`

    “`

    (power \(chainsaw man\), chainsaw man:1.1), blonde hair, cross-shaped pupils, demon girl, demon horns, double-parted bangs, hair between eyes, long hair, red horns, symbol-shaped pupils, yellow eyes, 1girl, black necktie, black pants, collared shirt, double v, looking at viewer, necktie, orange eyes, pants, parted lips, red background, red jacket, sharp teeth, shirt partially tucked in, shirt tucked in, simple background, sleeves past wrists, smile, solo, teeth, v, white shirt, (score_9, score_8_up, score_7_up, score_6_up, source_anime, BREAK:1.1)

    “`

    “`

    (score_9, score_8_up, score_7_up, score_6_up, source_anime, BREAK:1.1), (makima \(chainsaw man\), chainsaw man:1.1), hair between eyes, long hair, medium breasts, red hair, ringed eyes, yellow eyes, 1836547, 1girl, @ \(symbol\), black necktie, braided ponytail, business suit, collared shirt, formal, light smile, looking at viewer, necktie, office lady, sidelocks, simple background, smile, solo, suit, white shirt

    “`

    “`

    (score_9, score_8_up, score_7_up, score_6_up, source_anime, BREAK:1.1), (makima \(chainsaw man\), chainsaw man:1.1), hair between eyes, long hair, medium breasts, red hair, ringed eyes, yellow eyes, 1girl, black jacket, black necktie, black pants, black vest, closed eyes, collared shirt, formal, necktie, pants, shirt tucked in, simple background, sitting, solo, suit jacket, vest, white background, white shirt

    “`

    Sigmoid graph

    Nodes

    Image Processing

    Nodes that are specifically for generating and processing images.

    Sn0w KSampler

    Ksampler with more settings and optional inputs. Support for custom schedulers

    ℹ️ See More Information

    – Can take both text and conditioning as positive and negative input.

    – Can take a latent image or can generate one if none is provided.

    – Supports schedulers such as align your steps, you can also create your own scheduler in src/custom_schedulers/, make sure to follow the example provided in get_sigmas_sigmoid.py.

    – You can also just get the sigmas from any of the scheduler nodes and drag them into sigmas (optional), if you do the scheduler widget will not be used.

    Lora Tester

    Automatically generates X amount of images with provided loras.

    ℹ️ See More Information

    – I recommend making lora_info and add_default_generation inputs and using the outputs from the Lora Selector.

    – Takes normal KSampler input but takes positive and negative inputs as text.

    – Outputs a batch of images.

    Lora Management

    Nodes that handle lora selection, stacking, and loading.

    Load Lora Sn0w

    Normal load lora but can put favourite loras at the top of the list.

    ℹ️ See More Information

    Load Lora Folder

    Dynamically applies Lora models based on similarity to a provided prompt.

    ℹ️ See More Information

    – This node processes a given prompt to identify and apply the most similar Lora models of the tags found in the prompt.

    – For each part of the prompt, the node calculates a distance between tags and available Lora model filenames. The max distance can be chosen in the settings.

    Example folder input: *master_folder, subfolder1:3, -excludefolder, subfolder2

    *master_folder specifies all paths must include master_folder.

    subfolder1:3 indicates up to 3 models from subfolder1 can be loaded.

    -excludefolder ensures any path containing excludefolder is ignored.

    subfolder2 loads models from this subfolder without a numeric limit.

    – Note: You need the loras separated into XL and 1.5 as stated in the Important Note.

    – Note: Loras need to be named very similarly to the tag, with at most 5 characters different. Words in the lora filename can be separated by spaces or underscores.

    Lora Selector

    Automatically selects X amount of loras between two numbers.

    ℹ️ See More Information

    – Loras have to be formatted like the default kohya_ss outputs. (lora_name-000001)

    – Select the first lora.

    – Select the number of the highest lora you want to test.

    – Select the amount of loras you want to test.

    – Outputs list of loras like this: \

    – Add default generation adds an extra “nothing” at the end of the list, used in Lora Tester to generate an image without the lora.

    Lora Stacker

    Outputs a list of loras for Lora Tester. Does not load any loras by itself.

    ℹ️ See More Information

    – Basically Lora Selector but manual.

    – Specifically for the lora testers.

    Character and Text Processing

    Nodes for selecting and combining character and textual elements.

    Character Selector

    Outputs a character name and prompt.

    ℹ️ See More Information

    – Loads characters.json and outputs prompt based on it.

    – You can create a file named custom_characters.json and add characters there if you want, they will be loaded with all the other characters if you format it like the characters.json file.

    – If custom_characters.json has a character with the same name as characters.json it will add the custom prompt at the end of the normal one, this can be useful if you have loras that need activation tags.

    Prompt Combine

    Combines multiple strings with a specified separator and optionally simplifies the result by removing redundant or incompatible tags.

    ℹ️ See More Information

    – If simplify is enabled, the simplification process identifies and removes redundant tags (e.g., when a tag is fully encompassed by another, more descriptive tag) and tags incompatible with factors such as facing away, covered eyes, etc. Any tags that are in parentheses will not be removed.

    Utility Nodes

    Nodes that provide utility functions across the system.

    Get Font Size Node

    Estimates the optimal font size for text to fit within an image based on Lora information.

    ℹ️ See More Information

    – This node takes an image and a string, estimating the best font size to ensure that the longest piece of the string fits within the image. The approach considers the image’s width and the length of the text to find a size that balances visibility and fit.

    Copy/Paste Textbox

    A multiline textbox with copy, paste and highlighting functionality.

    ℹ️ See More Information

    Upscale Image With Model By

    Upscales an image by a certain amount with an upscale model.

    ℹ️ See More Information

    Filter Tags

    Filters a string to only returns tags that have to do with a chosen category. // WIP

    ℹ️ See More Information

    Example Workflows

    Lora Tester

    Note: Uses ImagesGrid for making the actual grid from the image output.

    T2I

    My general text to image workflow, note that it uses several nodes from different custom nodes.

    Known Issues

  • Embedding highlighting does not work on linux.