mirror of
https://github.com/Physton/sd-webui-prompt-all-in-one.git
synced 2026-12-03 18:42:25 +07:00
[GH-ISSUE #300] [Bug] 关于prompt格式中最后逗号的设置产生的一些问题,如无法方便复现原图 #261
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Physton/sd-webui-prompt-all-in-one#261
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ligerye on GitHub (Feb 12, 2024).
Original GitHub issue: https://github.com/Physton/sd-webui-prompt-all-in-one/issues/300
反馈须知
描述问题
当在prompt格式中勾选上去除Prompt最后的一个逗号后,会始终自动删去最后一个tag的逗号,然而,如果将最后一个prompt双击注释掉后,其前一个单词后面的逗号并不会自动去掉,且会伴随生成的图一并存入到exif信息当中。(这种情况对于正负面输入框都是存在的,对于我发现的情况是正面多了一个末尾句号,主要一般负面不怎么动)
如果后面想要将生成的图片进行复现或对其进行hires.fix放大操作时,使用图片浏览器将其生成信息发送到t2i界面时,由于之前的操作“勾选上去除Prompt最后的一个逗号”,这会导致自动将原来被留下的末尾的逗号被抹掉,因此会导致生成的图片产生意料之外的变化(虽然有时这种变化是比较微妙的),不能复现原来的图。
另外,如果去掉勾选“去除Prompt最后的一个逗号”,也会导致相同的问题,因为虽然正面输入正确保留了最后的逗号,然而在负面输入框又会自动地加上一个末尾逗号,但对于之前发送的图是不存在这个末尾逗号的,故也会影响复现。
设想的解决办法:
A:在勾选了去除Prompt最后的一个逗号的情况下,当最后一个prompt被禁用后也会自动删除位于其前面的逗号,即始终去除掉最后末尾的逗号;这样就保证了生成的图片中不会发生意外存在末尾逗号的情况;
B:增加一个新的选项,不对末尾的逗号做任何额外处理,即既不删也不增,保留原始情况;这样对于原图存在末尾的逗号时,即使发送到t2i界面,也会保证这个逗号正确地保留下来,从而正确复现原图。
应该也有其他的具体解决方案,希望作者大大将这里的末尾逗号功能给改良一下,感谢!
如何复现
以下例子以正面输入的情况为例:





1.输入正面词
2.禁用掉最后一个词,并进行生成(此时留存了本来应该删除的逗号,但此时是开启了去除Prompt最后的一个逗号的选项的)
3.查看刚才生成的图的图片信息(可以看到逗号被意料之外的保留了下来)
4.将该图片的信息发送到t2i界面中(发送前已清空掉输入框)(可以看到原来末尾的逗号被自动删掉了,这正是因为开启了去除Prompt最后的一个逗号的选项导致的,也因此无法完美复现原图了)
截图或日志
No response
操作系统
Windows
浏览器
Edge
Stable Diffusion WebUI 版本
1.7.0
扩展版本
b35ee8ePython 版本
3.10.11
Gradio 版本
3.41.2
@Issues-translate-bot commented on GitHub (Feb 12, 2024):
Title: [Bug] Regarding some problems caused by the setting of the last comma in prompt format, such as the inability to easily reproduce the original image
Feedback Instructions
Describe the problem
When you check Remove the last comma of the prompt in the prompt format, the comma of the last tag will always be automatically deleted. However, if you double-click the last prompt to comment it out, the comma after the previous word will not be automatically deleted. Remove it, and it will be stored in the exif information along with the generated image. (This situation exists for both positive and negative input boxes. For the situation I found, the positive side has an extra period at the end. The main reason is that the negative side does not move much)
If you later want to reproduce the generated image or perform hires.fix enlargement operation on it, use the image browser to send the generated information to the t2i interface. Due to the previous operation, "check the box to remove the last comma of Prompt". ”, this will cause the original trailing comma to be automatically erased, thus causing unexpected changes in the generated image (although sometimes this change is subtle), and the original image cannot be reproduced.
In addition, if you uncheck "Remove the last comma of Prompt", it will also cause the same problem, because although the positive input correctly retains the last comma, a final comma is automatically added to the negative input box, but for The picture sent before does not have this trailing comma, so it will also affect the reproduction.
Considered solution:
A: When Remove the last comma of prompt is checked, when the last prompt is disabled, the comma in front of it will also be automatically deleted, that is, the last comma will always be removed; this ensures that the generated image There will be no accidental trailing commas;
B: Add a new option without any additional processing of the comma at the end, that is, neither deletion nor addition, keeping the original situation; in this way, when there is a comma at the end of the original image, even if it is sent to the t2i interface, this comma will be guaranteed Correctly preserved, thus correctly reproducing the original image.
There should be other specific solutions. I hope the author can greatly improve the function of the trailing comma here. Thank you!
How to reproduce
The following example takes the case of positive input:
Screenshot or log
No response
operating system
Windows
Browser
Edge
Stable Diffusion WebUI version
1.7.0
Extended version
b35ee8ePython version
3.10.11
Gradio version
3.41.2
@Physton commented on GitHub (Feb 13, 2024):
感谢你的反馈!
A:在勾选了去除Prompt最后的一个逗号的情况下,当最后一个prompt被禁用后也会自动删除位于其前面的逗号,即始终去除掉最后末尾的逗号;这样就保证了生成的图片中不会发生意外存在末尾逗号的情况;
B:增加一个新的选项,不对末尾的逗号做任何额外处理,即既不删也不增,保留原始情况;这样对于原图存在末尾的逗号时,即使发送到t2i界面,也会保证这个逗号正确地保留下来,从而正确复现原图。
应该也有其他的具体解决方案,希望作者大大将这里的末尾逗号功能给改良一下,感谢!
@Issues-translate-bot commented on GitHub (Feb 13, 2024):
Thanks for your feedback!
A: When Remove the last comma of prompt is checked, when the last prompt is disabled, the comma in front of it will also be automatically deleted, that is, the last comma will always be removed; this ensures that the generated image There will be no accidental trailing commas;
B: Add a new option, without any additional processing of the comma at the end, that is, neither deletion nor addition, retaining the original situation; in this way, when there is a comma at the end of the original image, even if it is sent to the t2i interface, this comma will be guaranteed Correctly preserved, thus correctly reproducing the original image.
There should be other specific solutions. I hope the author can greatly improve the function of the trailing comma here. Thank you!
@ligerye commented on GitHub (Feb 13, 2024):
感谢大大看到这里,期待该问题早日修复。

另外,我对该问题的临时办法是,手动在最后一个tag的内部加上一个逗号,而不是在外面增加,这样就将tag和逗号变为一个整体,就可以保证不会被自动删去了。
我也认为A方案是比较容易且符合直觉一些的(印证“去除Prompt最后的一个逗号”的功能描述);另外,看描述对于B的处理是增加监听提示词框的开关,是不是意味着关闭后会让tag后的空格也会一并不做处理呢?
最后祝大大龙年快乐!
@Issues-translate-bot commented on GitHub (Feb 13, 2024):
Thank you for seeing this. I hope this issue will be fixed soon.

In addition, my temporary solution to this problem is to manually add a comma inside the last tag instead of adding it outside. This way, the tag and the comma become a whole, which ensures that they will not be automatically deleted. .
I also think that solution A is easier and more intuitive (confirming the functional description of "removing the last comma in Prompt"); in addition, the description of the processing of B is to increase the switch of the listening prompt word box, does it mean to close it? Will the space after the tag not be processed at all?
Finally, I wish you a happy Year of the Dragon!
@Physton commented on GitHub (Feb 14, 2024):
A:这个已修复。
B:这个比较复杂一点,未来会开发。
@Issues-translate-bot commented on GitHub (Feb 14, 2024):
A: This has been fixed.
B: This is a bit more complicated and will be developed in the future.
@Physton commented on GitHub (Feb 14, 2024):
B: 已增加功能选项:是否自动加载webui提示词
@Issues-translate-bot commented on GitHub (Feb 14, 2024):
B: Function option has been added: whether to automatically load webui prompt words
@ligerye commented on GitHub (Feb 15, 2024):
经过实测问题已充分解决,A避免了尾缀逗号的产生,B可以便于读取和保留图中生成信息的原始格式。
最后再次感谢大大的辛苦付出!
@Issues-translate-bot commented on GitHub (Feb 15, 2024):
After actual measurement, the problem has been fully solved. A avoids the generation of trailing commas, and B can facilitate reading and retaining the original format of the information generated in the figure.
Finally, thank you again for your hard work!