webui 通过提示词矩阵的文本框功能添加负面标签
生活随笔
收集整理的這篇文章主要介紹了
webui 通过提示词矩阵的文本框功能添加负面标签
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
眾所周知使用該功能可以添加很多行tag,腳本會解析一行中所有tag內容,逐行生成圖片
默認每行輸入是按照正咒的形式輸入的,跑的多了,出現了很多一個腦袋兩個身體之類的怪東西,通過添加負面標簽可以一定程度上減小這種情況。但是界面上沒用單獨添加負面標簽的位置。
for line in lines:if "--" in line:try:args = cmdargs(line)except Exception:print(f"Error parsing line [line] as commandline:", file=sys.stderr)print(traceback.format_exc(), file=sys.stderr)args = {"prompt": line}else:args = {"prompt": line}閱讀源碼可以發現,該腳本默認是以prompt為參數,解析輸入行。 而添加-- 可以輸入其他的命令
prompt_tags = {"sd_model": None,"outpath_samples": process_string_tag,"outpath_grids": process_string_tag,"prompt_for_display": process_string_tag,"prompt": process_string_tag,"negative_prompt": process_string_tag,因此可以修改每行字符串為如下格式,進行逆咒添加
--prompt "你的正咒" --negative_prompt "你的逆咒"加引號是因為默認解析時以空格作為分割標志,咒文里面難免有帶空格的標簽
例子:
--prompt "masterpiece, best quality,, Photorealistic, extremely fine and beautiful, perfect detailed,Ishtar\(fate\),warframe,,1girl,full_body,beautiful and clear background,detailed beautiful eyes, floating hair ,,contour deepening, " --negative_prompt "bad hands,nsfw"總結
以上是生活随笔為你收集整理的webui 通过提示词矩阵的文本框功能添加负面标签的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 水果闹钟照片
- 下一篇: 活动回顾 |阿里云MVP Tech Sh