SwarmUI icon indicating copy to clipboard operation
SwarmUI copied to clipboard

variables (and macros) defined in base prompt are not available to object prompts

Open bman654 opened this issue 6 months ago • 1 comments

With a prompt like this:

<setvar[q]:masterpiece, best quality, amazing quality><break>
1girl, solo focus, white/black eyes, glowing eyes, white/black hair, glowing hair, messy hair, drill sidelocks, skin_tight evening gown, white/black evening gown, thighhigh side slit, glowing evening gown, black/white panty & stocking with garterbelt, standing, spread legs, cowboy shot<break>
straight-on, facing viewer, outstretched arms, palms up, holding white/black orb, glowing orb, white/black aura, white/black background, shadowy figures in background, white/black chest tattoo, glowing tattoo

<object:0,0,0.49,1,1,0.5> <var:q>, 1girl, white eyes, crying, tears, glowing eyes, white hair, glowing hair, white evening gown, white panty & stocking with garterbelt, white orb, glowing orb, black background, abyss background, shadowy demons reaching towards viewer

I would expect the q variable to be useable in the object prompt so that I can use the same quality tags while inpainting.

However they do not appear to be shared and I instead get this error in the swarm logs:

10:00:18.141 [Warning] Variable 'q' is not recognized.

FWIW variables do carry over to <segment> prompts, just not to <object> (nor, I am guessing, <region>) prompts.

bman654 avatar Jul 10 '25 15:07 bman654

It's just specifically <object> that's excluded here, because it's processed in a different way

mcmonkey4eva avatar Jul 10 '25 17:07 mcmonkey4eva