作用
如果想要隨機 prompt 中的一些單字,你可以使用 Wildcards 插件
舉例來說,你可能想要隨機變換畫面中的主體,但其他 prompt 不變
你可能需要改多次,例如
|
1 2 3 4 |
1. boy stand in the middle of road, wide angle 2. girl stand in the middle of road, wide angle 3. dog stand in the middle of road, wide angle 4. cat stand in the middle of road, wide angle |
但使用 Wildcards 之後你可以寫
|
1 |
__character__ stand in the middle of road, wide angle |
他就會從 character.txt 中隨機取出裡面的單字,具體操作如下
安裝
首先切換到 Extensions 安裝 Wildcards

使用
依照上述例子,需要先建立 character.txt 檔案,character.txt 內容如下
|
1 2 3 4 |
boy girl cat dog |
接著把檔案存到以下路徑 : stable-diffusion-webui\extensions\stable-diffusion-webui-wildcards\wildcards
接下來就可以在 prompt 使用 character ,舉例如下 :
|
1 2 3 |
__character__ stand in the middle of road, wide angle, (8k, RAW photo, best quality, masterpiece:1.2), smile, anime, |
此時按下 Generate,我隨機到 cat

在按一次 Generate,這次隨機到 gril

Wildcards 也可以同時使用,例如你想隨機風格,那就先建立一個 artist.txt
內容如下
|
1 2 3 4 |
wlop ilya kuvshinov Slim Aarons Ed Binkley |
並將 prompt 改為即可
|
1 2 3 |
__character__ stand in the middle of road, wide angle, (8k, RAW photo, best quality, masterpiece:1.2), smile, anime, by __artist__ |
Wildcards txt 下載
以下是其他人分享的 Wildcards txt,可以拿來參考
https://github.com/Lopyter/stable-soup-prompts
https://github.com/mattjaybe/sd-wildcards