Home

Awesome

<div align="center"> <img alt="icon" src="https://github.com/receyuki/stable-diffusion-prompt-reader/raw/master/sd_prompt_reader/resources/icon-cube.png" width=20% height=20%> <h1>SD Prompt Reader Node</h1> <a href="https://github.com/receyuki/comfyui-prompt-reader-node/blob/master/LICENSE"> <img alt="GitHub" src="https://img.shields.io/github/license/receyuki/comfyui-prompt-reader-node"></a> <img alt="GitHub tag (with filter)" src="https://img.shields.io/github/v/tag/receyuki/comfyui-prompt-reader-node?label=node"> <a href="https://github.com/receyuki/stable-diffusion-prompt-reader"> <img alt="GitHub tag (with filter)" src="https://img.shields.io/github/v/tag/receyuki/stable-diffusion-prompt-reader?label=core"></a> <a href="https://github.com/psf/black"> <img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a> <br>

This is a subproject of the <a href="https://github.com/receyuki/stable-diffusion-prompt-reader">SD Prompt Reader.</a> It helps you extract metadata from images in any format supported by the <a href="https://github.com/receyuki/stable-diffusion-prompt-reader">SD Prompt Reader</a> and saves the images with additional metadata to ensure compatibility with metadata detection on websites such as Civitai. <br>

<p> <a href="#supported-formats">Supported Formats</a> • <a href="#installation">Installation</a> • <a href="#usage">Usage</a> • <a href="./CHANGELOG.md">Change Log</a> • <a href="#credits">Credits</a> </p> <img src="./images/screenshot_v130.png"> </div>

Supported Formats

PNGJPEGWEBPTXT*
A1111's webUI
Easy Diffusion
StableSwarmUI*
StableSwarmUI (prior to 0.5.8-alpha)*
Fooocus-MRE*
NovelAI (stealth pnginfo)
NovelAI (legacy)
InvokeAI
InvokeAI (prior to 2.3.5-post.2)
InvokeAI (prior to 1.15)
ComfyUI*
Draw Things
Naifu(4chan)

See SD Prompt Reader for details

Installation

[!NOTE] While ZIP package is available, it is strongly recommended not to use it for installation.

Install and update via ComfyUI Manager (Recommended)

Search for SD Prompt Reader in the ComfyUI Manager and install it.

Install manually

Please make sure to install the submodules along with the main repository.

  1. cd to the custom_node folder
  2. Clone this repo
    git clone --recursive https://github.com/receyuki/comfyui-prompt-reader-node.git
    
  3. Install dependencies
    cd comfyui-prompt-reader-node
    pip install -r requirements.txt
    

Update

When updating, don't forget to include the submodules along with the main repository.

git pull --recurse-submodules

Usage

Prompt Reader Node

<div align="center"> <img src="./images/reader.png" width="25%" height="25%" alt="reader node"> </div>

[!IMPORTANT] Due to custom nodes and complex workflows potentially causing issues with SD Prompt Reader's ability to read image metadata correctly, it is recommended to embed the Prompt Saver Node within the workflow to ensure maximum compatibility.

<details> <summary><b>More Information</b></summary>

parameter_index

SDXL

Batch Read

<div align="center"> <img src="./images/loader2reader.png" width="50%" height="50%" alt="connect batch loader to prompt reader"> </div>

Additional Parameters

<div align="center"> <img src="./images/reader2extractor.png" width="50%" height="50%" alt="connect prompt reader to parameter extractor"> </div>

MODEL_NAME

</details>

Prompt Saver Node

<div align="center"> <img src="./images/saver.png" width="25%" height="25%" alt="saver node"> </div>

[!TIP] Since it's not possible to directly extract metadata from KSampler, it's necessary to use the Parameter Generator Node to generate parameters and simultaneously output them to the Prompt Saver Node and KSampler Node.

<details> <summary><b>More Information</b></summary>

Image Format

Duplicate Filename

Hashes & Auto-Detection on Civitai

save_metadata_file

date_format & time_format

filename & path

</details>

Parameter Generator Node

<div align="center"> <img src="./images/generator.png" width="25%" height="25%" alt="generator node"> </div>

[!TIP] The Parameter Generator Node can also be used as a control panel for complex ComfyUI workflows, just like the AP workflow.

<details> <summary><b>More Information</b></summary>

Optimal Resolution

refiner_start

</details>

Batch Loader Node

<div align="center"> <img src="./images/loader.png" width="25%" height="25%" alt="loader node"> </div> <details> <summary><b>More Information</b></summary> <div align="center"> <img src="./images/loader2reader.png" width="50%" height="50%" alt="connect prompt reader to parameter extractor"> </div>

path

</details>

Parameter Extractor Node

<div align="center"> <img src="./images/extractor.png" width="25%" height="25%" alt="extractor node"> </div> <details> <summary><b>More Information</b></summary> <div align="center"> <img src="./images/reader2extractor.png" width="50%" height="50%" alt="connect prompt reader to parameter extractor"> </div> </details>

Prompt Merger Node & Type Converter Node

<div align="center"> <img src="./images/merger_converter.png" width="25%" height="25%" alt="merger and converter node"> </div>

Lora Loader Node & Lora Selector Node

<div align="center"> <img src="./images/lora.png" width="50%" height="50%" alt="lora loader and selector node"> </div> <details> <summary><b>More Information</b></summary>

Multiple Loras

  1. Lora Loader chain
<div align="center"> <img src="./images/lora_loader_chain.png" width="100%" height="100%" alt="lora loader chain"> </div>
  1. Lora Selector chain
<div align="center"> <img src="./images/lora_selector_chain.png" width="100%" height="100%" alt="lora loader chain"> </div> </details>

Example Workflow

<details> <summary><b>Simple Example</b></summary> <div align="center"> <img src="./workflows/simple_example.png" width="100%" height="100%" alt="example workflow"> </div> </details> <details> <summary><b>Lora Example</b></summary> <div align="center"> <img src="./workflows/lora_example.png" width="100%" height="100%" alt="example workflow"> </div> </details> <details> <summary><b>Hires-fix Example</b></summary> <div align="center"> <img src="./workflows/hires_fix_example.png" width="100%" height="100%" alt="example workflow"> </div> </details> <details> <summary><b>SDXL Example</b></summary> <div align="center"> <img src="./workflows/sdxl_example.png" width="100%" height="100%" alt="example workflow"> </div> </details>

Credits