當(dāng)前位置:
首頁 >
webui 通过提示词矩阵的文本框功能添加负面标签
發(fā)布時間:2024/1/8
39
豆豆
生活随笔
收集整理的這篇文章主要介紹了
webui 通过提示词矩阵的文本框功能添加负面标签
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
眾所周知使用該功能可以添加很多行tag,腳本會解析一行中所有tag內(nèi)容,逐行生成圖片
默認(rèn)每行輸入是按照正咒的形式輸入的,跑的多了,出現(xiàn)了很多一個腦袋兩個身體之類的怪東西,通過添加負(fù)面標(biāo)簽可以一定程度上減小這種情況。但是界面上沒用單獨(dú)添加負(fù)面標(biāo)簽的位置。
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}閱讀源碼可以發(fā)現(xiàn),該腳本默認(rèn)是以prompt為參數(shù),解析輸入行。 而添加-- 可以輸入其他的命令
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,因此可以修改每行字符串為如下格式,進(jìn)行逆咒添加
--prompt "你的正咒" --negative_prompt "你的逆咒"加引號是因?yàn)槟J(rèn)解析時以空格作為分割標(biāo)志,咒文里面難免有帶空格的標(biāo)簽
例子:
--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"總結(jié)
以上是生活随笔為你收集整理的webui 通过提示词矩阵的文本框功能添加负面标签的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 水果闹钟照片
- 下一篇: 活动回顾 |阿里云MVP Tech Sh