Nodes/comfyui-MJAPI-party/文件加载器
ComfyUI Node

文件加载器

Feed a PDF or docx into the Gemini LLM node

By MoJIeAIGC·Created about a year ago·Updated 17 days ago· 50
文件加载器
    • file
    file_path

    Every once in a while you want the LLM in your workflow to read something bigger than a prompt - a spec PDF, a contract, a style guide. ComfyUI has no native "file in" concept, so this pack ships a tiny loader that turns a file on disk into a FILE value you can wire straight into the Gemini LLM node's file input. It's plumbing, not magic, and that's exactly what makes it useful.

    How it works

    The node is a file_path string widget with a JavaScript add-on: click it and a system file dialog pops up to pick your document. The path is stored, and on execution the node loads the file into a FILE type that the pack's GeminiLLMNode knows how to consume - the LLM node accepts a file input alongside its image and video inputs, base64-encodes it, and sends it along with your prompt. It's the same pattern as LoadImage for images, just for documents, and it targets the models in this pack (Gemini 3) rather than being a generic document reader.

    The inputs and outputs

    • file_path (STRING) - the path, or use the built-in picker button to browse. This is the only input.
    • file (FILE) - the output, meant for GeminiLLMNode's file port.

    That's the whole schema. There's no parsing on your side, no OCR dropdown, nothing to tune. Keep it in mind if you're assembling the pack's "LLM reads the brief, then an image node drafts" style agent workflows.

    Installing it

    Part of comfyui-MJAPI-party. Install via ComfyUI Manager (search "mojieapi_party") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/MoJIeAIGC/comfyui-MJAPI-party.git
    

    Restart. Then register at mojieaigc.com and drop your key into config.ini at the pack root (leave BASE_URL alone), restarting once more so the key loads:

    [API]
    KEY = your_api_key
    BASE_URL = https://www.mojieaigc.com/v1/completions
    

    No model downloads, no extra dependencies beyond the pack's standard set.

    Common issues

    • Clicking the button does nothing. The file-picker is a web-UI feature; if you're running ComfyUI from a remote server without the browser on the same machine, browse to a path the server can actually read instead of relying on the dialog.
    • The LLM node ignores your file. Check you've wired file into GeminiLLMNode, not into an image node - Gemini3NanoNode and GPT_Image_2_Node don't take a FILE input. Also confirm the file type is one the backend accepts (the pack's docs point at docx/pdf-style documents; exotic formats are a gamble).
    • Paths with spaces or non-ASCII. The Chinese-targeted docs handle them fine, but if you're on Windows, keep the path simple to be safe.
    Category🎨MJapiparty/LLM

    Inputs (1)

    NameTypeDefaultDescription
    file_pathSTRING

    Outputs (1)

    NameTypeDescription
    fileFILE