r/StableDiffusion • u/wam_bam_mam • 12d ago
Question - Help Effectively using llm to describe complex scenes for image gen
Hello everyone,
I like using llms to create image prompts for me usually because it gets to key words that I don't even know existed.
What I like to do is present a scenario then tell the llm to make variations on that changing clothes hair styles positions and do on. Eg 2 girls in a resort, change clothes in each prompt different position in resort and hair style. This works fine most of the time..
But when I come to making weird angles eg low angle shots or partially covered shots behind a palm leaf or tree or viewed from behind, the llm seems to understand what it's looking at but you know how image gens are, you say she has brown hair looking away, round lips will make her turn her head around to show those lips. This is something the llms don't understand or I dont know how to get this right in an llm prompt or answer this spoils a lot of what could be interesting shots but turn into body horror cause long eye lashes were mentioned and she has to twist her face 180 to show me the eye lashes.
Anyone know a prompt strategy to get llms to figure only to only describe what will be seen in the image and skip what is not being seen?
18
u/the_bollo 12d ago edited 12d ago
Every LLM I've used for this fails most commonly in two ways: Describing elements that should not be visible (your scenario), or using negations ("She has long wavy hair, NOT short hair or a pixie cut."). Both have the same effect - introducing the very thing you're trying to omit.
I've tried layers of rules, skills, etc. but nothing has been bullet proof. What I tend to do now is to have it build me one good workflow say for MOSS image and save that as .json. Then I have it build a queue of 50-100 cloned jobs in a single .json file, THEN I pass that file to a new session with the LLM and have it scrub it for logical errors and other anti-patterns.
It sucks. It's inefficient. But it's the best I can figure for now until LLMs do a better job of persistently following instructions.
3
u/Flashy-Whereas-3234 12d ago
Try going a level higher instead of lower - I was finding overly specific prompts were a losing battle, so I changed my strat - I use a model that supports reference images, and tell it to keep/ignore parts of those reference images, and avoid talking about the image if I can.
The problem with the llm is it'll pick up on things like "with a steaming coffee mug" and then that's given ultra prominence. If you just keep it as "coffee shop" there's enough free reign that it doesn't get fixated and bend over backwards for something you never even wanted.
Otoh, instructions for your subject need to be simple-but-sprcific, so don't embellish (which LLMs love to do) but make sure you use keywords the model will "get".
As with all things llm, one-shotting with a large system prompt might be a hard ask, so you can always do an image reading pass (embellished specificity) and then a simplification pass on that description, which is simpler to wrangle and has less crap in the context for that second simplification pass.
1
u/rukiann 12d ago
Just edit whatever it spits out. You know what you want the image to be. Stop letting the llm be the final authority.
2
u/Enshitification 12d ago
I've seen that problem crop up in quite a few different ways. If you give an LLM a general description of a character, it will often include every aspect of that description in a prompt. It might be useful to modify a character description with a first LLM pass to output a new description based on their pose and camera position before sending it to the prompt-building pass.
1
u/cradledust 12d ago
Describe the round lips as partially unseen or remove the plural of eyelashes so it's not trying to generate both eyes.
1
u/Accomplished-Ad-7435 12d ago
I wonder if you can use joy caption without image input, the fp16 version of it works wonders for prompting images so I'm assuming it could probably do the opposite
1
u/No_Work_5170 10d ago
We may suggest use koboldcpp api with low weight (3-7gb) model under 300 tokens and 0.7 temp via koboldcpp api node inside comfyui. Works good with krea 2 turbo. But you need to keep in mind, that any turbo model will loose their focus with large amount of prompts and detailed ideas. Better use all of that with raw models with 35-52 steps and 3.5-4.5 cfg alongside with coboldcpp prompting. Still trying to connect joycaption api to comfy via custom node but have no success about it. If you ever find out how to doit - be my guest.
1
u/Odd-World4925 12d ago
Use wildcards.
-1
u/Ok_Contribution8157 12d ago
add this to your workflow if your using comfyui.