-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Convert From XLab controlnet to diffusers format script #9301
Comments
Are you using the identical settings from the original checkpoints i.e., same guidance scale, number of inference steps, etc.? I don't see which model checkpoint you're exactly using, though. Ccing @DN6. It might make sense to have this supported through |
I'm using this model: https://huggingface.co/XLabs-AI/flux-controlnet-depth-v3 Besides, I'm converting like below: import torch
import safetensors.torch
from huggingface_hub import hf_hub_download
ckpt_path = hf_hub_download("XLabs-AI/flux-controlnet-depth-v3",
filename="flux-depth-controlnet-v3.safetensors")
original_state_dict = safetensors.torch.load_file(ckpt_path)
num_layers = 2
num_single_layers = 0
inner_dim = 3072
mlp_ratio = 4.0
converted_transformer_state_dict = convert_flux_transformer_checkpoint_to_diffusers(
original_state_dict, num_layers, num_single_layers, inner_dim, mlp_ratio=mlp_ratio
) |
@chuck-ma Please check the forward code, the processing of XLAB-controlnet is different from diffusers, especially at "controlnet residual" part |
@chenbinghui1 thanks for your insights. Would you like to take a stab at opening a PR to mitigate the differences? We'd, of course, be more than happy to provide guidance in the process. |
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread. Please note that issues that do not follow the contributing guidelines are likely to be ignored. |
Supported in #9687, thanks to @Anghellia! Marking the issue as closed, but feel free to open if something's missing |
Is your feature request related to a problem? Please describe.
convert from XLab controlnet to diffusers format
Describe the solution you'd like.
convert from XLab controlnet to diffusers format
Additional context.
I use the script as below:
Here is how i convert to diffusers format
Then i load directly in diffusers api. It works. However, the control of the depth map seems ineffective.
Wonder why.
output like this:
Any advice @sayakpaul
The text was updated successfully, but these errors were encountered: