ComfyUI Extension: ComfyUI-Fooocus-V2-Expansion

Authored by PanicTitan

Created

Updated

3 stars

Adaptation of Fooocus Prompt Expansion for ComfyUI Forked from a/ComfyUI-Prompt-Expansion with some updates and changes based on original Fooocus, to be more specific a/expansion.py and a/LykosAI - GPT-Prompt-Expansion-Fooocus-v2

Custom Nodes (0)

    README

    ComfyUI Fooocus V2 Prompt Expansion Node

    Unleash the Power of Fooocus Prompt Expansion in ComfyUI!

    This custom node brings the acclaimed Fooocus Prompt Expansion V2 directly into your ComfyUI workflows, allowing you to effortlessly generate more detailed and creative prompts for stunning image generation. Inspired by the simplicity and effectiveness of Fooocus, this node helps you expand your initial prompts into rich, elaborate descriptions that can significantly enhance your image outputs.

    ComfyUI Fooocus V2 Expansion Workflow

    Effortlessly enhance your prompts and elevate your ComfyUI image generation!

    Key Features:

    • Fooocus V2 Expansion Algorithm: Implements the powerful prompt expansion logic from Fooocus, known for its ability to create highly detailed and stylistically rich prompts.
    • Seamless ComfyUI Integration: Works as a native custom node within ComfyUI, easily incorporated into your existing workflows.
    • Improved Prompt Detail: Expands simple prompts into elaborate and nuanced descriptions, leading to more detailed and visually appealing images.
    • Inspired by Fooocus: Faithfully adapted from the original Fooocus project and the LykosAI - GPT-Prompt-Expansion-Fooocus-v2 resource.
    • Ready-to-Use Workflow: Includes a complete ComfyUI workflow example (see below) to get you started immediately.

    Get Started:

    1. Installation:

    • Using ComfyUI Manager (Recommended):

      • Open ComfyUI Manager.
      • Go to "Install Custom Nodes".
      • Search for ComfyUI-Fooocus-V2-Expansion and install it (exists a old version fooocus-v2-expansion that should be deleted).
      • Restart ComfyUI after installation.
    • Install via Git URL:

      • Navigate to your ComfyUI/custom_nodes directory.
      • Clone this repository using git:
        git clone https://github.com/PanicTitan/ComfyUI-Fooocus-V2-Expansion.git
        
      • Restart ComfyUI after installation.

    Warning:

    • GPT-2 Model Download: The first time you use the "Fooocus V2 Expansion" node, it will download the GPT-2 model (approximately 351MB) required for prompt expansion. This download is necessary and will only happen once. Please be patient while the model is downloaded.

    2. Install Workflow Dependencies:

    • ComfyUI Manager (Recommended): If you installed via ComfyUI Manager, it will likely prompt you to install missing dependencies after installation. Click "Install Missing" to automatically install any required Python packages.
    • Manual Installation: If you installed manually via Git URL, you may need to manually install workflow dependencies ComfyUI-Easy-Use, ComfyUI_Comfyroll_CustomNodes and (optional) ComfyUI-Crystools.

    3. Download Essential Models:

    This workflow is designed to work optimally with models and LoRAs commonly used in Fooocus. You can download them here:

    4. Load the Workflow:

    • Download the example workflow JSON file: Fooocus-ComfyUI.json
    • In ComfyUI, drag and drop the Fooocus-ComfyUI.json file onto the interface.
    • Ensure you have the required models and LoRA loaded correctly (CheckpointLoaderSimple and LoraLoader nodes in the workflow).

    5. Run and Enjoy!

    • Modify the "Positive Prompt" and "Negative Prompt" text boxes to your liking.
    • Click "Queue" to generate your image with Fooocus-expanded prompts.
    • Observe the "Expanded Prompt" and "Styled Prompts" nodes to see the prompt expansion in action!

    Credits and Inspiration:

    Enjoy using Fooocus V2 Prompt Expansion in ComfyUI! Feel free to contribute, report issues, or suggest improvements!

    <div align="center"> <img src="logo.svg" width="300" height="auto" alt="ComfyUI Fooocus V2 Expansion Logo"> </div>

    README.md Generated By AI Gemini 2.0 Flash Thinking ✨