Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/main/diffusers/long_prompt_weighting_stable_diffusion.ipynb
Views: 2535
Long Prompt Weighting Stable Diffusion
When inputting a prompt without the 77 token length limit, you can include text-to-image (tx2img), image-to-image (img2img), and inpainting pipelines. You can emphasize or weigh part of your prompt by using parentheses, such as "a baby deer with (big eyes)". If you want to de-emphasize part of your prompt, you can use square brackets, like "a [baby] deer with big eyes".
For precise weighting, you can adjust the emphasis with a specific value, for example, "a baby deer with (big eyes:1.3)". Prompt weighting equivalents include "a baby deer with" being equivalent to "(a baby deer with:1.0)", "(big eyes)" being equivalent to "(big eyes:1.1)", "((big eyes))" being equivalent to "(big eyes:1.21)", and "[big eyes]" being equivalent to "(big eyes:0.91)". This allows for flexible control over the importance of different elements in your prompts.
This script was contributed by SkyTNT and the notebook by ParagEkbote.
Onnxruntime
If you see Token indices sequence length is longer than the specified maximum sequence length for this model ( *** > 77 ) . Running this sequence through the model will result in indexing errors.