Requirements: https://github.com/TheCulprit/stretchs_node_stash to work, and https://github.com/dwringer/generative-grammar-prompt-nodes to make use of the random string switching.
Description: An SDXL workflow for mimicking the delayed prompt injection/prompt switching feature of UIs such as the forge webui. Likely different in effect due to underlying differences in how attention is managed with switching, but I'm unsure of how much different. Includes upscaling and generative grammar nodes which can be quickly removed.
The workflow comes with simple latent upscaling, a simple generative grammar node setup for setting up the initial prompt and changing the prompt mid-generation, stretchs node stash nodes to allow for some logic wiring stuff for the randomness to work, and 9 denoise nodes handling roughly 2 steps each (excluding the pre-upscaling node). Each element should be relatively easy to customise, and the generative grammar nodes and uspcaling can be removed without much effort. Notes are spread around to explain parts of the workflow, some nodes have text explaining their purpose in them, and an example setup has been provided to demonstrate manual prompt switching mid-generation. A few metadata nodes are included to show the prompt changes and when it occurs.
If you wish to use generative grammar nodes, you'll need to know how to use the extension. Create your prompt in the designated "Lookups Entry from Prompt" node at the top, and use the tag system to ensure the strings resolve to become the same during generation so that it can replace the tagged string ({example:blah} in one node and {example:blah} in the other). The section in the bottom left is where the second instance of {example:blah} will go, and you can create a replacement for that tag in the designated replacement string box.
If you do not wish to use generative grammar nodes, simply delete the top and bottom left section of the workflow with those nodes, and substitute the prompt outputs for regular prompt nodes.
This was created in version 5.12.0. As of this version, ancestral samplers introduce extra noise when switching nodes, making it extremely difficult to make work. A warning note is provided in the workflow to specify where not to use ancestral samplers.


