Nodes/ComfyUI_OneButtonPrompt/Load Image Info From Civitai
ComfyUI Node

Load Image Info From Civitai

Pull a real prompt straight off Civitai

By billwuhao·Created 2 years ago·Updated about a year ago· 24
Load Image Info From Civitai
    • Image
    • Mask
    • Prompt
    output_typeOnlyPrompt
    nsfwfalse
    proxyhttp://127.0.0.1:None
    seed0

    Most of the nodes in this pack draw from a bundled offline library of prompts. This one doesn't - it reaches out live to Civitai and pulls back a real image and the prompt that made it. If you've ever seen an image you liked on Civitai and wished you could just grab its prompt into your workflow without alt-tabbing and copy-pasting, this is that, as a node.

    How it works

    It's a fetch-and-return node: it goes and gets an entry from Civitai, and depending on how you've configured output_type, gives you back the image, the prompt text, or both. There's no complex pipeline here - the value is entirely in not leaving ComfyUI to do it manually.

    The inputs and outputs that matter

    • output_type - OnlyPrompt (default), Img+Prompt, or Img. OnlyPrompt is the cheap option: no image download, just the text, which is what most people actually want when they're prompt-hunting.
    • nsfw - a boolean switch to pull from Civitai's NSFW content instead. The tooltip is explicit that it doesn't work out of the box: it needs a file called civit_nsfw.json sitting in the pack's txtfiles folder, and the tooltip's own words are "otherwise it is invalid." The pack doesn't ship that file for you - you have to supply it yourself.
    • proxy - only matters if you're fetching an actual image (Img or Img+Prompt). The default value, http://127.0.0.1:None, is a placeholder, not a working address; if Civitai is unreachable from where you're running ComfyUI, this is where you'd point at a real proxy.
    • seed - picks which entry you get back.

    Outputs are Image (IMAGE), Mask (MASK), and Prompt (STRING). The mask output is there for wiring convenience - most people pulling prompts off Civitai can safely ignore it and just take Prompt.

    How to install it

    ComfyUI Manager: search "ComfyUI_OneButtonPrompt", install, restart. Or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/billwuhao/ComfyUI_OneButtonPrompt_Flux
    

    Restart ComfyUI afterward. No formal dependency list is given in the README; if it fails to import, check ComfyUI's console for a missing package (network-fetch nodes like this typically need requests or similar) and install into your ComfyUI environment.

    Common issues

    Image fetches hang or time out, but prompt-only works fine. That's the proxy field. Civitai isn't reachable from everywhere without one, and the node's default value is not a real address - it's a stand-in you're expected to replace with your own working proxy if you hit this. If you only ever need OnlyPrompt, you can ignore this entirely, since it never touches the network for an image.

    nsfw=true doesn't seem to do anything. By design, per the tooltip - it silently does nothing useful unless you've dropped civit_nsfw.json into the pack's txtfiles folder yourself. There's no error, it just falls back to invalid/default behavior.

    Getting the same result every time. Change seed - it's what selects which entry comes back from the pool.

    CategoryMW-OneButtonPrompt

    Inputs (4)

    NameTypeDefaultDescription
    output_typeCOMBOOnlyPrompt3 options: Img, Img+Prompt, OnlyPrompt
    nsfwBOOLEANfalseWhen True, need `civit_nsfw.json` in the `txtfiles` folder, otherwise it is invalid
    proxySTRINGhttp://127.0.0.1:NoneWhen load Img, if unable to access Civitai site, proxy needs to be filled in
    seedINT00–18446744073709550000

    Outputs (3)

    NameTypeDescription
    ImageIMAGE
    MaskMASK
    PromptSTRING