Coder Social home page Coder Social logo

physton / sd-webui-prompt-all-in-one Goto Github PK

View Code? Open in Web Editor NEW
2.6K 2.6K 231.0 20.8 MB

This is an extension based on sd-webui, aimed at improving the user experience of the prompt/negative prompt input box. It has a more intuitive and powerful input interface function, and provides automatic translation, history record, and bookmarking functions. 这是一个基于 sd-webui 的扩展,旨在提高提示词/反向提示词输入框的使用体验。它拥有更直观、强大的输入界面功能,它提供了自动翻译、历史记录和收藏等功能。

Home Page: https://aiodoc.physton.com

License: MIT License

Python 38.68% HTML 0.03% Vue 22.88% JavaScript 12.52% Less 25.89%

sd-webui-prompt-all-in-one's Introduction

sd-webui-prompt-all-in-one's People

Contributors

actions-user avatar bluelovers avatar carlosmachina avatar kennytian avatar marcushsu avatar mutoe avatar physton avatar serick4126 avatar stimeke avatar strongshuai avatar thiagojramos avatar yangming915 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sd-webui-prompt-all-in-one's Issues

tag信息无法传送

在图片信息中,识别图片信息后,无法把图片信息传送到文生图、图生图等

求助!To create a public link, set `share=True` in `launch()`.

To create a public link, set share=True in launch().
Error executing callback app_started_callback for E:\ai\stable-diffusion-webui\extensions\sd-webui-prompt-all-in-one\scripts\on_app_started.py
Traceback (most recent call last):
File "E:\ai\stable-diffusion-webui\modules\script_callbacks.py", line 107, in app_started_callback
c.callback(demo, app)
File "E:\ai\stable-diffusion-webui\extensions\sd-webui-prompt-all-in-one\scripts\on_app_started.py", line 18, in on_app_started
hi = history()
File "E:\ai\stable-diffusion-webui\extensions\sd-webui-prompt-all-in-one\scripts\history.py", line 23, in init
self.histoies[type] = self.storage.get('history.' + type)
File "E:\ai\stable-diffusion-webui\extensions\sd-webui-prompt-all-in-one\scripts\storage.py", line 75, in get
return self.__get(key)
File "E:\ai\stable-diffusion-webui\extensions\sd-webui-prompt-all-in-one\scripts\storage.py", line 55, in get
data = json.load(f)
File "C:\Users\lin\AppData\Local\Programs\Python\Python310\lib\json_init
.py", line 293, in load
return loads(fp.read(),
File "C:\Users\lin\AppData\Local\Programs\Python\Python310\lib\json_init
.py", line 346, in loads
return _default_decoder.decode(s)
File "C:\Users\lin\AppData\Local\Programs\Python\Python310\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users\lin\AppData\Local\Programs\Python\Python310\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 10761 column 26 (char 331785)

这个扩展可以使用,但是cmd启动的时候一直会出现这个代码 我不知道是不是出错了

希望添加对换行、分隔符、分类的支持

当前版本打开提示词编辑后,会自动格式化提示词,所有换行都会被取消,但换行是唯一一种不影响token识别的分类、分段方式,希望后续版本中能加入提示词分段、自动识别换行、添加权重为0的分隔符的功能

尤其对于使用了latent couple的超长提示词,换行是必须的,甚至需要将AND单独作为一行分隔上下两段子提示词,不过对于现版本来说,使用从其他地方发送到页面的提示词时自动关闭插件功能确实非常实用,在分段功能实装之前请保留这个特性

localize I'm into English please

Love this tool! I have no idea what some of the UI elements say since it's in Chinese, is there a way to have the UI text in English?

Edit: nevermind found it, clicking on the globe icon switches languages, English and Klingon included!

Remove parenthesis when weight is 1

Hi,

When the weight is equal to 1, the prompt shows "(masterpiece:1)" instead of "masterpiece"
Doing like this also helps the prompt input to stay cleaner.

Thanks !

Avoid removing whitespace between prompts (trim)

Hello,

When the prompt input loses focus, the prompts currently changes from "masterpiece, best quality" to "masterpiece,best quality".
Doing like this helps improve prompt readablilty and leaves the user style unchanged.

Thanks !

安装插件后翻译需要设置API怎么办?

安装插件后翻译需要设置API,点击设置并没有弹出填写API的选项,没有一点反应,这个怎么处理?还有就是可以提供一个默认的翻译平台吗?现在相当于半成品,不能做到开箱即用体验,很麻烦就不想用了。希望能提供对应翻译平台的免费接口,如果有人需要单独设置API的话,也可以单独设置,这样体验更好

The keywords weight problem

Keyword weight can not be located to the second decimal point, will automatically round off,like the pixar stley model,it's have the trigger words:(pixarstyle:1.25), it automatically adjusts to (pixarstyle:1.3).

tencent cloud

Please remove this requirement. it does not install, and should not be installed.

Default value for numerical word weighting

The default numerical value is currently 0, which seems unusual because the default weighting is 1. So clicking on a plus sign expecting to get 1.1 instead returns 0.1.

解决:启动DecodeError 与 右上角code 404

1、控制台启动问题:
UnicodeDecodeError: 'gbk' codec can't decode byte 0xaf in position 3779: illegal multibyte sequence

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbb in position 702: invalid start byte
2、右上角code 404
image

原因:当使用手动安装的SD时候,没有上述问题;当在同样环境中使用绘世启动时,会产生上述问题。可能是双语插件等冲突。
解决:修改history.txt2img.json,history.img2img.json,history.img2img_neg.json等,由格式ANSI另存为UTF-8。

为什么不能设置谷歌翻译的国内镜像?像“划词翻译”插件里那样?

我去找到主目录下的 translate_apis.json

打开后添加了一个谷歌镜像进去,或者直接修改了里面的 Google 那个美国的 URL,保存后重启了但是还是不能用镜像来翻译啊!

参见我这里对沉浸式翻译的提问:
immersive-translate/immersive-translate#307

得到了很好的解决,划词翻译那个插件里也是可以设置镜像的。

不知道大佬您的插件怎么玩转这样的国内谷歌翻译镜像?很想用啊!:)

