Update jinja2.md

This commit is contained in:
Adi Eyal
2023-08-14 11:50:14 +02:00
committed by GitHub
parent f681fefc37
commit 2917434eef
+10
View File
@@ -268,6 +268,16 @@ If you are using these templates, please let me know if they are useful.
## Cookbook
### Conditional Rendering
Render different prompts determined by a variable
```jinja2
{% with season = choice("winter", "summer") %}
{% set dress_color = "blue" if season == "winter" else "red" %}
A fashion model wearing a {{ dress_color }} dress
{% endwith %}
```
### [Prompt Editing](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Features#prompt-editing)
```jinja2