Nodes/Krea2_ComfyUI_Advanced/Eric Krea2 Unload Models
ComfyUI Node

Eric Krea2 Unload Models

A ComfyUI node in Eric/Krea2 with 6 inputs and 1 output.

By EricRollei·Created about a month ago·Updated 10 days ago· 5
Eric Krea2 Unload Models
  • value
  • krea2_pipeline
  • value
also_clear_module_cachestrue
aggressive_teardowntrue
also_unload_comfy_modelstrue
verbosetrue
CategoryEric/Krea2

Inputs (6)

NameTypeDefaultDescription
value*Passthrough - wire anything here (e.g. the final IMAGE) so this node sits downstream in the graph and runs as part of the queue.
krea2_pipelineoptKREA2_PIPELINEThe pipeline to free. Connect the Component Loader or plain Loader's krea2_pipeline output here.
also_clear_module_cachesoptBOOLEANtrueAlso clear the loader nodes' module-level caches (_COMP_CACHE / _PIPELINE_CACHE), not just this input. Leave ON unless you specifically want to free only the connected pipeline and keep another cached one alive.
aggressive_teardownoptBOOLEANtrueExplicitly break the pipe's internal references to its submodules (transformer/vae/text_encoder) before dropping the pipe itself, instead of relying on the top-level pipe object's refcount hitting zero on its own. Use this when 'keep in vram'=True on the loader and VRAM isn't dropping after unload - something (accelerate hooks, cached attention workspace, an offload dispatch table) may be holding a submodule reference independent of the pipe wrapper.
also_unload_comfy_modelsoptBOOLEANtrueAlso unload models ComfyUI's own model_management is tracking (SAM / GroundingDINO / DepthPro and anything else loaded through regular comfy nodes), then soft-empty comfy's cache. NOTE: nodes that cache in their own globals (e.g. SegmentAnything Ultra with cache_model=True) are invisible to this - turn their own cache toggle off as well.
verboseoptBOOLEANtruePrint refcount + CUDA memory before/after, to diagnose cases where VRAM still doesn't drop (tells us whether something else is holding a reference, vs. it being driver/kernel-level memory that only frees on process exit).

Outputs (1)

NameTypeDescription
value*