负面提示词部分会有一点问题

昨天做了个什么操作我已经忘了, 大概是一下复制了非常多的提示词, 然后点击AB, EN,然后负面提示词的翻译栏就失效了。之后无论怎么重启都不会翻译负面提示词了。 请作者看看问题的原因。

Pasting Has Issues

Would you please make it able paste like classic webui, in both txt2image and image2image interfaces?

重新启动webUI时,插件初始化时出现解析不了历史JSON的问题,以及右上角code 404的解决

1、控制台启动问题:
UnicodeDecodeError: 'gbk' codec can't decode byte 0xaf in position 3779: illegal multibyte sequence

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbb in position 702: invalid start byte
2、右上角code 404
image

原因:当使用手动安装的SD时候,没有上述问题;当在同样环境中使用绘世启动时,会产生上述问题。可能是双语插件等冲突。
解决:修改history.txt2img.json,history.img2img.json,history.img2img_neg.json等,由格式ANSI另存为UTF-8。

Error during startup

API error: GET: http://<REDACTED>:7860/physton_prompt/get_extension_css_list {'error': 'UnicodeDecodeError', 'detail': '', 'body': '', 'errors': "'charmap' codec can't decode byte 0x8d in position 88: character maps to <undefined>"}
╭───────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────╮
│ G:\stable-diffusion-webui\venv\lib\site-packages\anyio\streams\memory.py:94 in receive                               │
│                                                                                                                      │
│ G:\stable-diffusion-webui\venv\lib\site-packages\anyio\streams\memory.py:89 in receive_nowait                        │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
WouldBlock

