Git Product home page Git Product logo

sdweb-eagle-pnginfo's Introduction

Hi, I'm bbc_mc (a.k.a bbc-mc on github)

Github Stats top-langs

trophy

sdweb-eagle-pnginfo's People

Contributors

bbc-mc avatar blue-pen5805 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

Watchers

 avatar  avatar  avatar  avatar

sdweb-eagle-pnginfo's Issues

Is it possible to use eagle in Colab?

Is it possible to use eagle in Colab?

I checked the "Send all images to Eagle" checkbox, but Stable Diffusion images linked to Google Drive are not saved to eagle.

モデル名の取得もとについて

素敵なエクステンションをありがとうございます。
最近、SDXLの登場もあり、モデルを階層化するようになりました。
例えばmodels/Stable-diffusionに「XL」「SD1.5」というフォルダを作り、
Additinal tag patternに「Model」を指定して生成すると、Eagleでは
「Model: フォルダ名_モデルファイル名」というタグになります。
Save Generation info as Annotationがtrueの時のEagleのメモでは
「 Model: モデルファイル名」となっています。
現行使用は担保しつつ、Additinal tag patternに「Model_filename」のような
新たなパターン名を追加して、純粋なファイル名のみをタグ付けできるような
エンハンスは可能でしょうか?

image
image

[Feature Request]

Hello, would you be able to add a feature to this to scan all AI images in a pre-existing folder and then add their corresponding tags to eagle?

Can this plugin be used in Google Colab Notebook?

I received the following error when I ran the image generation in Google colab.
Is it not possible to use Google Colab?

