Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for ComfyUI #384

Merged
merged 30 commits into from
Apr 21, 2023
Merged

Support for ComfyUI #384

merged 30 commits into from
Apr 21, 2023

Conversation

PassiveLemon
Copy link
Contributor

@PassiveLemon PassiveLemon commented Apr 2, 2023

As discussed in Discussion #367, this adds support for the newer ComfyUI. I forked the fork that would already add this but the maintainer of that fork hasn't implemented the changes needed to properly get the output function working, which I did. I believe everything is functional though I have not tested every single node.

I changed the table format for the README and a few other minor things for aesthetic reasons but if you want me to revert those, I will.

@PassiveLemon PassiveLemon changed the title Support for Comfyui Support for ComfyUI Apr 2, 2023
@AbdBarho
Copy link
Owner

AbdBarho commented Apr 3, 2023

Thank you, I unfortunately don't have time now to test this thoroughly, I will try to have it tested by the end of the week.

We would need to think about the folder hierarchy and try to not create new subfolders for every ui, otherwise we cannot re-use anything.

I still have to check the license stuff as mentioned in #367

it would be great if the changes were constrained to the comfy UI and only whats necessary in docker-compose.

The readme formatting could be reverted, it was like this because of a vscode extension I use.

@PassiveLemon
Copy link
Contributor Author

Understood, I reverted all unnecessary changes to the code that doesn't affect anything. About the folder hierarchy, aren't the build scripts for each UI completely different anyways? I feel like it would be more of a hassle than its worth to try to make things reusable.

@PassiveLemon
Copy link
Contributor Author

Unless you mean something like a master Dockerfile that can manage the similarities between the containers like the Pip packages but then also pass control to the individuals that manage the more UI specific configuration.

@AbdBarho
Copy link
Owner

AbdBarho commented Apr 3, 2023

Oh, by "re-using" I meant the actual models, since these are usually very large, it is redundant to re-download or copy them to every UI folder. Even though it would be the easiest solution.

@PassiveLemon
Copy link
Contributor Author

I'm still slightly confused. Is there something that I need to change with this PR or is it suggesting something that could be worked on to provide compatibility between all UIs? This profile will use the same file structure as the others and symlink them to their appropriate locations in the container

@AbdBarho
Copy link
Owner

AbdBarho commented Apr 3, 2023

I am kind of referring to this:

MOUNTS["${ROOT}/models/clip_vision"]="/data/comfy/clip_vision"
MOUNTS["${ROOT}/models/controlnet"]="/data/config/auto/extensions/sd-webui-controlnet/models"
MOUNTS["${ROOT}/models/style_models"]="/data/comfy/style_models"
MOUNTS["${ROOT}/models/t2i_adapter"]="/data/comfy/t2i_adapter"

but don't worry, this is not your problem, this is a more general architecture question regarding this repo.

@PassiveLemon
Copy link
Contributor Author

Oh I believe those are functions specific to ComfyUI so they are in their own directory to avoid confusion with the other UIs. As for this repo, let me know if you would like any help. I'm pretty much free for the next week or so.


RUN --mount=type=cache,target=/root/.cache/pip pip install torch==1.13.0 torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu117

RUN apt update && apt install -y git && apt clean
Copy link

@gocom gocom Apr 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May want to use/keep apt-get instead of apt. apt is an user-facing UI for apt-get and it's siblings, that isn't mean for scripts. From apt's man page (man apt):

SCRIPT USAGE AND DIFFERENCES FROM OTHER APT TOOLS
       The apt(8) commandline is designed as an end-user tool and it may
       change behavior between versions. While it tries not to break backward
       compatibility this is not guaranteed either if a change seems
       beneficial for interactive use.

       All features of apt(8) are available in dedicated APT tools like apt-
       get(8) and apt-cache(8) as well.  apt(8) just changes the default value
       of some options (see apt.conf(5) and specifically the Binary scope). So
       you should prefer using these commands (potentially with some
       additional options enabled) in your scripts as they keep backward
       compatibility as much as possible. 

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't know there was a difference in them. Since apt-get seems more suited for this, I switch back over to that. Thanks for that

Merges the new changes from the master with some modifications to make Comfy follow the OCI compliance
This reverts commit 55d0591.
This reverts commit 4d05480.
I forgot that I merged the main files so those would show up in the edits. This should have fixed that
@PassiveLemon
Copy link
Contributor Author

I have updated this to match the latest commits OCI compliance. I based most of it off of the Sygil service since it is the most similar in terms of structure.

@LEv145
Copy link
Contributor

LEv145 commented Apr 18, 2023

You can add AMD, CPU, AMD6600 support like here:
comfyanonymous/ComfyUI#190

@r7l
Copy link

r7l commented Apr 18, 2023

I've tried the Dockerfile and it blends in perfectly into this project.

As a suggestion: Quote the echo statement in entrypoint.sh.

The downside with comfy is that there isn't a plugin manager yet and lots of custom nodes would require additional git pull and pip install commands and such.

@PassiveLemon
Copy link
Contributor Author

You can add AMD, CPU, AMD6600 support like here: comfyanonymous/ComfyUI#190

I'll let AbdBarho decide if and how this gets added as there are currently plans to organize stuff a little better.

I've tried the Dockerfile and it blends in perfectly into this project.

As a suggestion: Quote the echo statement in entrypoint.sh.

The downside with comfy is that there isn't a plugin manager yet and lots of custom nodes would require additional git pull and pip install commands and such.

All of the other profiles have the same echo command and it doesn't appear to cause any problems so I'll leave it as is. As for the custom nodes, I couldn't find any mention of git or pip so I am unsure if something will need to be done. I will have to think of a way to get that sorted if they do require external commands though.

@AbdBarho
Copy link
Owner

Hey! sorry for not being active, I am currently changing jobs so time is a bit tight, I will try to get to this in the evening today to do some initial testing.

You can add AMD, CPU, AMD6600 support like here:
comfyanonymous/ComfyUI#190

That is really great, maybe we need some testers since I don't have an AMD GPU.

The downside with comfy is that there isn't a plugin manager yet and lots of custom nodes would require additional git pull and pip install commands and such.

Maybe we can consider a startup.sh script similar to auto where you can do all of the magic there?

@AbdBarho AbdBarho mentioned this pull request Apr 19, 2023
@PassiveLemon
Copy link
Contributor Author

That is really great, maybe we need some testers since I don't have an AMD GPU.

How would you want this implemented? I'm thinking profiles like for auto-cpu but I don't want to crowd the compose file with 4 profiles for 1 UI.

Test 1 variables:
 - 3060 Ti
 - 20 steps
 - 7.5 cfg
 - euler_a
 - 4x 512x512

Test 1:
Without:
16.43, 15.98, 15.59 - About 49 seconds total for 3 runs.
With Xformers:
10.39, 10.22, 10.64 - About 30 seconds total for 3 runs.

About 1.6x faster with Xformers
--------------------
Test 2 variables:
 - 3060 Ti
 - 20 steps
 - 7.5 cfg
 - euler_a
 - 4x 1024x512

Test 1:
Without Xformers:
53.25, 54.23, 53.53 - About 2.6 minutes total for 3 runs.

With Xformers:
20.06, 20.42, 20.47 - About 1 minute total for 3 runs.

About 2.6x faster with Xformers!!
@PassiveLemon
Copy link
Contributor Author

Added support for Xformers (I ripped it from auto). Very good improvements in performance depending on image size. Details in the 'Xformers' commit.

@AbdBarho
Copy link
Owner

@PassiveLemon can you please allow to push into your branch? I want to do some final changes and merge this.

@PassiveLemon
Copy link
Contributor Author

I invited you as a collaborator

@AbdBarho
Copy link
Owner

AbdBarho commented Apr 21, 2023

@PassiveLemon thank you for this PR

Would be great if you have any other improvements, we can always add them in other PRs!

@PassiveLemon
Copy link
Contributor Author

I will try to help maintain this profile as Comfy is still very active and updated multiple times a day

Jordan-Lambda pushed a commit to Jordan-Lambda/lambda-cloud-stable-diffusion-2.0-webui-easy that referenced this pull request Aug 2, 2023
As discussed in Discussion
[AbdBarho#367](AbdBarho#367),
this adds support for the newer ComfyUI. I forked the fork that would
already add this but the maintainer of that fork hasn't implemented the
changes needed to properly get the output function working, which I did.
I believe everything is functional though I have not tested every single
node.

I changed the table format for the README and a few other minor things
for aesthetic reasons but if you want me to revert those, I will.

---------

Co-authored-by: Jonathan Kovacs <jkovacs-dev@users.noreply.github.com>
Co-authored-by: AbdBarho <ka70911@gmail.com>
cloudaxes pushed a commit to cloudaxes/stable-diffusion-webui-docker that referenced this pull request Sep 6, 2023
As discussed in Discussion
[AbdBarho#367](AbdBarho#367),
this adds support for the newer ComfyUI. I forked the fork that would
already add this but the maintainer of that fork hasn't implemented the
changes needed to properly get the output function working, which I did.
I believe everything is functional though I have not tested every single
node.

I changed the table format for the README and a few other minor things
for aesthetic reasons but if you want me to revert those, I will.

---------

Co-authored-by: Jonathan Kovacs <jkovacs-dev@users.noreply.github.com>
Co-authored-by: AbdBarho <ka70911@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants