diffsynth-engine 0.3.3__tar.gz → 0.3.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/PKG-INFO +1 -1
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/README.md +1 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/__init__.py +4 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/models/base.py +7 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/models/basic/attention.py +1 -1
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/models/basic/lora.py +1 -2
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/models/flux/flux_dit.py +34 -12
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/models/flux/flux_text_encoder.py +1 -1
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/models/sd/__init__.py +2 -0
- diffsynth_engine-0.3.4/diffsynth_engine/models/sd/sd_controlnet.py +596 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/models/sd/sd_unet.py +10 -2
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/models/sdxl/__init__.py +2 -0
- diffsynth_engine-0.3.4/diffsynth_engine/models/sdxl/sdxl_controlnet.py +299 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/models/sdxl/sdxl_unet.py +11 -2
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/models/wan/wan_dit.py +17 -10
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/pipelines/__init__.py +2 -1
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/pipelines/base.py +8 -11
- diffsynth_engine-0.3.4/diffsynth_engine/pipelines/controlnet_helper.py +24 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/pipelines/flux_image.py +243 -103
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/pipelines/sd_image.py +80 -8
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/pipelines/sdxl_image.py +87 -9
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/pipelines/wan_video.py +33 -59
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/tools/flux_inpainting_tool.py +22 -8
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/tools/flux_outpainting_tool.py +9 -2
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/tools/flux_reference_tool.py +10 -3
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/tools/flux_replace_tool.py +11 -3
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/utils/loader.py +1 -1
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/utils/offload.py +2 -2
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/utils/parallel.py +114 -66
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine.egg-info/PKG-INFO +1 -1
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine.egg-info/SOURCES.txt +3 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/.gitignore +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/.pre-commit-config.yaml +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/LICENSE +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/MANIFEST.in +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/assets/dingtalk.png +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/assets/showcase.jpeg +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/algorithm/__init__.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/algorithm/noise_scheduler/__init__.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/algorithm/noise_scheduler/base_scheduler.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/algorithm/noise_scheduler/flow_match/__init__.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/algorithm/noise_scheduler/flow_match/flow_beta.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/algorithm/noise_scheduler/flow_match/flow_ddim.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/algorithm/noise_scheduler/flow_match/recifited_flow.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/algorithm/noise_scheduler/stable_diffusion/__init__.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/algorithm/noise_scheduler/stable_diffusion/beta.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/algorithm/noise_scheduler/stable_diffusion/ddim.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/algorithm/noise_scheduler/stable_diffusion/exponential.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/algorithm/noise_scheduler/stable_diffusion/karras.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/algorithm/noise_scheduler/stable_diffusion/linear.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/algorithm/noise_scheduler/stable_diffusion/sgm_uniform.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/algorithm/sampler/__init__.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/algorithm/sampler/flow_match/__init__.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/algorithm/sampler/flow_match/flow_match_euler.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/algorithm/sampler/stable_diffusion/__init__.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/algorithm/sampler/stable_diffusion/brownian_tree.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/algorithm/sampler/stable_diffusion/ddpm.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/algorithm/sampler/stable_diffusion/deis.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/algorithm/sampler/stable_diffusion/dpmpp_2m.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/algorithm/sampler/stable_diffusion/dpmpp_2m_sde.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/algorithm/sampler/stable_diffusion/dpmpp_3m_sde.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/algorithm/sampler/stable_diffusion/epsilon.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/algorithm/sampler/stable_diffusion/euler.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/algorithm/sampler/stable_diffusion/euler_ancestral.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/conf/models/components/vae.json +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/conf/models/flux/flux_dit.json +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/conf/models/flux/flux_text_encoder.json +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/conf/models/flux/flux_vae.json +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/conf/models/sd/sd_text_encoder.json +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/conf/models/sd/sd_unet.json +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/conf/models/sd3/sd3_dit.json +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/conf/models/sd3/sd3_text_encoder.json +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/conf/models/sdxl/sdxl_text_encoder.json +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/conf/models/sdxl/sdxl_unet.json +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/conf/models/wan/dit/1.3b-t2v.json +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/conf/models/wan/dit/14b-flf2v.json +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/conf/models/wan/dit/14b-i2v.json +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/conf/models/wan/dit/14b-t2v.json +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/conf/tokenizers/flux/tokenizer_1/merges.txt +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/conf/tokenizers/flux/tokenizer_1/special_tokens_map.json +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/conf/tokenizers/flux/tokenizer_1/tokenizer_config.json +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/conf/tokenizers/flux/tokenizer_1/vocab.json +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/conf/tokenizers/flux/tokenizer_2/special_tokens_map.json +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/conf/tokenizers/flux/tokenizer_2/spiece.model +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/conf/tokenizers/flux/tokenizer_2/tokenizer.json +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/conf/tokenizers/flux/tokenizer_2/tokenizer_config.json +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/conf/tokenizers/sdxl/tokenizer/merges.txt +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/conf/tokenizers/sdxl/tokenizer/special_tokens_map.json +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/conf/tokenizers/sdxl/tokenizer/tokenizer_config.json +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/conf/tokenizers/sdxl/tokenizer/vocab.json +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/conf/tokenizers/sdxl/tokenizer_2/merges.txt +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/conf/tokenizers/sdxl/tokenizer_2/special_tokens_map.json +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/conf/tokenizers/sdxl/tokenizer_2/tokenizer_config.json +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/conf/tokenizers/sdxl/tokenizer_2/vocab.json +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/conf/tokenizers/wan/umt5-xxl/special_tokens_map.json +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/conf/tokenizers/wan/umt5-xxl/spiece.model +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/conf/tokenizers/wan/umt5-xxl/tokenizer.json +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/conf/tokenizers/wan/umt5-xxl/tokenizer_config.json +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/kernels/__init__.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/models/__init__.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/models/basic/__init__.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/models/basic/relative_position_emb.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/models/basic/timestep.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/models/basic/transformer_helper.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/models/basic/unet_helper.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/models/flux/__init__.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/models/flux/flux_controlnet.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/models/flux/flux_ipadapter.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/models/flux/flux_redux.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/models/flux/flux_vae.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/models/sd/sd_text_encoder.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/models/sd/sd_vae.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/models/sd3/__init__.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/models/sd3/sd3_dit.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/models/sd3/sd3_text_encoder.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/models/sd3/sd3_vae.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/models/sdxl/sdxl_text_encoder.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/models/sdxl/sdxl_vae.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/models/text_encoder/__init__.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/models/text_encoder/clip.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/models/text_encoder/siglip.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/models/text_encoder/t5.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/models/utils.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/models/vae/__init__.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/models/vae/vae.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/models/wan/__init__.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/models/wan/wan_image_encoder.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/models/wan/wan_text_encoder.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/models/wan/wan_vae.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/processor/__init__.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/processor/canny_processor.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/processor/depth_processor.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/tokenizers/__init__.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/tokenizers/base.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/tokenizers/clip.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/tokenizers/t5.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/tokenizers/wan.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/tools/__init__.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/utils/__init__.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/utils/constants.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/utils/download.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/utils/env.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/utils/flag.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/utils/fp8_linear.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/utils/gguf.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/utils/image.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/utils/lock.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/utils/logging.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/utils/onnx.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/utils/platform.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/utils/prompt.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/utils/video.py +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine.egg-info/dependency_links.txt +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine.egg-info/requires.txt +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine.egg-info/top_level.txt +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/docs/tutorial.md +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/docs/tutorial_zh.md +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/pyproject.toml +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/setup.cfg +0 -0
- {diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/setup.py +0 -0
|
@@ -81,6 +81,7 @@ If you have any questions or feedback, please scan the QR code below, or send em
|
|
|
81
81
|
We welcome contributions to DiffSynth-Engine. After Install from source, we recommand developers install this project using following command to setup the development environment.
|
|
82
82
|
```bash
|
|
83
83
|
pip install -e '.[dev]'
|
|
84
|
+
pre-commit install
|
|
84
85
|
```
|
|
85
86
|
TODO: Please refer to [CONTRIBUTING.md](./CONTRIBUTING.md) for more details.
|
|
86
87
|
|
|
@@ -10,6 +10,8 @@ from .pipelines import (
|
|
|
10
10
|
ControlNetParams,
|
|
11
11
|
)
|
|
12
12
|
from .models.flux import FluxControlNet, FluxIPAdapter, FluxRedux
|
|
13
|
+
from .models.sd import SDControlNet
|
|
14
|
+
from .models.sdxl import SDXLControlNetUnion
|
|
13
15
|
from .utils.download import fetch_model, fetch_modelscope_model, fetch_civitai_model
|
|
14
16
|
from .utils.video import load_video, save_video
|
|
15
17
|
from .tools import (
|
|
@@ -25,6 +27,8 @@ __all__ = [
|
|
|
25
27
|
"FluxControlNet",
|
|
26
28
|
"FluxIPAdapter",
|
|
27
29
|
"FluxRedux",
|
|
30
|
+
"SDControlNet",
|
|
31
|
+
"SDXLControlNetUnion",
|
|
28
32
|
"SDXLImagePipeline",
|
|
29
33
|
"SDImagePipeline",
|
|
30
34
|
"WanVideoPipeline",
|
|
@@ -14,6 +14,7 @@ class StateDictConverter:
|
|
|
14
14
|
|
|
15
15
|
class PreTrainedModel(nn.Module):
|
|
16
16
|
converter = StateDictConverter()
|
|
17
|
+
_supports_parallelization = False
|
|
17
18
|
|
|
18
19
|
def load_state_dict(self, state_dict: Dict[str, torch.Tensor], strict: bool = True, assign: bool = False):
|
|
19
20
|
state_dict = self.converter.convert(state_dict)
|
|
@@ -55,6 +56,12 @@ class PreTrainedModel(nn.Module):
|
|
|
55
56
|
if isinstance(module, (LoRALinear, LoRAConv2d)):
|
|
56
57
|
module.clear()
|
|
57
58
|
|
|
59
|
+
def get_tp_plan(self):
|
|
60
|
+
raise NotImplementedError(f"{self.__class__.__name__} does not support TP")
|
|
61
|
+
|
|
62
|
+
def get_fsdp_modules(self):
|
|
63
|
+
raise NotImplementedError(f"{self.__class__.__name__} does not support FSDP")
|
|
64
|
+
|
|
58
65
|
|
|
59
66
|
def split_suffix(name: str):
|
|
60
67
|
suffix_list = [
|
{diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/models/basic/attention.py
RENAMED
|
@@ -62,7 +62,7 @@ if SAGE_ATTN_AVAILABLE:
|
|
|
62
62
|
if SPARGE_ATTN_AVAILABLE:
|
|
63
63
|
from spas_sage_attn import spas_sage2_attn_meansim_cuda
|
|
64
64
|
|
|
65
|
-
def sparge_attn(
|
|
65
|
+
def sparge_attn(q, k, v, attn_mask=None, scale=None):
|
|
66
66
|
q = q.transpose(1, 2)
|
|
67
67
|
k = k.transpose(1, 2)
|
|
68
68
|
v = v.transpose(1, 2)
|
|
@@ -131,8 +131,7 @@ class LoRALinear(nn.Linear):
|
|
|
131
131
|
self._lora_dict.clear()
|
|
132
132
|
self._frozen_lora_list = []
|
|
133
133
|
if self._original_weight is not None:
|
|
134
|
-
self.weight.data
|
|
135
|
-
self._original_weight = None
|
|
134
|
+
self.weight.data.copy_(self._original_weight)
|
|
136
135
|
|
|
137
136
|
def forward(self, x):
|
|
138
137
|
w_x = super().forward(x)
|
|
@@ -18,7 +18,12 @@ from diffsynth_engine.models.utils import no_init_weights
|
|
|
18
18
|
from diffsynth_engine.utils.gguf import gguf_inference
|
|
19
19
|
from diffsynth_engine.utils.fp8_linear import fp8_inference
|
|
20
20
|
from diffsynth_engine.utils.constants import FLUX_DIT_CONFIG_FILE
|
|
21
|
-
from diffsynth_engine.utils.parallel import
|
|
21
|
+
from diffsynth_engine.utils.parallel import (
|
|
22
|
+
cfg_parallel,
|
|
23
|
+
cfg_parallel_unshard,
|
|
24
|
+
sequence_parallel,
|
|
25
|
+
sequence_parallel_unshard,
|
|
26
|
+
)
|
|
22
27
|
from diffsynth_engine.utils import logging
|
|
23
28
|
|
|
24
29
|
|
|
@@ -151,7 +156,7 @@ class FluxDiTStateDictConverter(StateDictConverter):
|
|
|
151
156
|
state_dict = self._from_diffusers(state_dict)
|
|
152
157
|
logger.info("use diffusers format state dict")
|
|
153
158
|
else:
|
|
154
|
-
logger.info("
|
|
159
|
+
logger.info("use diffsynth format state dict")
|
|
155
160
|
return state_dict
|
|
156
161
|
|
|
157
162
|
|
|
@@ -323,12 +328,12 @@ class FluxSingleTransformerBlock(nn.Module):
|
|
|
323
328
|
|
|
324
329
|
class FluxDiT(PreTrainedModel):
|
|
325
330
|
converter = FluxDiTStateDictConverter()
|
|
331
|
+
_supports_parallelization = True
|
|
326
332
|
|
|
327
333
|
def __init__(
|
|
328
334
|
self,
|
|
329
335
|
in_channel: int = 64,
|
|
330
336
|
attn_impl: Optional[str] = None,
|
|
331
|
-
use_usp: bool = False,
|
|
332
337
|
device: str = "cuda:0",
|
|
333
338
|
dtype: torch.dtype = torch.bfloat16,
|
|
334
339
|
):
|
|
@@ -354,8 +359,6 @@ class FluxDiT(PreTrainedModel):
|
|
|
354
359
|
self.final_norm_out = AdaLayerNorm(3072, device=device, dtype=dtype)
|
|
355
360
|
self.final_proj_out = nn.Linear(3072, 64, device=device, dtype=dtype)
|
|
356
361
|
|
|
357
|
-
self.use_usp = use_usp
|
|
358
|
-
|
|
359
362
|
def patchify(self, hidden_states):
|
|
360
363
|
hidden_states = rearrange(hidden_states, "B C (H P) (W Q) -> B (H W) (C P Q)", P=2, Q=2)
|
|
361
364
|
return hidden_states
|
|
@@ -398,6 +401,8 @@ class FluxDiT(PreTrainedModel):
|
|
|
398
401
|
**kwargs,
|
|
399
402
|
):
|
|
400
403
|
h, w = hidden_states.shape[-2:]
|
|
404
|
+
if image_ids is None:
|
|
405
|
+
image_ids = self.prepare_image_ids(hidden_states)
|
|
401
406
|
controlnet_double_block_output = (
|
|
402
407
|
controlnet_double_block_output if controlnet_double_block_output is not None else ()
|
|
403
408
|
)
|
|
@@ -406,10 +411,26 @@ class FluxDiT(PreTrainedModel):
|
|
|
406
411
|
)
|
|
407
412
|
|
|
408
413
|
fp8_linear_enabled = getattr(self, "fp8_linear_enabled", False)
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
414
|
+
use_cfg = hidden_states.shape[0] > 1
|
|
415
|
+
with (
|
|
416
|
+
fp8_inference(fp8_linear_enabled),
|
|
417
|
+
gguf_inference(),
|
|
418
|
+
cfg_parallel(
|
|
419
|
+
(
|
|
420
|
+
hidden_states,
|
|
421
|
+
timestep,
|
|
422
|
+
prompt_emb,
|
|
423
|
+
pooled_prompt_emb,
|
|
424
|
+
image_emb,
|
|
425
|
+
guidance,
|
|
426
|
+
text_ids,
|
|
427
|
+
image_ids,
|
|
428
|
+
*controlnet_double_block_output,
|
|
429
|
+
*controlnet_single_block_output,
|
|
430
|
+
),
|
|
431
|
+
use_cfg=use_cfg,
|
|
432
|
+
),
|
|
433
|
+
):
|
|
413
434
|
# warning: keep the order of time_embedding + guidance_embedding + pooled_text_embedding
|
|
414
435
|
# addition of floating point numbers does not meet commutative law
|
|
415
436
|
conditioning = self.time_embedder(timestep, hidden_states.dtype)
|
|
@@ -439,7 +460,6 @@ class FluxDiT(PreTrainedModel):
|
|
|
439
460
|
*(1 for _ in controlnet_double_block_output),
|
|
440
461
|
*(1 for _ in controlnet_single_block_output),
|
|
441
462
|
),
|
|
442
|
-
enabled=self.use_usp,
|
|
443
463
|
):
|
|
444
464
|
hidden_states = self.x_embedder(hidden_states)
|
|
445
465
|
prompt_emb = self.context_embedder(prompt_emb)
|
|
@@ -465,6 +485,7 @@ class FluxDiT(PreTrainedModel):
|
|
|
465
485
|
(hidden_states,) = sequence_parallel_unshard((hidden_states,), seq_dims=(1,), seq_lens=(h * w // 4,))
|
|
466
486
|
|
|
467
487
|
hidden_states = self.unpatchify(hidden_states, h, w)
|
|
488
|
+
(hidden_states,) = cfg_parallel_unshard((hidden_states,), use_cfg=use_cfg)
|
|
468
489
|
return hidden_states
|
|
469
490
|
|
|
470
491
|
@classmethod
|
|
@@ -475,7 +496,6 @@ class FluxDiT(PreTrainedModel):
|
|
|
475
496
|
dtype: torch.dtype,
|
|
476
497
|
in_channel: int = 64,
|
|
477
498
|
attn_impl: Optional[str] = None,
|
|
478
|
-
use_usp: bool = False,
|
|
479
499
|
):
|
|
480
500
|
with no_init_weights():
|
|
481
501
|
model = torch.nn.utils.skip_init(
|
|
@@ -484,9 +504,11 @@ class FluxDiT(PreTrainedModel):
|
|
|
484
504
|
dtype=dtype,
|
|
485
505
|
in_channel=in_channel,
|
|
486
506
|
attn_impl=attn_impl,
|
|
487
|
-
use_usp=use_usp,
|
|
488
507
|
)
|
|
489
508
|
model = model.requires_grad_(False) # for loading gguf
|
|
490
509
|
model.load_state_dict(state_dict, assign=True)
|
|
491
510
|
model.to(device=device, dtype=dtype, non_blocking=True)
|
|
492
511
|
return model
|
|
512
|
+
|
|
513
|
+
def get_fsdp_modules(self):
|
|
514
|
+
return ["blocks", "single_blocks"]
|
{diffsynth_engine-0.3.3 → diffsynth_engine-0.3.4}/diffsynth_engine/models/flux/flux_text_encoder.py
RENAMED
|
@@ -37,7 +37,7 @@ class FluxTextEncoder1StateDictConverter(StateDictConverter):
|
|
|
37
37
|
state_dict = self._from_diffusers(state_dict)
|
|
38
38
|
logger.info("use diffusers format state dict")
|
|
39
39
|
else:
|
|
40
|
-
logger.info("
|
|
40
|
+
logger.info("use diffsynth format state dict")
|
|
41
41
|
return state_dict
|
|
42
42
|
|
|
43
43
|
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
from .sd_text_encoder import SDTextEncoder, config as sd_text_encoder_config
|
|
2
2
|
from .sd_unet import SDUNet, config as sd_unet_config
|
|
3
3
|
from .sd_vae import SDVAEDecoder, SDVAEEncoder
|
|
4
|
+
from .sd_controlnet import SDControlNet
|
|
4
5
|
|
|
5
6
|
__all__ = [
|
|
6
7
|
"SDTextEncoder",
|
|
7
8
|
"SDUNet",
|
|
8
9
|
"SDVAEDecoder",
|
|
9
10
|
"SDVAEEncoder",
|
|
11
|
+
"SDControlNet",
|
|
10
12
|
"sd_text_encoder_config",
|
|
11
13
|
"sd_unet_config",
|
|
12
14
|
]
|