Update jinja2.md

pull/596/head
Adi Eyal 2023-08-14 11:50:14 +02:00 committed by GitHub
parent f681fefc37
commit 2917434eef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -268,6 +268,16 @@ If you are using these templates, please let me know if they are useful.
## Cookbook ## 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) ### [Prompt Editing](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Features#prompt-editing)
```jinja2 ```jinja2