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

Integrate Kandinsky diffusers pipeline #44

Closed
seruva19 opened this issue May 11, 2023 · 17 comments
Closed

Integrate Kandinsky diffusers pipeline #44

seruva19 opened this issue May 11, 2023 · 17 comments
Assignees
Labels
enhancement New feature or request

Comments

@seruva19
Copy link
Owner

seruva19 commented May 11, 2023

These wonderful folks have almost finished implementation of K2 in diffusers: https://www.github.com/huggingface/diffusers/pull/3308
That means I don't have to implement this on my own, which is great xD

To add it to app:

  1. https://github.com/seruva19/kubin/blob/master/src/models/model_kd2.py has to be modified to support processing of input params and dispatch them to diffusers pipeline instead of "native" Kandinsky2_1 model
  2. argument value "diffusers" for CLI argument "pipeline" wll be responsible for choosing diffusers implementation
  3. if diffusers implementation turns out to be more effective than native (and I think it will), "--pipeline=diffusers" will be set as default
@seruva19 seruva19 added the enhancement New feature or request label May 11, 2023
@seruva19 seruva19 changed the title integrate Kandinsky diffusers pipeline Integrate Kandinsky diffusers pipeline May 12, 2023
@seruva19 seruva19 self-assigned this May 13, 2023
@seruva19
Copy link
Owner Author

seruva19 commented May 28, 2023

They've done it.
https://huggingface.co/docs/diffusers/main/en/api/pipelines/kandinsky
https://huggingface.co/kandinsky-community
After 0.17 release of diffusers I will start integrating it into the app. I expect to benefit at least from memory and speed optimizations

@user425846
Copy link

user425846 commented May 29, 2023 via email

@shutter-cat
Copy link

Let's hope new optimizations make it work on 8 gb cards

@seruva19
Copy link
Owner Author

@user425846 I don't know yet. I hope to adapt diffusers implementation of LoRA. But I haven't got much experience with ML.

@adrianpuiu
Copy link
Contributor

@user425846 I don't know yet. I hope to adapt diffusers implementation of LoRA. But I haven't got much experience with ML.

do these guys have the scripts ready for diffusers ?

@seruva19
Copy link
Owner Author

seruva19 commented May 29, 2023

@adrianpuiu Yes, but only in preview version of diffusers. Follow the links I posted.

edit: I misunderstood you, thought you were talking about Kandinsky support in diffusers, not LoRA. Regarding LoRA, I believe generic algorithms they proposed for SD (https://huggingface.co/docs/diffusers/v0.13.0/en/training/lora) can be used (with some changes). I will to try to implement it. Later 🙂

@adrianpuiu
Copy link
Contributor

freaking hell they where fast. just finished reading their the t2i examples . I can't test it atm cause i have meetings with US about mid year priorities... freaking corporations ....but its good cause i work from home :))

@adrianpuiu
Copy link
Contributor

adrianpuiu commented May 29, 2023

well , clearly it's not implemented in the diffusers-0.16.1-py3-none-any.whl . https://github.com/huggingface/diffusers/tree/kandinsky

@user425846
Copy link

user425846 commented May 29, 2023 via email

@adrianpuiu
Copy link
Contributor

i got it going . thank you

@adrianpuiu
Copy link
Contributor

adrianpuiu commented May 29, 2023

@seruva19 not really good news .... diffusers eat up an (1) extra gigs of vram . buuttt, the good part is it clears the vram after each generation , compared with the older pipeline that keeps the gpu vram busy ... so, the main conclusion is , its better with diffuers .

How fast can you add it to kubin ? can we keep both pipelines and have end users choose between them ?

@seruva19
Copy link
Owner Author

seruva19 commented May 29, 2023

It won't replace old pipeline. As I wrote before,

argument value "diffusers" for CLI argument "pipeline" wll be responsible for choosing diffusers implementation

As for adding it to kubin, I haven't decided yet. First I planned to wait until 'stable' release of diffusers (0.17), but maybe I'll do it earlier.

edit: Also, i think it can be added pretty fast, like 1-2 days at max.

@adrianpuiu
Copy link
Contributor

my thinking is that having the diffuers added more devs will jump on the repo and help evolving it faster

@seruva19
Copy link
Owner Author

Either that, or someone will make better frontend for Kandinsky, so you guys won't be tied with my awkward GUI :)

@adrianpuiu
Copy link
Contributor

lol , man, what are you talking about :)) the front look is freaking better then a1111 . :D :D

@user425846
Copy link

user425846 commented May 29, 2023 via email

@seruva19
Copy link
Owner Author

I don't think so) But thanks anyway 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants