-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Add a ControlNet model & pipeline #2407
Merged
Merged
Changes from 1 commit
Commits
Show all changes
135 commits
Select commit
Hold shift + click to select a range
6123837
add scaffold
takuma104 d382f93
Add support to load ControlNet (WIP)
takuma104 04a514a
Update to convert ControlNet without error msg
takuma104 1f4b706
cleanup of commented out
takuma104 25eb4e7
split create_controlnet_diffusers_config()
takuma104 a7cb5a2
Add input_hint_block, input_zero_conv and
takuma104 148b46d
add unet_2d_blocks_controlnet.py
takuma104 584edfd
Add loading for input_hint_block, zero_convs
takuma104 0f9781c
Copy from UNet2DConditionalModel except __init__
takuma104 0327e73
Add ultra primitive test for ControlNetModel
takuma104 e5cabdf
Support ControlNetModel inference
takuma104 1fc01a3
copy forward() from UNet2DConditionModel
takuma104 cb7bb9a
Impl ControlledUNet2DConditionModel inference
takuma104 87ed105
Frozen weight & biases for training
takuma104 efccecc
Minimized version of ControlNet/ControlledUnet
takuma104 a838366
make style
takuma104 a296de9
Add support model loading for minimized ver
takuma104 bd51c6d
Remove all previous version files
takuma104 7656925
from_pretrained and inference test passed
takuma104 839e009
copied from pipeline_stable_diffusion.py
takuma104 cf16a43
Impl pipeline, pixel match test (almost) passed.
takuma104 ce0e571
Merge branch 'main' into controlnet
takuma104 9cc8b99
make style
takuma104 7dbbe22
make fix-copies
takuma104 a316d86
Fix to add import ControlNet blocks
takuma104 b17fd20
Remove einops dependency
takuma104 894bd84
Support np.ndarray, PIL.Image for controlnet_hint
takuma104 3d3a02f
set default config file as lllyasviel's
takuma104 38bf48d
Add support grayscale (hw) numpy array
takuma104 cc597a1
Add and update docstrings
takuma104 4bcc159
add control_net.mdx
takuma104 33841b6
add control_net.mdx to toctree
takuma104 9a37409
Update copyright year
takuma104 0a1bb45
Fix to add PIL.Image RGB->BGR conversion
takuma104 90d05e9
make fix-copies
takuma104 189f46f
Merge branch 'huggingface:main' into controlnet
takuma104 3ade8c0
add basic fast test for controlnet
takuma104 d5965c7
add slow test for controlnet/unet
takuma104 79c0ecb
Ignore down/up_block len check on ControlNet
takuma104 04f9b8a
add a copy from test_stable_diffusion.py
takuma104 fe82f10
Accept controlnet_hint is None
takuma104 1c7d311
merge pipeline_stable_diffusion.py diff
takuma104 e492e9d
Update class name to SDControlNetPipeline
takuma104 2eab486
make style
takuma104 faf1cfb
Baseline fast test almost passed (w long desc)
takuma104 f656952
Add note comment related vae_scale_factor
takuma104 6300a52
add test_stable_diffusion_controlnet_ddim
takuma104 bac69f1
add assertion for vae_scale_factor != 8
takuma104 4f394a8
slow test of pipeline almost passed
takuma104 2b0f04b
test_stable_diffusion_long_prompt passed
takuma104 c6c7312
test_stable_diffusion_no_safety_checker passed
takuma104 bd5d7b7
remove PoC test files
takuma104 2c0d4d4
Merge branch 'main' into will/controlnet
williamberman 808376c
fix num_of_image, prompt length issue add add test
takuma104 cd85086
add support List[PIL.Image] for controlnet_hint
takuma104 e376edb
wip
williamberman 19be7e6
Merge remote-tracking branch 'will_diffusers/will/controlnet' into co…
takuma104 b74ef10
all slow test passed
takuma104 b8e689e
make style
takuma104 2d8cca1
update for slow test
takuma104 0f70cf5
RGB(PIL)->BGR(ctrlnet) conversion
takuma104 91623a9
fixes
williamberman 855580d
remove manual num_images_per_prompt test
williamberman e758682
Merge branch 'main' into controlnet
williamberman 788e03d
add document
takuma104 42ebc45
add `image` argument docstring
takuma104 8bb964d
make style
takuma104 49024f6
Add line to correct conversion
takuma104 30f7570
add controlnet_conditioning_scale (aka control_scales
williamberman e169f32
rgb channel ordering by default
williamberman e1b8b49
image batching logic
williamberman 2953f9f
Merge branch 'main' into controlnet
williamberman f5cd24a
Add control image descriptions for each checkpoint
takuma104 1a02798
Merge branch 'main' into controlnet
williamberman 8f01ca1
Only save controlnet model in conversion script
williamberman ca4378e
Update src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffu…
takuma104 1799d83
Update docs/source/en/api/pipelines/stable_diffusion/control_net.mdx
takuma104 d7b95cf
Update docs/source/en/api/pipelines/stable_diffusion/control_net.mdx
takuma104 2e86e1f
Update docs/source/en/api/pipelines/stable_diffusion/control_net.mdx
takuma104 bb03069
Update docs/source/en/api/pipelines/stable_diffusion/control_net.mdx
takuma104 9a14567
Update docs/source/en/api/pipelines/stable_diffusion/control_net.mdx
takuma104 71d0a96
Update docs/source/en/api/pipelines/stable_diffusion/control_net.mdx
takuma104 16efb00
Update docs/source/en/api/pipelines/stable_diffusion/control_net.mdx
takuma104 1b0af7d
Update docs/source/en/api/pipelines/stable_diffusion/control_net.mdx
takuma104 53f4523
Update docs/source/en/api/pipelines/stable_diffusion/control_net.mdx
takuma104 161aac2
add gerated image example
takuma104 349f3bf
a depth mask -> a depth map
takuma104 3f6e8f7
rename control_net.mdx to controlnet.mdx
takuma104 ebabcbe
fix toc title
takuma104 30e2bde
add ControlNet abstruct and link
takuma104 a00c9ca
Merge branch 'main' into controlnet
takuma104 f099be5
Update src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffu…
takuma104 2b553d9
remove controlnet constructor arguments re: @patrickvonplaten
williamberman 238e26f
Merge branch 'main' into controlnet
williamberman d49296c
[integration tests] test canny
williamberman d1cd65a
test_canny fixes
williamberman 7eb43f1
[integration tests] test_depth
williamberman 032d5e0
[integration tests] test_hed
williamberman 5c7dbb3
[integration tests] test_mlsd
williamberman cdbc7c4
add channel order config to controlnet
williamberman 86c1684
[integration tests] test normal
williamberman a18fc70
[integration tests] test_openpose test_scribble
williamberman 9ec6ad4
change height and width to default to conditioning image
williamberman 8fd8e42
[integration tests] test seg
williamberman 7c35fc7
style
williamberman e200797
test_depth fix
williamberman e6973eb
[integration tests] size fixes
williamberman 0ba19da
[integration tests] cpu offloading
williamberman 1a803d1
style
williamberman 8dea9c7
generalize controlnet embedding
williamberman 60e3635
fix conversion script
williamberman b15fca9
Update docs/source/en/api/pipelines/stable_diffusion/controlnet.mdx
takuma104 d7ed0b1
Update docs/source/en/api/pipelines/stable_diffusion/controlnet.mdx
takuma104 0ed0581
Update docs/source/en/api/pipelines/stable_diffusion/controlnet.mdx
takuma104 5e16d13
Update docs/source/en/api/pipelines/stable_diffusion/controlnet.mdx
takuma104 06bb1db
Style adapted to the documentation of pix2pix
takuma104 acf8d26
Merge branch 'huggingface:main' into controlnet
takuma104 3981459
merge main by hand
takuma104 b799512
Merge branch 'main' into controlnet
williamberman 0810e4c
style
williamberman 10dedd9
[docs] controlling generation doc nits
williamberman 042c75e
correct some things
patrickvonplaten ff2e691
add: controlnetmodel to autodoc.
sayakpaul 9cb8816
finish docs
patrickvonplaten 8f62631
Merge branch 'controlnet' of https://github.com/takuma104/diffusers i…
patrickvonplaten 3bbc356
finish
patrickvonplaten b8d1908
finish 2
patrickvonplaten 1f36d9e
correct images
patrickvonplaten 8052dde
Merge branch 'controlnet' of https://github.com/takuma104/diffusers i…
patrickvonplaten a610e47
finish controlnet
patrickvonplaten 9947fcb
Apply suggestions from code review
patrickvonplaten 592f389
uP
patrickvonplaten ec4fc3a
upload model
patrickvonplaten b010e3c
up
patrickvonplaten 547ba02
up
patrickvonplaten File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@takuma104 - left a comment here for future readers for credit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@patrickvonplaten Thank you so much! It is a great honor!