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

Safetensor loading in AnimateDiff conversion scripts #7764

Merged
merged 3 commits into from
Apr 29, 2024

Conversation

DN6
Copy link
Collaborator

@DN6 DN6 commented Apr 24, 2024

What does this PR do?

Add support for converting safetensors format AnimateDiff checkpoints to diffusers.

Fixes # (issue)
#7751

Before submitting

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@DN6 DN6 requested a review from sayakpaul April 25, 2024 10:35
Copy link
Member

@sayakpaul sayakpaul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a single comment.

Comment on lines 38 to 41
if args.use_safetensors:
state_dict = load_file(args.ckpt_path)
else:
state_dict = torch.load(args.ckpt_path, map_location="cpu")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we rather condition on the extension? Something like if args.ckpt_path.endswith(".safetensors"):?

@DN6 DN6 merged commit eb96ff0 into main Apr 29, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants