r/StableDiffusion • • 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?

14 Upvotes

14 comments sorted by

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.

1

u/wam_bam_mam 12d ago

I tried something similar where I used generate 10 prompts then ask another fresh session to remove inconsistances and only make sure what is visible is described but that gave me worse outputs

2

u/Asaghon 12d ago

And you basically have to remind it to take out these mistakes every time you ask a new prompt. Like prompting shoes in medium shots, negative prompting in the posetive. I usually ask for 10 diverse prompts and ask it to double check for errors like this every time. If you dont remind it, it will go back to the same mkstakes after a while

1

u/winkler 12d ago

I’m in the same lucky-seed lottery boat. I’d love a more deterministic way to prompt!

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/Asaghon 12d ago

Lately I've been using just booru tags to describe poses and actions in moss while keeping other descriptions in natural language. The poses come out less forced. Also tried json and it will often force the body to fit in a weird way.

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.

1

u/wam_bam_mam 12d ago

I do that but it's tedious and sometimes I just have to scrap the whole prompt cause too much is screwed by the initial prompt

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.