Error executing callback image_saved_callback for /content/stable-diffusion-webui/extensions/sdweb-eagle-pnginfo/scripts/eagle-pnginfo.py Traceback (most recent call last): File "/usr/local/lib/python3.9/dist-packages/urllib3/connection.py", line 174, in _new_conn conn = connection.create_connection( File "/usr/local/lib/python3.9/dist-packages/urllib3/util/connection.py", line 95, in create_connection raise err File "/usr/local/lib/python3.9/dist-packages/urllib3/util/connection.py", line 85, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 111] Connection refused During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.9/dist-packages/urllib3/connectionpool.py", line 703, in urlopen httplib_response = self._make_request( File "/usr/local/lib/python3.9/dist-packages/urllib3/connectionpool.py", line 398, in _make_request conn.request(method, url, **httplib_request_kw) File "/usr/local/lib/python3.9/dist-packages/urllib3/connection.py", line 244, in request super(HTTPConnection, self).request(method, url, body=body, headers=headers) File "/usr/lib/python3.9/http/client.py", line 1285, in request self._send_request(method, url, body, headers, encode_chunked) File "/usr/lib/python3.9/http/client.py", line 1331, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/usr/lib/python3.9/http/client.py", line 1280, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/usr/lib/python3.9/http/client.py", line 1040, in _send_output self.send(msg) File "/usr/lib/python3.9/http/client.py", line 980, in send self.connect() File "/usr/local/lib/python3.9/dist-packages/urllib3/connection.py", line 205, in connect conn = self._new_conn() File "/usr/local/lib/python3.9/dist-packages/urllib3/connection.py", line 186, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 111] Connection refused During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.9/dist-packages/requests/adapters.py", line 439, in send resp = conn.urlopen( File "/usr/local/lib/python3.9/dist-packages/urllib3/connectionpool.py", line 787, in urlopen retries = retries.increment( File "/usr/local/lib/python3.9/dist-packages/urllib3/util/retry.py", line 592, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=41595): Max retries exceeded with url: /api/folder/list (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/content/stable-diffusion-webui/modules/script_callbacks.py", line 159, in image_saved_callback c.callback(params) File "/content/stable-diffusion-webui/extensions/sdweb-eagle-pnginfo/scripts/eagle-pnginfo.py", line 102, in on_image_saved folderId = _get_folderId(http://shared.opts.save_to_eagle_folderid, shared.opts.allow_to_create_folder_on_eagle) File "/content/stable-diffusion-webui/extensions/sdweb-eagle-pnginfo/scripts/eagle-pnginfo.py", line 72, in _get_folderId _ret = api_util.find_or_create_folder(folder_name_or_id, allow_create_new_folder, server_url, port) File "/content/stable-diffusion-webui/extensions/sdweb-eagle-pnginfo/scripts/eagleapi/api_util.py", line 94, in find_or_create_folder _ret_folder_list = api_folder.list(server_url=server_url, port=port, timeout_connect=timeout_connect, timeout_read=timeout_read) File "/content/stable-diffusion-webui/extensions/sdweb-eagle-pnginfo/scripts/eagleapi/api_folder.py", line 65, in list r_get = requests.get(API_URL, timeout=(timeout_connect, timeout_read)) File "/usr/local/lib/python3.9/dist-packages/requests/api.py", line 76, in get return request('get', url, params=params, **kwargs) File "/usr/local/lib/python3.9/dist-packages/requests/api.py", line 61, in request return session.request(method=method, url=url, **kwargs) File "/usr/local/lib/python3.9/dist-packages/requests/sessions.py", line 542, in request resp = self.send(prep, **send_kwargs) File "/usr/local/lib/python3.9/dist-packages/requests/sessions.py", line 655, in send r = adapter.send(request, **kwargs) File "/usr/local/lib/python3.9/dist-packages/requests/adapters.py", line 516, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=41595): Max retries exceeded with url: /api/folder/list (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused'))

Extrasタブで画像をアップスケールした時にエラー

アップスケールした画像には、promptなどの情報が含まれていないので不具合を起こしているように思います。
以下、エラー時のトレースバックです。

webui-docker-auto-1 | Traceback (most recent call last):
webui-docker-auto-1 | File "/stable-diffusion-webui/modules/script_callbacks.py", line 159, in image_saved_callback
webui-docker-auto-1 | c.callback(params)
webui-docker-auto-1 | File "/stable-diffusion-webui/extensions/sdweb-eagle-pnginfo/scripts/eagle-pnginfo.py", line 49, in on_image_saved
webui-docker-auto-1 | pos_prompt = params.p.prompt
webui-docker-auto-1 | AttributeError: 'NoneType' object has no attribute 'prompt'

tag_generator.pyで存在しないattributeを参照してエラーが発生

エラー内容

  • 画像を生成してEagleにタグを転送する際に以下のようなエラーが認められました。
module 'modules.shared' has no attribute 'loaded_hypernetwork'
module 'modules.shared' has no attribute 'loaded_hypernetwork'
'KDiffusionSampler' object has no attribute 'default_eta'

実行環境

  • Stable Diffusion web UI: v1.5.1-6-g38b56ab9
  • python: 3.10.6
  • torch: 2.0.1+cu118
  • xformers: 0.0.20
  • gradio: 3.32.0

修正方針

  • エラーが出現してる箇所に対しても下記コードのように、get_attr(...) を利用して安全に値を取得するのが良さそうです

"Model hash": lambda self: getattr(self.p, 'sd_model_hash', None if not shared.opts.add_model_hash_to_info or not shared.sd_model.sd_model_hash else shared.sd_model.sd_model_hash),

修正コード

  • 以下の修正を実施し、エラーがなくなったことを確認しました
  • 問題なければ取り込みをご検討頂ければと思います
- "Hypernet": lambda self: (None if shared.loaded_hypernetwork is None else shared.loaded_hypernetwork.name),
+ "Hypernet": lambda self: (None if getattr(shared, 'loaded_hypernetwork', None) is None else getattr(shared.loaded_hypernetwork, 'name', None)),

- "Hypernet strength": lambda self: (None if shared.loaded_hypernetwork is None or shared.opts.sd_hypernetwork_strength >= 1 else shared.opts.sd_hypernetwork_strength),
+ "Hypernet strength": lambda self: (None if getattr(shared, 'loaded_hypernetwork', None) is None or shared.opts.sd_hypernetwork_strength >= 1 else shared.opts.sd_hypernetwork_strength),

- "Eta": lambda self: (None if self.p.sampler is None or self.p.sampler.eta == self.p.sampler.default_eta else self.p.sampler.eta),
+ "Eta": lambda self: (None if self.p.sampler is None or self.p.sampler.eta == getattr(self.p.sampler, 'default_eta', None) else self.p.sampler.eta),

提案

  • おそらく、今後のAutomatic1111のアップデート次第で、他の箇所でも連携されないattributeが出てくると思います
  • 全体的に shared から値を取得する際には存在チェックをしてから取得するのがベターかと思います

Eagleに記録されるタグとメモ欄でpromptの内容に違いがある

https://github.com/adieyal/sd-dynamic-prompts
Dynamic Promptsを使用している前提での話になり恐縮ですが、
promptに __seasons__ と入力している場合、期待される出力結果としては {summer|winter|autumn|spring} のいずれかになります。
これが例えばsummerで生成された場合、メモ欄には summer と記録されますがタグ覧では __seasons__ で記録されます。
promptの取得先に差があるようですが、これを summer に統一する事は可能でしょうか?

他の拡張機能の影響による話のため対応する義務はなく、検討のみ頂けると幸いです。

設定:
Send all image to Eagle: checked
Save Generation info as Annotation: checked
Save positive prompt to Eagle as tags: checked
Save negative prompt as: None
Additinal tag pattern: Model

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.