Nodes/ComfyUI-CraftKit/Smart Profile Switch 🧩
ComfyUI Node

Smart Profile Switch 🧩

Switch aspect ratio and filename label per prompt category, in one node

By CraftopiaStudioΒ·Created 6 months agoΒ·Updated about 22 hours agoΒ· 2
Smart Profile Switch 🧩
    • label
    • width
    • height
    β—„index1β–Ί
    β—„label_1Headshotsβ–Ί
    β—„width_11024β–Ί
    β—„height_11024β–Ί
    β—„label_2Halfbodyβ–Ί
    β—„width_2832β–Ί
    β—„height_21216β–Ί
    β—„label_3Fullbodyβ–Ί
    β—„width_3768β–Ί
    β—„height_31344β–Ί
    β—„label_4Tallβ–Ί
    β—„width_4640β–Ί
    β—„height_41536β–Ί

    The old way to rotate aspect ratios per prompt category went something like: a CR Aspect Ratio node, four Primitive nodes holding width/height, a switch, and enough wires to make the graph look like a plate of spaghetti. Smart Profile Switch replaces that whole chain with one node. Give it an index from 1–4 and it outputs a label, a width, and a height for that slot - three values that always travel together, which is exactly the unit of work a category-based batch workflow needs.

    It's from ComfyUI-CraftKit, and it's designed as the partner to the pack's Smart Prompt Controller: that node cycles prompts and hands you an active_list INT, this node turns that INT into the matching resolution and filename suffix. Prompt category 2 fires β†’ width 832, height 1216, label "Halfbody," all at once.

    How it works

    There's a slot per profile - label, width, height - and index picks which one you're in. Out-of-range indices get clamped to 1–4, so a stray value won't crash anything. Like its siblings it's an output node, meaning it always executes and renders a status label so you can see the active state without squinting at wires: Slot 2: Halfbody | 832 Γ— 1216.

    The defaults are sensible for its intended use case: Headshots at 1024Γ—1024, Halfbody at 832Γ—1216, Fullbody at 768Γ—1344, Tall at 640Γ—1536. Those are the four standard categories for a character LoRA dataset, sized appropriately for an SDXL-class model. Edit any of the twelve fields if your categories differ - they're just widgets.

    The inputs that matter

    • Index - the profile selector, 1–4. This is where you connect Smart Prompt Controller's active_list output.
    • Label 1–4 - the text suffix for each category. Use these as filename suffixes when saving.
    • Width / Height 1–4 - per-category dimensions.

    Outputs: label (STRING), width (INT), height (INT). Wire width/height into an EmptyLatentImage or EmptySD3LatentImage, and the label into a save node's filename.

    Installing it

    ComfyUI Manager: search for ComfyUI-CraftKit. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/CraftopiaStudio/ComfyUI-CraftKit
    

    Restart ComfyUI. It's under CraftKit in the menu, and like the rest of the pack it has zero extra dependencies - everything it needs ships with ComfyUI.

    Things to know

    • It only emits values; it doesn't size anything itself. Width and height are just INTs that you still have to feed into a latent-size node. That's the design - it's a coordinator, not a magician.
    • The label is a plain STRING. Whether it ends up in your filenames depends on the save node accepting a string input for the filename - most do, but check yours.
    • Index is required, so if you disconnect it, it just sits on its default of 1. The clamping means a miswired 5 silently becomes slot 4 rather than an error - the console prints a warning, so glance at it if the outputs look wrong.

    Honestly, you could build this with stock nodes. The value is that you don't have to, and that it keeps the label and the dimensions in lockstep so your saved filenames and your generated aspect ratios can never drift out of sync. For a batch dataset run, that's worth a lot.

    CategoryCraftKit

    Inputs (13)

    NameTypeDefaultDescription
    indexINT11–4Active profile (1–4). Connect to active_list from Smart Prompt Controller.
    label_1STRINGHeadshotsLabel for profile 1, used as filename suffix.
    width_1INT102464–8192β€”
    height_1INT102464–8192β€”
    label_2STRINGHalfbodyLabel for profile 2, used as filename suffix.
    width_2INT83264–8192β€”
    height_2INT121664–8192β€”
    label_3STRINGFullbodyLabel for profile 3, used as filename suffix.
    width_3INT76864–8192β€”
    height_3INT134464–8192β€”
    label_4STRINGTallLabel for profile 4, used as filename suffix.
    width_4INT64064–8192β€”
    height_4INT153664–8192β€”

    Outputs (3)

    NameTypeDescription
    labelSTRINGβ€”
    widthINTβ€”
    heightINTβ€”