diffsynth-engine 0.4.3.dev6__tar.gz → 0.4.3.dev8__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.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/PKG-INFO +1 -1
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/__init__.py +8 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/pipelines/sd_image.py +27 -22
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/pipelines/sdxl_image.py +35 -29
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/tools/flux_inpainting_tool.py +41 -4
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/tools/flux_outpainting_tool.py +43 -6
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/tools/flux_reference_tool.py +36 -5
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/tools/flux_replace_tool.py +44 -7
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine.egg-info/PKG-INFO +1 -1
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/.gitignore +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/.pre-commit-config.yaml +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/LICENSE +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/MANIFEST.in +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/README.md +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/assets/dingtalk.png +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/assets/showcase.jpeg +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/algorithm/__init__.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/algorithm/noise_scheduler/__init__.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/algorithm/noise_scheduler/base_scheduler.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/algorithm/noise_scheduler/flow_match/__init__.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/algorithm/noise_scheduler/flow_match/flow_beta.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/algorithm/noise_scheduler/flow_match/flow_ddim.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/algorithm/noise_scheduler/flow_match/recifited_flow.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/algorithm/noise_scheduler/stable_diffusion/__init__.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/algorithm/noise_scheduler/stable_diffusion/beta.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/algorithm/noise_scheduler/stable_diffusion/ddim.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/algorithm/noise_scheduler/stable_diffusion/exponential.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/algorithm/noise_scheduler/stable_diffusion/karras.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/algorithm/noise_scheduler/stable_diffusion/linear.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/algorithm/noise_scheduler/stable_diffusion/sgm_uniform.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/algorithm/sampler/__init__.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/algorithm/sampler/flow_match/__init__.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/algorithm/sampler/flow_match/flow_match_euler.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/algorithm/sampler/stable_diffusion/__init__.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/algorithm/sampler/stable_diffusion/brownian_tree.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/algorithm/sampler/stable_diffusion/ddpm.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/algorithm/sampler/stable_diffusion/deis.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/algorithm/sampler/stable_diffusion/dpmpp_2m.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/algorithm/sampler/stable_diffusion/dpmpp_2m_sde.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/algorithm/sampler/stable_diffusion/dpmpp_3m_sde.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/algorithm/sampler/stable_diffusion/epsilon.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/algorithm/sampler/stable_diffusion/euler.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/algorithm/sampler/stable_diffusion/euler_ancestral.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/models/components/vae.json +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/models/flux/flux_dit.json +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/models/flux/flux_text_encoder.json +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/models/flux/flux_vae.json +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/models/qwen_image/qwen2_5_vl_config.json +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/models/qwen_image/qwen2_5_vl_vision_config.json +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/models/qwen_image/qwen_image_vae.json +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/models/qwen_image/qwen_image_vae_keymap.json +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/models/sd/sd_text_encoder.json +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/models/sd/sd_unet.json +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/models/sd3/sd3_dit.json +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/models/sd3/sd3_text_encoder.json +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/models/sdxl/sdxl_text_encoder.json +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/models/sdxl/sdxl_unet.json +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/models/wan/dit/wan2.1-flf2v-14b.json +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/models/wan/dit/wan2.1-i2v-14b.json +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/models/wan/dit/wan2.1-t2v-1.3b.json +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/models/wan/dit/wan2.1-t2v-14b.json +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/models/wan/dit/wan2.2-i2v-a14b.json +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/models/wan/dit/wan2.2-t2v-a14b.json +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/models/wan/dit/wan2.2-ti2v-5b.json +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/models/wan/vae/wan-vae-keymap.json +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/models/wan/vae/wan2.1-vae.json +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/models/wan/vae/wan2.2-vae.json +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/tokenizers/flux/tokenizer_1/merges.txt +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/tokenizers/flux/tokenizer_1/special_tokens_map.json +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/tokenizers/flux/tokenizer_1/tokenizer_config.json +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/tokenizers/flux/tokenizer_1/vocab.json +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/tokenizers/flux/tokenizer_2/special_tokens_map.json +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/tokenizers/flux/tokenizer_2/spiece.model +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/tokenizers/flux/tokenizer_2/tokenizer.json +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/tokenizers/flux/tokenizer_2/tokenizer_config.json +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/tokenizers/qwen_image/tokenizer/added_tokens.json +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/tokenizers/qwen_image/tokenizer/merges.txt +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/tokenizers/qwen_image/tokenizer/special_tokens_map.json +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/tokenizers/qwen_image/tokenizer/tokenizer.json +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/tokenizers/qwen_image/tokenizer/tokenizer_config.json +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/tokenizers/qwen_image/tokenizer/vocab.json +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/tokenizers/sdxl/tokenizer/merges.txt +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/tokenizers/sdxl/tokenizer/special_tokens_map.json +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/tokenizers/sdxl/tokenizer/tokenizer_config.json +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/tokenizers/sdxl/tokenizer/vocab.json +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/tokenizers/sdxl/tokenizer_2/merges.txt +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/tokenizers/sdxl/tokenizer_2/special_tokens_map.json +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/tokenizers/sdxl/tokenizer_2/tokenizer_config.json +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/tokenizers/sdxl/tokenizer_2/vocab.json +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/tokenizers/wan/umt5-xxl/special_tokens_map.json +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/tokenizers/wan/umt5-xxl/spiece.model +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/tokenizers/wan/umt5-xxl/tokenizer.json +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/conf/tokenizers/wan/umt5-xxl/tokenizer_config.json +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/configs/__init__.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/configs/controlnet.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/configs/pipeline.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/kernels/__init__.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/__init__.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/base.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/basic/__init__.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/basic/attention.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/basic/lora.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/basic/relative_position_emb.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/basic/timestep.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/basic/transformer_helper.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/basic/unet_helper.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/flux/__init__.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/flux/flux_controlnet.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/flux/flux_dit.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/flux/flux_dit_fbcache.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/flux/flux_ipadapter.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/flux/flux_redux.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/flux/flux_text_encoder.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/flux/flux_vae.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/qwen_image/__init__.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/qwen_image/qwen2_5_vl.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/qwen_image/qwen_image_dit.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/qwen_image/qwen_image_dit_fbcache.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/qwen_image/qwen_image_vae.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/sd/__init__.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/sd/sd_controlnet.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/sd/sd_text_encoder.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/sd/sd_unet.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/sd/sd_vae.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/sd3/__init__.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/sd3/sd3_dit.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/sd3/sd3_text_encoder.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/sd3/sd3_vae.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/sdxl/__init__.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/sdxl/sdxl_controlnet.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/sdxl/sdxl_text_encoder.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/sdxl/sdxl_unet.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/sdxl/sdxl_vae.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/text_encoder/__init__.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/text_encoder/clip.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/text_encoder/siglip.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/text_encoder/t5.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/utils.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/vae/__init__.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/vae/vae.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/wan/__init__.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/wan/wan_dit.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/wan/wan_image_encoder.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/wan/wan_text_encoder.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/models/wan/wan_vae.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/pipelines/__init__.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/pipelines/base.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/pipelines/flux_image.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/pipelines/qwen_image.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/pipelines/utils.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/pipelines/wan_video.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/processor/__init__.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/processor/canny_processor.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/processor/depth_processor.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/tokenizers/__init__.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/tokenizers/base.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/tokenizers/clip.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/tokenizers/qwen2.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/tokenizers/t5.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/tokenizers/wan.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/tools/__init__.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/utils/__init__.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/utils/cache.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/utils/constants.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/utils/download.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/utils/env.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/utils/flag.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/utils/fp8_linear.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/utils/gguf.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/utils/image.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/utils/loader.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/utils/lock.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/utils/logging.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/utils/offload.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/utils/onnx.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/utils/parallel.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/utils/platform.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/utils/prompt.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/utils/video.py +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine.egg-info/SOURCES.txt +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine.egg-info/dependency_links.txt +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine.egg-info/requires.txt +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine.egg-info/top_level.txt +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/docs/tutorial.md +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/docs/tutorial_zh.md +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/pyproject.toml +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/setup.cfg +0 -0
- {diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/setup.py +0 -0
|
@@ -4,6 +4,10 @@ from .configs import (
|
|
|
4
4
|
FluxPipelineConfig,
|
|
5
5
|
WanPipelineConfig,
|
|
6
6
|
QwenImagePipelineConfig,
|
|
7
|
+
SDStateDicts,
|
|
8
|
+
SDXLStateDicts,
|
|
9
|
+
FluxStateDicts,
|
|
10
|
+
QwenImageStateDicts,
|
|
7
11
|
ControlNetParams,
|
|
8
12
|
ControlType,
|
|
9
13
|
)
|
|
@@ -38,6 +42,10 @@ __all__ = [
|
|
|
38
42
|
"SDXLPipelineConfig",
|
|
39
43
|
"FluxPipelineConfig",
|
|
40
44
|
"WanPipelineConfig",
|
|
45
|
+
"SDStateDicts",
|
|
46
|
+
"SDXLStateDicts",
|
|
47
|
+
"FluxStateDicts",
|
|
48
|
+
"QwenImageStateDicts",
|
|
41
49
|
"FluxImagePipeline",
|
|
42
50
|
"QwenImagePipelineConfig",
|
|
43
51
|
"FluxControlNet",
|
{diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/pipelines/sd_image.py
RENAMED
|
@@ -172,31 +172,40 @@ class SDImagePipeline(BasePipeline):
|
|
|
172
172
|
else:
|
|
173
173
|
config = model_path_or_config
|
|
174
174
|
|
|
175
|
-
|
|
176
|
-
unet_state_dict = cls.load_model_checkpoint(config.model_path, device="cpu", dtype=config.model_dtype)
|
|
177
|
-
|
|
178
|
-
if config.vae_path is not None:
|
|
179
|
-
logger.info(f"loading state dict from {config.vae_path} ...")
|
|
180
|
-
vae_state_dict = cls.load_model_checkpoint(config.vae_path, device="cpu", dtype=config.vae_dtype)
|
|
181
|
-
else:
|
|
182
|
-
vae_state_dict = unet_state_dict
|
|
183
|
-
|
|
184
|
-
if config.clip_path is not None:
|
|
185
|
-
logger.info(f"loading state dict from {config.clip_path} ...")
|
|
186
|
-
clip_state_dict = cls.load_model_checkpoint(config.clip_path, device="cpu", dtype=config.clip_dtype)
|
|
187
|
-
else:
|
|
188
|
-
clip_state_dict = unet_state_dict
|
|
175
|
+
return cls.from_state_dict(SDStateDicts(), config)
|
|
189
176
|
|
|
177
|
+
@classmethod
|
|
178
|
+
def from_state_dict(cls, state_dicts: SDStateDicts, config: SDPipelineConfig) -> "SDImagePipeline":
|
|
179
|
+
if state_dicts.model is None:
|
|
180
|
+
if config.model_path is None:
|
|
181
|
+
raise ValueError("`model_path` cannot be empty")
|
|
182
|
+
logger.info(f"loading state dict from {config.model_path} ...")
|
|
183
|
+
state_dicts.model = cls.load_model_checkpoint(config.model_path, device="cpu", dtype=config.model_dtype)
|
|
184
|
+
|
|
185
|
+
if state_dicts.vae is None:
|
|
186
|
+
if config.vae_path is None:
|
|
187
|
+
state_dicts.vae = state_dicts.model
|
|
188
|
+
else:
|
|
189
|
+
logger.info(f"loading state dict from {config.vae_path} ...")
|
|
190
|
+
state_dicts.vae = cls.load_model_checkpoint(config.vae_path, device="cpu", dtype=config.vae_dtype)
|
|
191
|
+
|
|
192
|
+
if state_dicts.clip is None:
|
|
193
|
+
if config.clip_path is None:
|
|
194
|
+
state_dicts.clip = state_dicts.model
|
|
195
|
+
else:
|
|
196
|
+
logger.info(f"loading state dict from {config.clip_path} ...")
|
|
197
|
+
state_dicts.clip = cls.load_model_checkpoint(config.clip_path, device="cpu", dtype=config.clip_dtype)
|
|
198
|
+
|
|
190
199
|
init_device = "cpu" if config.offload_mode is not None else config.device
|
|
191
200
|
tokenizer = CLIPTokenizer.from_pretrained(SDXL_TOKENIZER_CONF_PATH)
|
|
192
201
|
with LoRAContext():
|
|
193
|
-
text_encoder = SDTextEncoder.from_state_dict(
|
|
194
|
-
unet = SDUNet.from_state_dict(
|
|
202
|
+
text_encoder = SDTextEncoder.from_state_dict(state_dicts.clip, device=init_device, dtype=config.clip_dtype)
|
|
203
|
+
unet = SDUNet.from_state_dict(state_dicts.model, device=init_device, dtype=config.model_dtype)
|
|
195
204
|
vae_decoder = SDVAEDecoder.from_state_dict(
|
|
196
|
-
|
|
205
|
+
state_dicts.vae, device=init_device, dtype=config.vae_dtype, attn_impl="sdpa"
|
|
197
206
|
)
|
|
198
207
|
vae_encoder = SDVAEEncoder.from_state_dict(
|
|
199
|
-
|
|
208
|
+
state_dicts.vae, device=init_device, dtype=config.vae_dtype, attn_impl="sdpa"
|
|
200
209
|
)
|
|
201
210
|
|
|
202
211
|
pipe = cls(
|
|
@@ -213,10 +222,6 @@ class SDImagePipeline(BasePipeline):
|
|
|
213
222
|
pipe.enable_cpu_offload(config.offload_mode)
|
|
214
223
|
return pipe
|
|
215
224
|
|
|
216
|
-
@classmethod
|
|
217
|
-
def from_state_dict(cls, state_dicts: SDStateDicts, pipeline_config: SDPipelineConfig) -> "SDImagePipeline":
|
|
218
|
-
raise NotImplementedError()
|
|
219
|
-
|
|
220
225
|
def denoising_model(self):
|
|
221
226
|
return self.unet
|
|
222
227
|
|
{diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/pipelines/sdxl_image.py
RENAMED
|
@@ -150,43 +150,53 @@ class SDXLImagePipeline(BasePipeline):
|
|
|
150
150
|
else:
|
|
151
151
|
config = model_path_or_config
|
|
152
152
|
|
|
153
|
-
|
|
154
|
-
unet_state_dict = cls.load_model_checkpoint(config.model_path, device="cpu", dtype=config.model_dtype)
|
|
155
|
-
|
|
156
|
-
if config.vae_path is not None:
|
|
157
|
-
logger.info(f"loading state dict from {config.vae_path} ...")
|
|
158
|
-
vae_state_dict = cls.load_model_checkpoint(config.vae_path, device="cpu", dtype=config.vae_dtype)
|
|
159
|
-
else:
|
|
160
|
-
vae_state_dict = unet_state_dict
|
|
161
|
-
|
|
162
|
-
if config.clip_l_path is not None:
|
|
163
|
-
logger.info(f"loading state dict from {config.clip_l_path} ...")
|
|
164
|
-
clip_l_state_dict = cls.load_model_checkpoint(config.clip_l_path, device="cpu", dtype=config.clip_l_dtype)
|
|
165
|
-
else:
|
|
166
|
-
clip_l_state_dict = unet_state_dict
|
|
167
|
-
|
|
168
|
-
if config.clip_g_path is not None:
|
|
169
|
-
logger.info(f"loading state dict from {config.clip_g_path} ...")
|
|
170
|
-
clip_g_state_dict = cls.load_model_checkpoint(config.clip_g_path, device="cpu", dtype=config.clip_g_dtype)
|
|
171
|
-
else:
|
|
172
|
-
clip_g_state_dict = unet_state_dict
|
|
153
|
+
return cls.from_state_dict(SDXLStateDicts(), config)
|
|
173
154
|
|
|
155
|
+
@classmethod
|
|
156
|
+
def from_state_dict(cls, state_dicts: SDXLStateDicts, config: SDXLPipelineConfig) -> "SDXLImagePipeline":
|
|
157
|
+
if state_dicts.model is None:
|
|
158
|
+
if config.model_path is None:
|
|
159
|
+
raise ValueError("`model_path` cannot be empty")
|
|
160
|
+
logger.info(f"loading state dict from {config.model_path} ...")
|
|
161
|
+
state_dicts.model = cls.load_model_checkpoint(config.model_path, device="cpu", dtype=config.model_dtype)
|
|
162
|
+
|
|
163
|
+
if state_dicts.vae is None:
|
|
164
|
+
if config.vae_path is None:
|
|
165
|
+
state_dicts.vae = state_dicts.model
|
|
166
|
+
else:
|
|
167
|
+
logger.info(f"loading state dict from {config.vae_path} ...")
|
|
168
|
+
state_dicts.vae = cls.load_model_checkpoint(config.vae_path, device="cpu", dtype=config.vae_dtype)
|
|
169
|
+
|
|
170
|
+
if state_dicts.clip_l is None:
|
|
171
|
+
if config.clip_l_path is None:
|
|
172
|
+
state_dicts.clip_l = state_dicts.model
|
|
173
|
+
else:
|
|
174
|
+
logger.info(f"loading state dict from {config.clip_l_path} ...")
|
|
175
|
+
state_dicts.clip_l = cls.load_model_checkpoint(config.clip_l_path, device="cpu", dtype=config.clip_l_dtype)
|
|
176
|
+
|
|
177
|
+
if state_dicts.clip_g is None:
|
|
178
|
+
if config.clip_g_path is None:
|
|
179
|
+
state_dicts.clip_g = state_dicts.model
|
|
180
|
+
else:
|
|
181
|
+
logger.info(f"loading state dict from {config.clip_g_path} ...")
|
|
182
|
+
state_dicts.clip_g = cls.load_model_checkpoint(config.clip_g_path, device="cpu", dtype=config.clip_g_dtype)
|
|
183
|
+
|
|
174
184
|
init_device = "cpu" if config.offload_mode else config.device
|
|
175
185
|
tokenizer = CLIPTokenizer.from_pretrained(SDXL_TOKENIZER_CONF_PATH)
|
|
176
186
|
tokenizer_2 = CLIPTokenizer.from_pretrained(SDXL_TOKENIZER_2_CONF_PATH)
|
|
177
187
|
with LoRAContext():
|
|
178
188
|
text_encoder = SDXLTextEncoder.from_state_dict(
|
|
179
|
-
|
|
189
|
+
state_dicts.clip_l, device=init_device, dtype=config.clip_l_dtype
|
|
180
190
|
)
|
|
181
191
|
text_encoder_2 = SDXLTextEncoder2.from_state_dict(
|
|
182
|
-
|
|
192
|
+
state_dicts.clip_g, device=init_device, dtype=config.clip_g_dtype
|
|
183
193
|
)
|
|
184
|
-
unet = SDXLUNet.from_state_dict(
|
|
194
|
+
unet = SDXLUNet.from_state_dict(state_dicts.model, device=init_device, dtype=config.model_dtype)
|
|
185
195
|
vae_decoder = SDXLVAEDecoder.from_state_dict(
|
|
186
|
-
|
|
196
|
+
state_dicts.vae, device=init_device, dtype=config.vae_dtype, attn_impl="sdpa"
|
|
187
197
|
)
|
|
188
198
|
vae_encoder = SDXLVAEEncoder.from_state_dict(
|
|
189
|
-
|
|
199
|
+
state_dicts.vae, device=init_device, dtype=config.vae_dtype, attn_impl="sdpa"
|
|
190
200
|
)
|
|
191
201
|
|
|
192
202
|
pipe = cls(
|
|
@@ -205,10 +215,6 @@ class SDXLImagePipeline(BasePipeline):
|
|
|
205
215
|
pipe.enable_cpu_offload(config.offload_mode)
|
|
206
216
|
return pipe
|
|
207
217
|
|
|
208
|
-
@classmethod
|
|
209
|
-
def from_state_dict(cls, state_dicts: SDXLStateDicts, pipeline_config: SDXLPipelineConfig) -> "SDXLImagePipeline":
|
|
210
|
-
raise NotImplementedError()
|
|
211
|
-
|
|
212
218
|
def denoising_model(self):
|
|
213
219
|
return self.unet
|
|
214
220
|
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
from diffsynth_engine import
|
|
2
|
-
|
|
1
|
+
from diffsynth_engine import (
|
|
2
|
+
fetch_model,
|
|
3
|
+
FluxPipelineConfig,
|
|
4
|
+
FluxControlNet,
|
|
5
|
+
ControlNetParams,
|
|
6
|
+
FluxImagePipeline,
|
|
7
|
+
FluxStateDicts,
|
|
8
|
+
)
|
|
9
|
+
from typing import List, Tuple, Optional, Callable, Dict
|
|
3
10
|
from PIL import Image
|
|
4
11
|
import torch
|
|
5
12
|
|
|
@@ -7,6 +14,15 @@ import torch
|
|
|
7
14
|
class FluxInpaintingTool:
|
|
8
15
|
def __init__(
|
|
9
16
|
self,
|
|
17
|
+
flux_pipe: FluxImagePipeline,
|
|
18
|
+
controlnet: FluxControlNet
|
|
19
|
+
):
|
|
20
|
+
self.pipe = flux_pipe
|
|
21
|
+
self.controlnet = controlnet
|
|
22
|
+
|
|
23
|
+
@classmethod
|
|
24
|
+
def from_pretrained(
|
|
25
|
+
cls,
|
|
10
26
|
flux_model_path: str,
|
|
11
27
|
device: str = "cuda:0",
|
|
12
28
|
dtype: torch.dtype = torch.bfloat16,
|
|
@@ -18,14 +34,35 @@ class FluxInpaintingTool:
|
|
|
18
34
|
device=device,
|
|
19
35
|
offload_mode=offload_mode,
|
|
20
36
|
)
|
|
21
|
-
|
|
22
|
-
|
|
37
|
+
flux_pipe = FluxImagePipeline.from_pretrained(config)
|
|
38
|
+
controlnet = FluxControlNet.from_pretrained(
|
|
23
39
|
fetch_model(
|
|
24
40
|
"alimama-creative/FLUX.1-dev-Controlnet-Inpainting-Beta", path="diffusion_pytorch_model.safetensors"
|
|
25
41
|
),
|
|
26
42
|
device=device,
|
|
27
43
|
dtype=torch.bfloat16,
|
|
28
44
|
)
|
|
45
|
+
return cls(flux_pipe, controlnet)
|
|
46
|
+
|
|
47
|
+
@classmethod
|
|
48
|
+
def from_state_dict(
|
|
49
|
+
cls,
|
|
50
|
+
flux_state_dicts: FluxStateDicts,
|
|
51
|
+
controlnet_state_dict: Dict[str, torch.Tensor],
|
|
52
|
+
device: str = "cuda:0",
|
|
53
|
+
dtype: torch.dtype = torch.bfloat16,
|
|
54
|
+
offload_mode: Optional[str] = None,
|
|
55
|
+
):
|
|
56
|
+
config = FluxPipelineConfig(
|
|
57
|
+
model_path="",
|
|
58
|
+
model_dtype=dtype,
|
|
59
|
+
device=device,
|
|
60
|
+
offload_mode=offload_mode,
|
|
61
|
+
)
|
|
62
|
+
flux_pipe = FluxImagePipeline.from_state_dict(flux_state_dicts, config)
|
|
63
|
+
controlnet = FluxControlNet.from_state_dict(controlnet_state_dict, device, dtype)
|
|
64
|
+
return cls(flux_pipe, controlnet)
|
|
65
|
+
|
|
29
66
|
|
|
30
67
|
def load_loras(self, lora_list: List[Tuple[str, float]], fused: bool = True, save_original_weight: bool = False):
|
|
31
68
|
self.pipe.load_loras(lora_list, fused, save_original_weight)
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
from diffsynth_engine import
|
|
2
|
-
|
|
1
|
+
from diffsynth_engine import (
|
|
2
|
+
fetch_model,
|
|
3
|
+
FluxPipelineConfig,
|
|
4
|
+
FluxControlNet,
|
|
5
|
+
ControlNetParams,
|
|
6
|
+
FluxImagePipeline,
|
|
7
|
+
FluxStateDicts
|
|
8
|
+
)
|
|
9
|
+
from typing import List, Tuple, Optional, Callable, Dict
|
|
3
10
|
from PIL import Image
|
|
4
11
|
import torch
|
|
5
12
|
|
|
@@ -7,6 +14,15 @@ import torch
|
|
|
7
14
|
class FluxOutpaintingTool:
|
|
8
15
|
def __init__(
|
|
9
16
|
self,
|
|
17
|
+
flux_pipe: FluxImagePipeline,
|
|
18
|
+
controlnet: FluxControlNet,
|
|
19
|
+
):
|
|
20
|
+
self.pipe = flux_pipe
|
|
21
|
+
self.controlnet = controlnet
|
|
22
|
+
|
|
23
|
+
@classmethod
|
|
24
|
+
def from_pretrained(
|
|
25
|
+
cls,
|
|
10
26
|
flux_model_path: str,
|
|
11
27
|
device: str = "cuda:0",
|
|
12
28
|
dtype: torch.dtype = torch.bfloat16,
|
|
@@ -18,14 +34,35 @@ class FluxOutpaintingTool:
|
|
|
18
34
|
device=device,
|
|
19
35
|
offload_mode=offload_mode,
|
|
20
36
|
)
|
|
21
|
-
|
|
22
|
-
|
|
37
|
+
flux_pipe = FluxImagePipeline.from_pretrained(config)
|
|
38
|
+
controlnet = FluxControlNet.from_pretrained(
|
|
23
39
|
fetch_model(
|
|
24
|
-
"alimama-creative/FLUX.1-dev-Controlnet-Inpainting-Beta",
|
|
40
|
+
"alimama-creative/FLUX.1-dev-Controlnet-Inpainting-Beta",
|
|
41
|
+
path="diffusion_pytorch_model.safetensors"
|
|
25
42
|
),
|
|
26
43
|
device=device,
|
|
27
|
-
dtype=torch.bfloat16
|
|
44
|
+
dtype=torch.bfloat16
|
|
45
|
+
)
|
|
46
|
+
return cls(flux_pipe, controlnet)
|
|
47
|
+
|
|
48
|
+
@classmethod
|
|
49
|
+
def from_state_dict(
|
|
50
|
+
cls,
|
|
51
|
+
flux_state_dicts: FluxStateDicts,
|
|
52
|
+
controlnet_state_dict: Dict[str, torch.Tensor],
|
|
53
|
+
device: str = "cuda:0",
|
|
54
|
+
dtype: torch.dtype = torch.bfloat16,
|
|
55
|
+
offload_mode: Optional[str] = None,
|
|
56
|
+
):
|
|
57
|
+
config = FluxPipelineConfig(
|
|
58
|
+
model_path="",
|
|
59
|
+
model_dtype=dtype,
|
|
60
|
+
device=device,
|
|
61
|
+
offload_mode=offload_mode,
|
|
28
62
|
)
|
|
63
|
+
flux_pipe = FluxImagePipeline.from_state_dict(flux_state_dicts, config)
|
|
64
|
+
controlnet = FluxControlNet.from_state_dict(controlnet_state_dict, device, dtype)
|
|
65
|
+
return cls(flux_pipe, controlnet)
|
|
29
66
|
|
|
30
67
|
def load_loras(self, lora_list: List[Tuple[str, float]], fused: bool = True, save_original_weight: bool = False):
|
|
31
68
|
self.pipe.load_loras(lora_list, fused, save_original_weight)
|
|
@@ -5,8 +5,9 @@ from diffsynth_engine import (
|
|
|
5
5
|
FluxIPAdapter,
|
|
6
6
|
FluxRedux,
|
|
7
7
|
fetch_model,
|
|
8
|
+
FluxStateDicts
|
|
8
9
|
)
|
|
9
|
-
from typing import List, Tuple, Optional
|
|
10
|
+
from typing import List, Tuple, Optional, Dict
|
|
10
11
|
from PIL import Image
|
|
11
12
|
import torch
|
|
12
13
|
|
|
@@ -18,8 +19,17 @@ class FluxReduxRefTool:
|
|
|
18
19
|
|
|
19
20
|
def __init__(
|
|
20
21
|
self,
|
|
22
|
+
flux_pipe: FluxImagePipeline,
|
|
23
|
+
redux: FluxRedux,
|
|
24
|
+
):
|
|
25
|
+
self.pipe = flux_pipe
|
|
26
|
+
self.pipe.load_redux(redux)
|
|
27
|
+
|
|
28
|
+
@classmethod
|
|
29
|
+
def from_pretrained(
|
|
30
|
+
cls,
|
|
21
31
|
flux_model_path: str,
|
|
22
|
-
load_text_encoder=True,
|
|
32
|
+
load_text_encoder: bool = True,
|
|
23
33
|
device: str = "cuda:0",
|
|
24
34
|
dtype: torch.dtype = torch.bfloat16,
|
|
25
35
|
offload_mode: Optional[str] = None,
|
|
@@ -31,10 +41,31 @@ class FluxReduxRefTool:
|
|
|
31
41
|
device=device,
|
|
32
42
|
offload_mode=offload_mode,
|
|
33
43
|
)
|
|
34
|
-
|
|
44
|
+
flux_pipe = FluxImagePipeline.from_pretrained(config)
|
|
35
45
|
redux_model_path = fetch_model("muse/flux1-redux-dev", path="flux1-redux-dev.safetensors", revision="v1")
|
|
36
|
-
|
|
37
|
-
|
|
46
|
+
redux = FluxRedux.from_pretrained(redux_model_path, device=device)
|
|
47
|
+
return cls(flux_pipe, redux)
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def from_state_dict(
|
|
51
|
+
cls,
|
|
52
|
+
flux_state_dicts: FluxStateDicts,
|
|
53
|
+
redux_state_dict: Dict[str, torch.Tensor],
|
|
54
|
+
load_text_encoder: bool = True,
|
|
55
|
+
device: str = "cuda:0",
|
|
56
|
+
dtype: torch.dtype = torch.bfloat16,
|
|
57
|
+
offload_mode: Optional[str] = None,
|
|
58
|
+
):
|
|
59
|
+
config = FluxPipelineConfig(
|
|
60
|
+
model_path="",
|
|
61
|
+
model_dtype=dtype,
|
|
62
|
+
load_text_encoder=load_text_encoder,
|
|
63
|
+
device=device,
|
|
64
|
+
offload_mode=offload_mode,
|
|
65
|
+
)
|
|
66
|
+
flux_pipe = FluxImagePipeline.from_state_dict(flux_state_dicts, config)
|
|
67
|
+
redux = FluxRedux.from_state_dict(redux_state_dict, device=device, dtype=dtype)
|
|
68
|
+
return cls(flux_pipe, redux)
|
|
38
69
|
|
|
39
70
|
def load_loras(self, lora_list: List[Tuple[str, float]], fused: bool = True, save_original_weight: bool = False):
|
|
40
71
|
self.pipe.load_loras(lora_list, fused, save_original_weight)
|
|
@@ -5,8 +5,9 @@ from diffsynth_engine import (
|
|
|
5
5
|
FluxImagePipeline,
|
|
6
6
|
FluxRedux,
|
|
7
7
|
fetch_model,
|
|
8
|
+
FluxStateDicts
|
|
8
9
|
)
|
|
9
|
-
from typing import List, Tuple, Optional, Callable
|
|
10
|
+
from typing import List, Tuple, Optional, Callable, Dict
|
|
10
11
|
from PIL import Image
|
|
11
12
|
import torch
|
|
12
13
|
|
|
@@ -19,8 +20,19 @@ class FluxReplaceByControlTool:
|
|
|
19
20
|
|
|
20
21
|
def __init__(
|
|
21
22
|
self,
|
|
23
|
+
flux_pipe: FluxImagePipeline,
|
|
24
|
+
redux: FluxRedux,
|
|
25
|
+
controlnet: FluxControlNet,
|
|
26
|
+
):
|
|
27
|
+
self.pipe = flux_pipe
|
|
28
|
+
self.pipe.load_redux(redux)
|
|
29
|
+
self.controlnet = controlnet
|
|
30
|
+
|
|
31
|
+
@classmethod
|
|
32
|
+
def from_pretrained(
|
|
33
|
+
cls,
|
|
22
34
|
flux_model_path: str,
|
|
23
|
-
load_text_encoder=True,
|
|
35
|
+
load_text_encoder: bool = True,
|
|
24
36
|
device: str = "cuda:0",
|
|
25
37
|
dtype: torch.dtype = torch.bfloat16,
|
|
26
38
|
offload_mode: Optional[str] = None,
|
|
@@ -32,17 +44,42 @@ class FluxReplaceByControlTool:
|
|
|
32
44
|
device=device,
|
|
33
45
|
offload_mode=offload_mode,
|
|
34
46
|
)
|
|
35
|
-
|
|
47
|
+
flux_pipe = FluxImagePipeline.from_pretrained(config)
|
|
36
48
|
redux_model_path = fetch_model("muse/flux1-redux-dev", path="flux1-redux-dev.safetensors", revision="v1")
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
self.controlnet = FluxControlNet.from_pretrained(
|
|
49
|
+
redux = FluxRedux.from_pretrained(redux_model_path, device=device, dtype=dtype)
|
|
50
|
+
controlnet = FluxControlNet.from_pretrained(
|
|
40
51
|
fetch_model(
|
|
41
|
-
"alimama-creative/FLUX.1-dev-Controlnet-Inpainting-Beta",
|
|
52
|
+
"alimama-creative/FLUX.1-dev-Controlnet-Inpainting-Beta",
|
|
53
|
+
path="diffusion_pytorch_model.safetensors"
|
|
42
54
|
),
|
|
43
55
|
device=device,
|
|
44
56
|
dtype=torch.bfloat16,
|
|
45
57
|
)
|
|
58
|
+
return cls(flux_pipe, redux, controlnet)
|
|
59
|
+
|
|
60
|
+
@classmethod
|
|
61
|
+
def from_state_dict(
|
|
62
|
+
cls,
|
|
63
|
+
flux_state_dicts: FluxStateDicts,
|
|
64
|
+
redux_state_dict: Dict[str, torch.Tensor],
|
|
65
|
+
controlnet_state_dict: Dict[str, torch.Tensor],
|
|
66
|
+
load_text_encoder: bool = True,
|
|
67
|
+
device: str = "cuda:0",
|
|
68
|
+
dtype: torch.dtype = torch.bfloat16,
|
|
69
|
+
offload_mode: Optional[str] = None,
|
|
70
|
+
):
|
|
71
|
+
config = FluxPipelineConfig(
|
|
72
|
+
model_path="",
|
|
73
|
+
model_dtype=dtype,
|
|
74
|
+
load_text_encoder=load_text_encoder,
|
|
75
|
+
device=device,
|
|
76
|
+
offload_mode=offload_mode,
|
|
77
|
+
)
|
|
78
|
+
flux_pipe = FluxImagePipeline.from_state_dict(flux_state_dicts, config)
|
|
79
|
+
redux = FluxRedux.from_state_dict(redux_state_dict, device=device, dtype=dtype)
|
|
80
|
+
controlnet = FluxControlNet.from_state_dict(controlnet_state_dict, device=device, dtype=dtype)
|
|
81
|
+
return cls(flux_pipe, redux, controlnet)
|
|
82
|
+
|
|
46
83
|
|
|
47
84
|
def load_loras(self, lora_list: List[Tuple[str, float]], fused: bool = True, save_original_weight: bool = False):
|
|
48
85
|
self.pipe.load_loras(lora_list, fused, save_original_weight)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{diffsynth_engine-0.4.3.dev6 → diffsynth_engine-0.4.3.dev8}/diffsynth_engine/algorithm/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|