ComfyUI Node

CSGO_Loader

Five models in, one pipeline that isn't ComfyUI's

By smthemex·Created 2 years ago·Updated 2 years ago· 16
CSGO_Loader
    • csgo
    base_cpkt
    clip_vision
    vae_id
    controlnet
    csgo_ckpt
    num_content_tokens4
    num_style_tokens32

    First, the naming: CSGO here is not the video game. It's InstantX's Content-Style Composition model (arXiv 2408.16766), and that acronym collision means you'll be wading through Counter-Strike threads if you try to search your way out of trouble. The model's whole pitch is that a diffusion pipeline can hold "what's in the frame" and "how it looks" as two separate streams instead of mashing them together, so you can do "this subject/composition, but in that art style" in one shot. This loader is the half of the pack that builds that pipeline. The CSGO_Sampler node is the half that actually runs it.

    What it actually does

    CSGO_Loader constructs a full diffusers SDXL pipeline in-process from your ComfyUI checkpoint (from_single_file), clones the UNet into a ControlNet and loads TTPLanet's SDXL tile weights into it, loads the h94 IP-Adapter SDXL image encoder from your clip_vision folder, then wraps the whole thing in InstantX's CSGO adapter. That adapter is literally the IP-Adapter codebase with one change: instead of a single global image embedding, it injects separate content tokens and style tokens through decoupled cross-attention. Content targets the down blocks, style targets the up blocks, and the tile ControlNet carries a style stream through its own down blocks. That block-level separation is the whole trick - it's why this does something a plain IP-Adapter weight can't.

    The big thing to internalize: the csgo output is not a ComfyUI model. You can't feed it to a normal KSampler. It's a custom object that only CSGO_Sampler knows how to drive.

    The inputs that matter

    There are five dropdowns and they all read from ComfyUI model folders. Four of them are effectively required, despite the "none" options:

    • base_cpkt - any SDXL checkpoint. (Yes, it's spelled "cpkt" - the author's typo, harmless.)
    • clip_vision - the IP-Adapter SDXL image encoder, i.e. model.safetensors from h94/IP-Adapter/sdxl_models, dropped in ComfyUI/models/clip_vision.
    • controlnet - TTPLANET_Controlnet_Tile_realistic_v2_fp16.safetensors in ComfyUI/models/controlnet.
    • csgo_ckpt - InstantX's weights in ComfyUI/models/checkpoints: acsgo.bin or acsgo_4_32.bin.
    • vae_id - genuinely optional. Leave it at "none" unless you're getting black images (below).

    Then the two knobs that change your results: num_content_tokens (keep at 4) and num_style_tokens - 16 if you loaded acsgo.bin, 32 for acsgo_4_32.bin. The README is blunt about it, and getting this wrong produces garbage that looks like the model is broken. Output: csgoCSGO_Sampler.

    Install

    Via ComfyUI Manager, search ComfyUI_CSGO_Wrapper. Or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/smthemex/ComfyUI_CSGO_Wrapper
    

    Then restart ComfyUI. The catch: the pack's requirements.txt is entirely commented out - nothing auto-installs. It leans on diffusers and transformers being present. If imports fail:

    pip install diffusers transformers accelerate safetensors einops omegaconf peft huggingface-hub
    

    Where people get burned

    • "none" means crash, not skip. The source literally does raise "need weight" if base/controlnet/clip_vision/csgo is left at "none" - and raising a string is invalid in Python 3, so you get a cryptic TypeError: exceptions must derive from BaseException. Set all four.
    • Black or mangled output → wire up the SDXL VAE. The README says the same: VAE is not required unless you get black images or bad decoding, then it is.
    • It's slow and heavy. Every generation spins a full SDXL diffusers pipeline plus a ControlNet clone plus CLIP vision. CPU offload is enabled automatically, but on 8 GB cards this is a wait-and-see node, and a good deal slower than native ComfyUI sampling.
    CategoryCSGO_Wrapper

    Inputs (7)

    NameTypeDefaultDescription
    base_cpktCOMBO1 options: none
    clip_visionCOMBO1 options: none
    vae_idCOMBO1 options: none
    controlnetCOMBO1 options: none
    csgo_ckptCOMBO1 options: none
    num_content_tokensINT41–512
    num_style_tokensINT321–1024

    Outputs (1)

    NameTypeDescription
    csgoMODEL