Conversation
|
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. |
|
|
||
| class ControlNetModel(ControlNetModel): | ||
| def __init__(self, *args, **kwargs): | ||
| def __init__( |
There was a problem hiding this comment.
for models that inherits from ConfigMixin, it relies on its __init__ method signature to identify expected keys and only pass the expected keys to the model
Currently with its signature being *args and **kwargs, None of the configs are being passed to the ControlNetModel when importing from this legacy location.
| class ControlNetOutput(ControlNetOutput): | ||
| def __init__(self, *args, **kwargs): | ||
| deprecation_message = "Importing `ControlNetOutput` from `diffusers.models.controlnet` is deprecated and this will be removed in a future version. Please use `from diffusers.models.controlnets.controlnet import ControlNetOutput`, instead." | ||
| deprecate("ControlNetOutput", "0.34", deprecation_message) |
There was a problem hiding this comment.
currently, you're getting a deprecation message like this - it is confusing because we are not deprecating ControlNetModel; we only deprecate importing from the previous file
FutureWarning: `ControlNetModel` is deprecated and will be removed in version 0.34. Importing `ControlNetModel` from `diffusers.models.controlnet` is deprecated and this will be removed in a future version. Please use `from diffusers.models.controlnets.controlnet import ControlNetModel`, instead.
deprecate("ControlNetModel", "0.34", deprecation_message)
| "ModelMixin", | ||
| "MotionAdapter", | ||
| "MultiAdapter", | ||
| "MultiControlNetModel", |
There was a problem hiding this comment.
add MultiControlNetModel to top-level import because every other MultiControlNetModels are, e.g, SD3MultiControlNetModel, FluxMultiControlNetModel
a-r-r-o-w
left a comment
There was a problem hiding this comment.
Not sure if I've missed something, but the following changes look correctly done:
- Docstring fixes to correctly use
~modelsas opposed to~diffusersor anything else. - Init arguments are handled correctly as opposed to args and kwargs because otherwise our ConfigMixin won't work as expected.
- I've matched the default init parameters for all models and they seem to be the same as before #8768, so this looks correct.
- The deprecation messages are no longer ambiguous.
- MultiControlNetModel is now a top-level import accessible directly from
diffusers.modelsbut was not previously (or after #8768) - Using
cls.from_configas opposed to creating the class object directly from config is the preferred way to do things forfrom_*methods (?)
If these were all the intended changes, I think this is good to merge. With this PR, the linked Flux controlnet model works correctly as well, thanks!
#8768 breaks the legacy API for all controlnets it moved: flux, sd3, sdxl, sd, sparse;
e.g. docstring example for flux controlnet won't run on
mainhttps://huggingface.co/InstantX/FLUX.1-dev-Controlnet-Cannythis PR fixes that