Nodes/ComfyUI-BrainDead/BD Save Context
ComfyUI Node

BD Save Context

Define a save-path template + variables ONCE, downstream BD_SaveImageWithContext and BD_SaveMaskWithContext nodes look it up by context_id. Each save node only needs to specify its `suffix` (e.g. '_albedo', '_head', '_skin_mask'). Add new save points anytime by wiring the same context_id — no concat-string spaghetti.

By BizaNator·Created 7 months ago·Updated 16 days ago· 14
BD Save Context
    • context_id
    • status
    context_iddefault
    template%project%/%character%/%subfolder%/%character%_%name%_v%version%%suffix%
    character
    name
    version01
    project
    base_dir
    subfolder
    tag
    custom_vars
    auto_incrementtrue
    increment_padding3
    strictfalse
    Category🧠BrainDead/Cache

    Inputs (13)

    NameTypeDefaultDescription
    context_idSTRINGdefaultIdentifier for this save context. Save nodes match by this id. Use distinct ids if you have multiple parallel contexts (e.g. 'character_v1' and 'mannequin_v1').
    templateSTRING%project%/%character%/%subfolder%/%character%_%name%_v%version%%suffix%Base template with %varname% placeholders. The save node's `suffix` input is appended to this template before resolution. Use %suffix% in the template to control suffix placement (defaults to end if omitted). Empty %vars% are cleaned up — `//` collapses to `/`.
    characteroptSTRING
    nameoptSTRING
    versionoptSTRING01
    projectoptSTRING
    base_diroptSTRINGRoot directory for saves. Empty = ComfyUI output dir (default, backward-compatible). Otherwise an absolute path the template resolves under — works cross-platform, e.g. 'D:/MyImages' or '/mnt/data/assets'. You can also use a short alias defined via the BD_SAVE_ALIASES env var. Optional lockdown via BD_SAVE_ALLOWED_ROOTS.
    subfolderoptSTRINGSub-organization within the output folder — e.g. a category or stage name. Empty cleans up to nothing in the path.
    tagoptSTRINGGeneric tag — typical use: part name like 'face', 'topwear', 'arm-l'.
    custom_varsoptSTRINGAdditional variables, one per line as key=value. e.g. resolution=4096, layer=topwear.
    auto_incrementoptBOOLEANtrueAppend _NNN to avoid overwriting. Applies to ALL save nodes using this context.
    increment_paddingoptINT30–10
    strictoptBOOLEANfalseIf True, save nodes raise an error when the template contains undefined %variables% at save time.

    Outputs (2)

    NameTypeDescription
    context_idSTRING
    statusSTRING