During handling of the above exception, another exception occurred:

╭───────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────╮
│ G:\stable-diffusion-webui\venv\lib\site-packages\starlette\middleware\base.py:78 in call_next                        │
│                                                                                                                      │
│ G:\stable-diffusion-webui\venv\lib\site-packages\anyio\streams\memory.py:114 in receive                              │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
EndOfStream

During handling of the above exception, another exception occurred:

╭───────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────╮
│ G:\stable-diffusion-webui\modules\api\api.py:145 in exception_handling                                               │
│                                                                                                                      │
│   144 │   │   try:                                                                                                   │
│ ❱ 145 │   │   │   return await call_next(request)                                                                    │
│   146 │   │   except Exception as e:                                                                                 │
│                                                                                                                      │
│ ╭───────────────────────────────────────────────────── locals ─────────────────────────────────────────────────────╮ │
│ │        call_next = <function BaseHTTPMiddleware.__call__.<locals>.call_next at 0x00000179768FEDD0>               │ │
│ │                e = UnicodeDecodeError('charmap', b'{\r\n  "name": "The keyword input box is 100% width",\r\n     │ │
│ │                    "i18n": {\r\n    "zh_CN":                                                                     │ │
│ │                    "\xe5\x85\xb3\xe9\x94\xae\xe8\xaf\x8d\xe8\xbe\x93\xe5\x85\xa5\xe6\xa1\x86100%\xe5\xae\xbd\xe… │ │
│ │                    "zh_HK":                                                                                      │ │
│ │                    "\xe9\x97\x9c\xe9\x8d\xb5\xe8\xa9\x9e\xe8\xbc\xb8\xe5\x85\xa5\xe6\xa1\x86\xe6\x93\x81\xe6\x9… │ │
│ │                    "zh_TW":                                                                                      │ │
│ │                    "\xe9\x97\x9c\xe9\x8d\xb5\xe5\xad\x97\xe8\xbc\xb8\xe5\x85\xa5\xe6\xa1\x86\xe4\xbd\x94\xe6\x9… │ │
│ │                    },\r\n  "author": "Physton"\r\n}', 88, 89, 'character maps to <undefined>')                   │ │
│ │ handle_exception = <function api_middleware.<locals>.handle_exception at 0x00000179764CDB40>                     │ │
│ │          request = <starlette.requests.Request object at 0x00000179769CA290>                                     │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                                      │
│ G:\stable-diffusion-webui\venv\lib\site-packages\starlette\middleware\base.py:84 in call_next                        │
│                                                                                                                      │
│                                               ... 18 frames hidden ...                                               │
│                                                                                                                      │
│ G:\stable-diffusion-webui\extensions\sd-webui-prompt-all-in-one\scripts\styles.py:36 in getExtensionCssList          │
│                                                                                                                      │
│   35 │   │   with open(manifest_path, 'r') as f:                                                                     │
│ ❱ 36 │   │   │   manifest = f.read()                                                                                 │
│   37 │   │   if not manifest:                                                                                        │
│                                                                                                                      │
│ ╭───────────────────────────────────────────────────── locals ─────────────────────────────────────────────────────╮ │
│ │       css_list = []                                                                                              │ │
│ │            dir = 'full-input'                                                                                    │ │
│ │       dir_path = 'G:\\stable-diffusion-webui\\extensions\\sd-webui-prompt-all-in-one\\styles\\extension'+12      │ │
│ │ extension_path = 'G:\\stable-diffusion-webui\\extensions\\sd-webui-prompt-all-in-one\\styles\\extension'+1       │ │
│ │              f = <_io.TextIOWrapper                                                                              │ │
│ │                  name='G:\\stable-diffusion-webui\\extensions\\sd-webui-prompt-all-in-one\\styles\\extensions\\… │ │
│ │                  mode='r' encoding='cp1252'>                                                                     │ │
│ │       manifest = None                                                                                            │ │
│ │  manifest_path = 'G:\\stable-diffusion-webui\\extensions\\sd-webui-prompt-all-in-one\\styles\\extension'+26      │ │
│ │     style_path = 'G:\\stable-diffusion-webui\\extensions\\sd-webui-prompt-all-in-one\\styles\\extension'+26      │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                                      │
│ C:\Python310\lib\encodings\cp1252.py:23 in decode                                                                    │
│                                                                                                                      │
│    22 │   def decode(self, input, final=False):                                                                      │
│ ❱  23 │   │   return codecs.charmap_decode(input,self.errors,decoding_table)[0]                                      │
│    24                                                                                                                │
│                                                                                                                      │
│ ╭─────────────────────────────────────────────── locals ────────────────────────────────────────────────╮            │
│ │ final = True                                                                                          │            │
│ │ input = b'{\r\n  "name": "The keyword input box is 100% width",\r\n  "i18n": {\r\n    "zh_CN": "'+165 │            │
│ │  self = <encodings.cp1252.IncrementalDecoder object at 0x00000179768CEFB0>                            │            │
│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────╯            │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d in position 88: character maps to <undefined>

