Nodes/ComfyUI-Gemini/📄Gemini_FileUpload_Zho
ComfyUI Node

📄Gemini_FileUpload_Zho

The half of the pair that gets your file to Google

By ZHO-ZHO-ZHO·Created 3 years ago·Updated 2 years ago· 789
📄Gemini_FileUpload_Zho
    • file
    file./sample.mp3

    Gemini_FileUpload_Zho exists to answer one question: how does a local file get into a hosted model? By uploading it to Google, that's how. This node takes a file path, calls genai.upload_file() on it, and outputs a FILE handle that the other half of the pair - 📄Gemini_File_Zho - consumes to ask 1.5 Pro questions about the content.

    The most common beginner mistake is grabbing only this node and wondering why nothing happens. It's the upload side, not the answer side. Wire its file output into Gemini_File_Zho's file input, put your prompt in the second node, and the pair turns "summarize this audio file" from an idea into a running workflow.

    How it works

    The file input is a plain STRING containing a path, default ./sample.mp3. Note it's not a file browser - you type or paste a path, and it's resolved relative to wherever ComfyUI is running. The node uploads that file to Google's file service (not your disk), and the returned handle is what flows through the graph. Single file at a time: the README says multi-file/video upload wasn't supported yet, so the 20 GB and 1M-token claims for 1.5 Pro are for the reading side, not this uploader.

    Because the upload goes to Google, the file sits on their servers afterwards - Google's file API keeps uploads for a couple of days on the free tier, and it's accessible with your key. So the privacy framing is the same as everywhere in this pack: don't upload anything you wouldn't want a third party holding. And a stale handle will fail later, so if your reading node suddenly errors on a file that worked yesterday, re-run the upload.

    Inputs

    Just the one: file, the path string. Output is the file handle (type FILE), which only really connects to Gemini_File_Zho.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/ZHO-ZHO-ZHO/ComfyUI-Gemini.git
    cd ComfyUI-Gemini
    pip install -r requirements.txt
    

    It's implicit-key, so put your key in config.json (auto-created with a placeholder on first load) and restart ComfyUI.

    Common issues

    • File not found / wrong path - the path is relative to ComfyUI's working directory. Use an absolute path if you're unsure where that is.
    • Uploaded but reader errors - either the free-tier upload expired or you hit the rate limit (roughly 2 RPM on 1.5 Pro at launch). Re-upload and retry.
    • Nothing outputs - you grabbed the wrong half of the pair. This node only uploads; add Gemini_File_Zho to get text back.
    CategoryZho模块组/✨Gemini

    Inputs (1)

    NameTypeDefaultDescription
    fileSTRING./sample.mp3

    Outputs (1)

    NameTypeDescription
    fileFILE