new-sankaku / stable-diffusion-webui-simple-manga-maker

It is an Extension feature used in the WebUI for Stable Diffusion. You can create simple comics with it.
https://new-sankaku.github.io/SP-MangaEditer/
GNU General Public License v3.0
44 stars 5 forks source link

Barebones implementation of comfyui #28

Closed fylrid2 closed 1 week ago

fylrid2 commented 2 weeks ago

image

This PR adds the possibility of generating images using Comfyui as an API instead of A1111. When clicking on the "SD webui" button up to the left there will be two buttons to chose your API mode. Choosing either one will hide irrelevant elements and show the relevant ones. This implementation should have zero impact on A1111 generation or any other features. In this menu the user should also choose what workflow they wanna use, I have added a sample workflow to the repo that has all placeholders in place. Available placeholders at the moment are the following:

However at this stage a lot of features are missing and there are definietly some improvements that could be made.

Current missing features compared A1111

Clear improvements that could be made moving forward

I left some "TODO" comments in the code aswell that could be looked at.

Chat GPT Translation

このPRは、A1111の代わりにComfyuiをAPIとして使用して画像を生成する機能を追加します。左上の「SD webui」ボタンをクリックすると、APIモードを選択するための2つのボタンが表示されます。どちらかを選択すると、関連のない要素が非表示になり、関連する要素が表示されます。この実装は、A1111の生成や他の機能に全く影響を与えないはずです。このメニューでは、ユーザーが使用するワークフローを選択する必要もあり、リポジトリにすべてのプレースホルダーが配置されたサンプルワークフローを追加しました。現在利用可能なプレースホルダーは以下の通りです:

A1111と比較して現在欠けている機能

コードには「TODO」コメントもいくつか残してあるので、そちらも確認してください。

fylrid2 commented 2 weeks ago

Forgot to mention in the post but there is no support for loras currently as comfyui doesn't allow loras in text, this should be high priority to fix I think. Shouldn't be too dificult is just mostly the logistics and the UX of it that can be an issue.

new-sankaku commented 2 weeks ago

Thank you! ComfyUI is indeed quite challenging... I'll take a look at everything and aim to merge it. I think I can manage to do it by this weekend.

I plan to make a few minor changes:

I believe the model list can be implemented with the following: Model: http://127.0.0.1:8188/object_info/CheckpointLoaderSimple Sampling Method: http://127.0.0.1:8188/object_info/KSampler There are other things that could be fetched, but I will leave them for now:

Lora: http://127.0.0.1:8188/object_info/LoraLoader

UpscaleModel: http://127.0.0.1:8188/object_info/UpscaleModelLoader

VAELoader: http://127.0.0.1:8188/object_info/VAELoader

Embeddings: http://127.0.0.1:8188/embeddings

I will try to make the toggle button for switching SD WebUI mode more intuitive.

Instead of hiding the API host and port when switching UIs, I will display them with clear labels to avoid confusion.

For the online/offline status in Information Control, since ComfyUI does not have a ping feature, I will send a request to Settings (http://127.0.0.1:8188/settings) to pseudo-check the online status.

Thank you very much for your cooperation!

fylrid2 commented 2 weeks ago

Good luck with my spaghetti code!

And wow I looked through the comfyui api end points multiple times but I managed to miss the object_info route, well now I feel dumb haha.

new-sankaku commented 1 week ago

I'm still working on the ComfyUI features, but I'll accept the PR and hide the features for now. I've made it possible to load models, but I failed to generate images, so I'll try to make it a bit more user-friendly.

Thanks for the pull request!