Hey there, AI enthusiasts! Remember those mind-blowing AI-generated images we've been exploring? Well, get ready to take things to a whole new level. Today, we're diving into a powerful combo that'll make your creative dreams a reality: Open-WebUI and ComfyUI.
Open-WebUI: Your AI Control Center
ComfyUI: Crafting Your Artistic Vision
Let's Get Creative!
Launch ComfyUI and load your desired workflow. If you're using Flux, I have a dedicated tutorial on setting up Flux models with ComfyUI (linked below). Ensure your workflow is functioning correctly before proceeding. Open the ComfyUI Settings by clicking the gear icon in the top-right corner of the sidebar menu. Enable Dev Mode: Look for the "Enable Dev Mode Options" checkbox and make sure it's checked. This is crucial for saving our workflow in a JSON format that Open-WebUI can understand. Save Your Workflow in API format: You'll notice a new option in the right sidebar menu called "Save (API format)". Click it to save your current workflow as a JSON file (e.g., workflow.json) in your preferred location. Keep ComfyUI running – we'll come back to it soon.
Open Open-WebUI and go to the Admin Panel by clicking your profile icon in the top right corner. Navigate to Image Settings: Click on "Admin Panel Settings" and then select "Images" from the left sidebar. Choose ComfyUI: Select "ComfyUI" from the "Image Generation Engine" dropdown menu. Enter the ComfyUI URL: Copy the ComfyUI URL link from its terminal window (it should look something like http://127.0.0.1:8188) and paste it into the "ComfyUI Base URL" field in Open-WebUI. Test the Connection: Click the spiral icon next to the URL field to ensure a successful connection. Upload Your Workflow: Click "Click here to upload a workflow.json file" and select the workflow.json file you saved earlier. Map ComfyUI Nodes: This is where the magic happens! Open-WebUI needs to know how to interact with your specific ComfyUI workflow. Identify Node IDs: Carefully examine your workflow.json file to find the unique ID number associated with each node in your ComfyUI workflow. These IDs are typically located above each node's settings and are left-aligned in the JSON file. Enter Node IDs in Open-WebUI: In Open-WebUI, you'll see a section called "ComfyUI Workflow Nodes". Enter the corresponding node IDs you identified in your workflow.json file into the correct fields (e.g., Prompt, Model, Width, Height, Steps, Seed).
Set Default Settings: In the "Set Default Model" field, enter the exact name of the model you're using in your ComfyUI workflow (e.g., flux-dev-Q4_0.ggml). Also, set your desired default image size and number of steps for each generated image. Enable Image Generation: Click the toggle switch to enable image generation. Save Your Settings: Don't forget to click the "Save" button at the bottom of the page to preserve your configuration.
Choose Your Model: Return to the main chat menu in Open-WebUI and select the language model you want to use (e.g., Llama-2 3.1-70B). Generate a Prompt: In the chat window, type "Write a prompt for…" followed by your image idea. For example, "Write a prompt for a robot playing guitar on the moon." To avoid extra information, add "Only respond with the prompt for the image and nothing else" to your query. Generate Your Image: Once the model provides an image prompt, click the small image icon below the chat bubble to initiate an API request using your ComfyUI workflow. You'll know it's working if a loading message appears in place of the button. Admire Your Masterpiece: Once the generation is complete, your AI-generated image will appear in the chat UI. You can click on it for a closer look and use the same image icon to regenerate a new image based on the same prompt. Don't forget to save your image before generating others, as new images will replace the old ones.
0 Comments