当历史记录包含中文字符时,重新启动webUI时,插件初始化时出现解析不了历史JSON的问题

1.当历史记录包含中文字符时
2.重新启动webUI时
3.插件初始化时出现解析不了历史JSON的问题

Log 如下:

Error executing callback app_started_callback for F:_DEV\AUTOMATIC1111\stable-diffusion-webui\extensions\sd-webui-prompt-all-in-one\scripts\on_app_started.py
Traceback (most recent call last):
File "F:_DEV\AUTOMATIC1111\stable-diffusion-webui\modules\script_callbacks.py", line 108, in app_started_callback
c.callback(demo, app)
File "F:_DEV\AUTOMATIC1111\stable-diffusion-webui\extensions\sd-webui-prompt-all-in-one\scripts\on_app_started.py", line 18, in on_app_started
hi = history()
File "F:_DEV\AUTOMATIC1111\stable-diffusion-webui\extensions\sd-webui-prompt-all-in-one\scripts\history.py", line 23, in init
self.histoies[type] = self.storage.get('history.' + type)
File "F:_DEV\AUTOMATIC1111\stable-diffusion-webui\extensions\sd-webui-prompt-all-in-one\scripts\storage.py", line 75, in get
return self.__get(key)
File "F:_DEV\AUTOMATIC1111\stable-diffusion-webui\extensions\sd-webui-prompt-all-in-one\scripts\storage.py", line 55, in _get
data = json.load(f)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\json_init
.py", line 293, in load
return loads(fp.read(),
UnicodeDecodeError: 'gbk' codec can't decode byte 0xaf in position 3779: illegal multibyte sequence

【功能请求】希望可以添加设置折叠内容 与 隐藏WebUI输入框的设置

如果设置了ui-config.json 的一些默认设置时,打开页面时会有比较大的占比
如图所示:
image

希望可以添加设置某个输入框默认是打开还是关闭的设置。
1.显示/折叠内容【正向词与否定词分别设置】
2.开启WebUI输入框设置【同上】

希望的效果是打开页面后是这样子的效果:
image

Issues with adding/editing words

If I write a new words in the normal prompt window (not in your extension), it automatically gets moved to the last position when clicking generate, instead of staying in the position I put them in.

If I left click within the extension to change the word, it does not update it in the normal prompt window.

Embedding 输入问题

在默认输入框隐藏的时候,点击Embedding模型只会激活到正向提示框,即使先把光标放到负向提示框也不起作用,要把默认的负向提示词输入框打开,并且把光标放到默认输入框才能正常输入,为了界面简洁我会选择隐藏默认提示词输入框,希望能解决这个问题,谢谢。
截屏2023-05-20 13 08 41

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.