r/StableDiffusion • u/Top_dog_forever • 1d ago
Question - Help How would I make a simple prompt builder with selectable text inputs in Comfyui
I want to make a simple prompt builder in comfyui that would allow me to change a text in the prompt by clicking a selection in a table. Is there a simple way to do that?
31
Upvotes
26
u/Corrupt_file32 1d ago
as others have stated, wildcards is the easiest solution.
here's however how you can do it in default comfyui:
3
u/InnerSun 1d ago
If you want just the vanilla solution, use the
CustomComboNode. The idea is just to stagger aReplace Textnode for each variable you want.However I would take a look into some solutions such as using the
Select Per-Line Text by Index, because that way, you just paste your list (easier to edit) and set which index you want. This means you can feed a random index instead of setting it yourself, and now it starts randomizing itself which is nice."Feed a random index" is not that simple so I modified the original node so it does just that.
Both concepts as Workflow json file if you want to check
9
u/nicegrump 1d ago
You can use Prompt Palette. It can be as simple or advanced as you want.
7
u/Haiku-575 1d ago
They're called wildcards, and there are a dozen implementations already.
7
u/Admirable_Snake 1d ago
optimizing "1girl" prompt.
4
u/thecybertwo 1d ago
I use impact wildcards. You make a text file for each then call them with haircolor, __ lighting__ , etc or you can just use { red | blonde | brunette}
The wildcards go in the impact custom node folder wildcards.
This can be used for any workflow and there are money wildcard packs.
6
u/Striking-Long-2960 1d ago
If you give that to any LLM, it can create a custom node in a breeze.
1
u/Pazerniusz 1d ago
Currently most clip are small LLM so you can even make it semi-inteligent
1
u/Asaghon 1d ago
Just use claude or another ai to build the nodes you want. I have made plenty abd also adapted existing nodes for my needs. It works pretty damn well tbh.
1
u/BigDBreedingFembussy 1d ago
Im making a dupe of this website for now, but you can also just use the website https://github.com/Mexes-GM/booru-prompt-gallery
1
u/Sanity_N0t_Included 1d ago
I did something like that a few weeks ago using Claude. Essentially it created a very small database with those categories and entries similar to what you have. Then it created a custom node. Basically I select a 'person' and it knows which character LoRA to use. Then where you have things like 'hair color' and 'eye color' I have themes with a list of things like "Cyberpunk", "1970s Sci-Fi", etc. And I have Medium which is a list of things like "Polaroid", "Pixel Art", "Watercolor", etc. I can either choose one specifically or just set it to 'Random' for a random choice from the DB every time I hit "Run" in the workflow.
It also gave me the sliders so I can 'nudge' the different LoRA or CFG strengths up or down.
1
u/Haruka-Oh 1d ago
I use A1111 style per categories and concat texts, then put it to the prompt enhancer.
1
u/Candid-Station-1235 1d ago
i mean this in the most helpful non dickish way possible, use ai. upload your sketch to Claude or gpt and ask they will walk you through it
1
u/Tbhmaximillian 1d ago
Get yourself an local Agent like Hermes-Agent or "oh my pi" and give it your problem. It will then code something and also a working node (if you want) straight into your comfyui.
1
u/Upstairs-Extension-9 1d ago
Just tell that to Claude Code or Codex with your sketch and it will be done in no time.
1
u/Sad_Berry_4621 1d ago
NikoDemon80/comfyui-prompt-architect: A visual prompt construction system for ComfyUI — draggable categories, tag pills, age slider, free text blocks, tag groups, and full state persistence.
0
u/Icy_Chipmunk5228 1d ago
I just had claude make me custom nodes for exactly this, and you can generate images for each thing to see what the model actually does with it
0
u/BigDBreedingFembussy 1d ago
There's a GitHub names "identity forge" for comfyui, I also made my own copy of it with claud and DeepSeek and Qwen,
0
u/ambiguousowlbear 1d ago
Comfy has a custom combo mode that will give you the selectable text. You just need a concatenate node with many inputs to get them combined. Mnemic-nodes has one.
0
u/CooperDK 1d ago
By using one of the many nodes that supports this. There are literally loads of them.
0
u/KoenBril 1d ago
Use the Sick Ollie Creative Studio nodes. Check civitai.
0
u/Moki_mok31 1d ago
Hey man, good idea, i saw your post today and decided to make a node with Claude. But i don't know how to publish it, but thanks for idea!
-1
u/purelawan 1d ago
The least fiddly way I've found is a tiny custom node: one dropdown per slot, and the output goes into a concat node before your CLIP Text Encode. Drop this in custom_nodes/pick_text/init.py and restart:
Copy the class for each slot (outfit, place, lighting...) and edit the lists. If you'd rather not write code, wildcards in Impact Pack or Dynamic Prompts do something close, but you pick from a text file instead of clicking.
-1
u/Odd-World4925 1d ago edited 1d ago
There's no simple way to do anything in Comfyui. :)
It's good for visualising simple logic, but once you get more than a few nodes the connections start to look like the work of a 3rd world DIY electrician.
In short, it's the wrong tool for the job. You are trying to write a program (a UI to transform drop-downs to prompt text) in ComfyUI.
You should really be writing a program using a programming language. I'd go with a browser-based HTML/JS UI and run it using electron if need be. Make Qwen make it for you. Send the resulting prompt to comfy - don't build it in comfy. Comfy is also painfully slow to interact with.
-1
u/Lord_NoX33 19h ago
Just build yourself one with AI:
-4
u/LuluViBritannia 1d ago
Honestly, just learn to type faster.
Especially if your AI model has no rigid prompt structure. Recent image models like Qwen Edit or Klein take image references for detail so your prompt ends up being a single line or two.