Nodes/PromptModels Studio/Google AI - Architecture Detector
ComfyUI Node

Google AI - Architecture Detector

Point it at a .safetensors and learn what it is

By cdanielp·Created 9 months ago·Updated 2 months ago· 28
Google AI - Architecture Detector
    • architecture_report
    safetensors_path
    api_key
    modelgemini-3.1-pro-preview

    Downloaded a model file and have no idea what it is, what base it was trained for, or whether it'll even load in your pipeline? GoogleAI_ModelArchitectureDetector answers that: you give it a path to a .safetensors file, it reads the tensor names, sends them to Gemini, and comes back with a plain-language report on the architecture. It's a sanity check for the "mystery checkpoint" problem that every ComfyUI user eventually hits after grabbing files from a dozen sources.

    What it's for

    Model forensics, basically. Before you wire a mystery LoRA or checkpoint into a workflow and get a cryptic load error, run it through this and learn what you're dealing with: whether it's a diffusion UNet, a CLIP, a VAE, what base model its keys imply, and roughly what it was built for. It's also a good teaching tool - the report explains the architecture in terms you can actually understand, which beats squinting at a wall of tensor names.

    How it works

    The node opens the file with safetensors.safe_open (so it needs the safetensors library, which any modern ComfyUI already ships), lists every tensor key, samples them (truncating past 250 keys to keep the prompt sane), and sends the list to a Gemini model with a system prompt that says, effectively, "you are an expert in diffusion model architectures." The model reads the key naming conventions - lora_unet_..., model.diffusion_model..., encoder... - and returns the architecture report. Note the honest limits: it reports what the keys imply, it doesn't load or validate the file. A mismatched or exotic architecture can get a confident-sounding wrong answer.

    Inputs and outputs that matter

    • safetensors_path (STRING) - the full path to the file on disk. It must be .safetensors; the node rejects other extensions with a clear message, and checks the file exists first.
    • model (COMBO, default gemini-3.1-pro-preview) - which Gemini does the analysis. Drop to a flash model if you're just checking keys.
    • api_key - leave empty; resolves from GEMINI_API_KEY env var or the pack's .env.
    • architecture_report (STRING) - the analysis. Wire to a text display or read it in the preview.

    Installing it

    One of the 15 Google nodes in COMFYUI_PROMPTMODELS (PromptModels Studio in Manager):

    cd ComfyUI/custom_nodes
    git clone https://github.com/cdanielp/COMFYUI_PROMPTMODELS
    

    Add GEMINI_API_KEY=AI... to the pack's .env and restart. Needs ComfyUI 0.26.0+. Nothing to download - the heavy lifting happens at Google's end, and yes, that means a metered API call.

    Common issues

    Path problems dominate: a relative path that means nothing to the server's filesystem, or a folder path instead of a file, both return the "File not found" message. If the report is wrong, it's usually because the model's keys are ambiguous or heavily obfuscated - treat it as a strong hint, not a guarantee, and confirm against the loader. And it only reads key names, so a corrupted file with plausible-looking keys can still fool it; this is an analysis tool, not a validator.

    CategoryGoogle AI/Diagnostic

    Inputs (3)

    NameTypeDefaultDescription
    safetensors_pathSTRING
    api_keyoptSTRING
    modeloptCOMBOgemini-3.1-pro-preview4 options: gemini-3.1-pro-preview, gemini-3-flash-preview, gemini-2.5-flash, gemini-2.5-pro

    Outputs (1)

    NameTypeDescription
    architecture_reportSTRING