-
Notifications
You must be signed in to change notification settings - Fork 6k
[modular diffusers] more refactor #11235
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
Open
yiyixuxu
wants to merge
50
commits into
modular-diffusers
Choose a base branch
from
modular-refactor
base: modular-diffusers
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
* cfg; slg; pag; sdxl without controlnet * support sdxl controlnet * support controlnet union * update * update * cfg zero* * use unwrap_module for torch compiled modules * remove guider kwargs * remove commented code * remove old guider * fix slg bug * remove debug print * autoguidance * smoothed energy guidance * add note about seg * tangential cfg * cfg plus plus * support cfgpp in ddim * apply review suggestions * refactor * rename enable/disable * remove cfg++ for now * rename do_classifier_free_guidance->prepare_unconditional_embeds * remove unused
* cfg; slg; pag; sdxl without controlnet --------- Co-authored-by: Aryan <aryan@huggingface.co>
…oisee step to accept aditional contrlnet kwargs
…g *_controlnet_kwargs
…peline, and update so that intermediates_outputs are only new variables
…_from_config to just create and load method
…y if not specific names) 2. update acceept create spec 3. move the updte _componeent_spec logic outside register_components to each method that create/update the component: __init__/update/load
* update * update
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
continue #9672 here
Getting started with Modular diffusers
Guides on the basics
PipelineBlock
: notebookSequentialPipelineBlocks
: notebookLoopSequentialPipelineBlocks
: notebookComponentSpec
(coming soon, you can read here for now [modular diffusers] introducing ModularLoader #11462)ModularLoader
(coming soon, [modular diffusers] introducing ModularLoader #11462)Components Manager
AutoPipeline
Modular Repo
see an example of modular repo here https://huggingface.co/YiYiXu/modular-diffdiff/tree/main
it includes
remote pipeline blocks
you can load a pipeline block from hub with one line of code and mix-and-match it into your workflow
You can also load it directly into a
ModularNode
- diffusers abstraction to create UI nodesit comes with the node definition too
you can use it to make a mellon node like this
ModularNode is platform-agnostic, it will work with both comfy and mellon or whatever UI platform we support in the future. It will save a default node config, allow you to make changes and automatically convert it to usable module map in different platform (this is TO-DO but very doable!)
see an example of what we curreently have here
modular_model_index.json
You can pack all the relevant checkpoint for your workflow in
modular_model_index.json
, you can reference subfolders in other repos; it also work beyound diffusers and transformers, as long as it has afrom_pretrained
method that accept the standard loading arguments, subfolder, variance etc, for example, we used image_gen_aux here https://huggingface.co/YiYiXu/modular-depth-block/blob/main/block.pyTODO
__init__
of pipeline block, no longer do theself.component["vae"] = None
thingModularPipeline
, replaced it withModularPielineMixin
:- it is the base class for
PipelineBlock
,SequentialPipelines
andAutoPipelines
- it provides a
set_loader
method that creates a ModularLoader based on itsexpected_componeents
- it provides
run()
method to invoke the pipeline call (you can use it likeimages = node.run(prompt=...)
)LoopSequentialBlocks
: explore ways to make the denoise loop itself modular, i.e you can add/remove blocks inside the loop ([Modular diffusers] more refactors #11484)ModularLoader
] support partial loading/save for model componentsModularLoader
] should be able work with model_index.json tooDocumentation
_repr_
of various pipeline blocks and will further simplify, the goal is to make_repr_
concise and simple while move more detailed information onto@doc
propertyTesting
Custom code sharing
testing under this PR https://huggingface.co/YiYiXu/modular-diffdiff
UI Nodes
faster test script
(Click to expand)
slower testing script
(Click to expand)