-
Couldn't load subscription status.
- Fork 6.5k
[Alibaba Wan Team] continue on #10921 Wan2.1 #10922
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
Merged
Merged
Changes from 32 commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
d1e75ab
Add wanx pipeline, model and example
yitongh ca5c724
wanx_merged_v1
wan-x-ai 5dd22a9
change WanX into Wan
wan-x-ai fea59a6
fix i2v fp32 oom error
yitongh 768995f
support t2v load fp32 ckpt
yitongh 128f1af
add example
yitongh 8220482
final merge v1
wan-x-ai 9cad60e
Update autoencoder_kl_wan.py
wan-x-ai 2e12d1b
up
yiyixuxu 9c19bda
update middle, test up_block
yiyixuxu 2da1feb
up up
yiyixuxu b7a3900
one less nn.sequential
yiyixuxu 5f2518a
up more
yiyixuxu 89f1c6a
up
yiyixuxu 9e8ef93
more
yiyixuxu 2e1924a
[refactor] [wip] Wan transformer/pipeline (#10926)
a-r-r-o-w 425a3b0
make style
a-r-r-o-w 157a24d
update tests
a-r-r-o-w a9768d2
tests
a-r-r-o-w d9f615d
conversion script
a-r-r-o-w 0122271
conversion script
a-r-r-o-w 22ea488
update
a-r-r-o-w 4c88dbb
docs
a-r-r-o-w 2a4cfb1
Merge branch 'main' into yiyi-refactor-wan-vae
a-r-r-o-w 72e6eb2
remove unused code
a-r-r-o-w 094db80
fix _toctree.yml
a-r-r-o-w 81c5dca
update dtype
yiyixuxu 3eb31f9
fix test
yiyixuxu 99787be
fix tests: scale
yiyixuxu 34a5e4b
up
yiyixuxu cfb32bb
more
yiyixuxu 6e27c43
Merge branch 'main' into yiyi-refactor-wan-vae
yiyixuxu 38e3c48
Apply suggestions from code review
yiyixuxu 590cf97
Apply suggestions from code review
yiyixuxu 71fa990
style
yiyixuxu 3629794
Update scripts/convert_wan_to_diffusers.py
a-r-r-o-w 67940a9
update docs
a-r-r-o-w 913f83c
fix
a-r-r-o-w 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 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| <!-- Copyright 2024 The HuggingFace Team. All rights reserved. | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
| the License. You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
| an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
| specific language governing permissions and limitations under the License. --> | ||
|
|
||
| # AutoencoderKLWan | ||
|
|
||
| The 3D variational autoencoder (VAE) model with KL loss used in [Wan 2.1](https://github.com/Wan-Video/Wan2.1) by the Alibaba Wan Team. | ||
|
|
||
| The model can be loaded with the following code snippet. | ||
|
|
||
| ```python | ||
| from diffusers import AutoencoderKLWan | ||
|
|
||
| vae = AutoencoderKLWan.from_pretrained("Wan-AI/Wan2.1-T2V-1.3B", subfolder="vae", torch_dtype=torch.float32) | ||
| ``` | ||
|
|
||
| ## AutoencoderKLWan | ||
|
|
||
| [[autodoc]] AutoencoderKLWan | ||
| - decode | ||
| - all | ||
|
|
||
| ## DecoderOutput | ||
|
|
||
| [[autodoc]] models.autoencoders.vae.DecoderOutput | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| <!-- Copyright 2024 The HuggingFace Team. All rights reserved. | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
| the License. You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
| an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
| specific language governing permissions and limitations under the License. --> | ||
|
|
||
| # WanTransformer3DModel | ||
|
|
||
| A Diffusion Transformer model for 3D video-like data was introduced in [Wan 2.1](https://github.com/Wan-Video/Wan2.1) by the Alibaba Wan Team. | ||
|
|
||
| The model can be loaded with the following code snippet. | ||
|
|
||
| ```python | ||
| from diffusers import WanTransformer3DModel | ||
|
|
||
| transformer = WanTransformer3DModel.from_pretrained("Wan-AI/Wan2.1-T2V-1.3B", subfolder="transformer", torch_dtype=torch.bfloat16) | ||
yiyixuxu marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ``` | ||
|
|
||
| ## WanTransformer3DModel | ||
|
|
||
| [[autodoc]] WanTransformer3DModel | ||
|
|
||
| ## Transformer2DModelOutput | ||
|
|
||
| [[autodoc]] models.modeling_outputs.Transformer2DModelOutput | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| <!-- Copyright 2024 The HuggingFace Team. All rights reserved. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. --> | ||
|
|
||
| # Wan | ||
|
|
||
| [Wan 2.1](https://github.com/Wan-Video/Wan2.1) by the Alibaba Wan Team. | ||
|
|
||
| <!-- TODO(aryan): update abstract once paper is out --> | ||
|
|
||
| <Tip> | ||
|
|
||
| Make sure to check out the Schedulers [guide](../../using-diffusers/schedulers) to learn how to explore the tradeoff between scheduler speed and quality, and see the [reuse components across pipelines](../../using-diffusers/loading#reuse-a-pipeline) section to learn how to efficiently load the same components into multiple pipelines. | ||
|
|
||
| </Tip> | ||
|
|
||
| Recommendations for inference: | ||
| - VAE in `torch.float32` for better decoding quality. | ||
| - `num_frames` should be of the form `4 * k + 1`, for example `49` or `81`. | ||
| - For smaller resolution videos, try lower values of `shift` (between `2.0` to `5.0`) in the [Scheduler](https://huggingface.co/docs/diffusers/main/en/api/schedulers/flow_match_euler_discrete#diffusers.FlowMatchEulerDiscreteScheduler.shift). For larger resolution images, try higher values (between `7.0` and `12.0`). The default value is `3.0` for Wan. | ||
|
|
||
| ## WanPipeline | ||
|
|
||
| [[autodoc]] WanPipeline | ||
| - all | ||
| - __call__ | ||
|
|
||
| ## WanImageToVideoPipeline | ||
|
|
||
| [[autodoc]] WanImageToVideoPipeline | ||
| - all | ||
| - __call__ | ||
|
|
||
| ## WanPipelineOutput | ||
|
|
||
| [[autodoc]] pipelines.wan.pipeline_output.WanPipelineOutput |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.