Copy disabled (too large)
Download .txt
Showing preview only (16,281K chars total). Download the full file to get everything.
Repository: huggingface/diffusers
Branch: main
Commit: e9b9f25f677b
Files: 2484
Total size: 42.4 MB
Directory structure:
gitextract_5vldy3zt/
├── .ai/
│ ├── AGENTS.md
│ └── skills/
│ ├── model-integration/
│ │ ├── SKILL.md
│ │ └── modular-conversion.md
│ └── parity-testing/
│ ├── SKILL.md
│ ├── checkpoint-mechanism.md
│ └── pitfalls.md
├── .github/
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug-report.yml
│ │ ├── config.yml
│ │ ├── feature_request.md
│ │ ├── feedback.md
│ │ ├── new-model-addition.yml
│ │ ├── remote-vae-pilot-feedback.yml
│ │ └── translate.md
│ ├── PULL_REQUEST_TEMPLATE.md
│ ├── actions/
│ │ └── setup-miniconda/
│ │ └── action.yml
│ └── workflows/
│ ├── benchmark.yml
│ ├── build_docker_images.yml
│ ├── build_documentation.yml
│ ├── build_pr_documentation.yml
│ ├── codeql.yml
│ ├── mirror_community_pipeline.yml
│ ├── nightly_tests.yml
│ ├── notify_slack_about_release.yml
│ ├── pr_dependency_test.yml
│ ├── pr_modular_tests.yml
│ ├── pr_style_bot.yml
│ ├── pr_test_fetcher.yml
│ ├── pr_tests.yml
│ ├── pr_tests_gpu.yml
│ ├── pr_torch_dependency_test.yml
│ ├── push_tests.yml
│ ├── push_tests_fast.yml
│ ├── push_tests_mps.yml
│ ├── pypi_publish.yaml
│ ├── release_tests_fast.yml
│ ├── run_tests_from_a_pr.yml
│ ├── ssh-pr-runner.yml
│ ├── ssh-runner.yml
│ ├── stale.yml
│ ├── trufflehog.yml
│ ├── typos.yml
│ ├── update_metadata.yml
│ └── upload_pr_documentation.yml
├── .gitignore
├── CITATION.cff
├── CODE_OF_CONDUCT.md
├── LICENSE
├── MANIFEST.in
├── Makefile
├── PHILOSOPHY.md
├── README.md
├── _typos.toml
├── benchmarks/
│ ├── README.md
│ ├── __init__.py
│ ├── benchmarking_flux.py
│ ├── benchmarking_ltx.py
│ ├── benchmarking_sdxl.py
│ ├── benchmarking_utils.py
│ ├── benchmarking_wan.py
│ ├── push_results.py
│ ├── requirements.txt
│ └── run_all.py
├── docker/
│ ├── diffusers-doc-builder/
│ │ └── Dockerfile
│ ├── diffusers-onnxruntime-cpu/
│ │ └── Dockerfile
│ ├── diffusers-onnxruntime-cuda/
│ │ └── Dockerfile
│ ├── diffusers-pytorch-cpu/
│ │ └── Dockerfile
│ ├── diffusers-pytorch-cuda/
│ │ └── Dockerfile
│ ├── diffusers-pytorch-minimum-cuda/
│ │ └── Dockerfile
│ └── diffusers-pytorch-xformers-cuda/
│ └── Dockerfile
├── docs/
│ ├── README.md
│ ├── TRANSLATING.md
│ └── source/
│ ├── _config.py
│ ├── en/
│ │ ├── _toctree.yml
│ │ ├── advanced_inference/
│ │ │ └── outpaint.md
│ │ ├── api/
│ │ │ ├── activations.md
│ │ │ ├── attnprocessor.md
│ │ │ ├── cache.md
│ │ │ ├── configuration.md
│ │ │ ├── image_processor.md
│ │ │ ├── internal_classes_overview.md
│ │ │ ├── loaders/
│ │ │ │ ├── ip_adapter.md
│ │ │ │ ├── lora.md
│ │ │ │ ├── peft.md
│ │ │ │ ├── single_file.md
│ │ │ │ ├── textual_inversion.md
│ │ │ │ ├── transformer_sd3.md
│ │ │ │ └── unet.md
│ │ │ ├── logging.md
│ │ │ ├── models/
│ │ │ │ ├── allegro_transformer3d.md
│ │ │ │ ├── asymmetricautoencoderkl.md
│ │ │ │ ├── aura_flow_transformer2d.md
│ │ │ │ ├── auto_model.md
│ │ │ │ ├── autoencoder_dc.md
│ │ │ │ ├── autoencoder_kl_hunyuan_video.md
│ │ │ │ ├── autoencoder_kl_hunyuan_video15.md
│ │ │ │ ├── autoencoder_kl_hunyuanimage.md
│ │ │ │ ├── autoencoder_kl_hunyuanimage_refiner.md
│ │ │ │ ├── autoencoder_kl_wan.md
│ │ │ │ ├── autoencoder_oobleck.md
│ │ │ │ ├── autoencoder_rae.md
│ │ │ │ ├── autoencoder_tiny.md
│ │ │ │ ├── autoencoderkl.md
│ │ │ │ ├── autoencoderkl_allegro.md
│ │ │ │ ├── autoencoderkl_audio_ltx_2.md
│ │ │ │ ├── autoencoderkl_cogvideox.md
│ │ │ │ ├── autoencoderkl_cosmos.md
│ │ │ │ ├── autoencoderkl_ltx_2.md
│ │ │ │ ├── autoencoderkl_ltx_video.md
│ │ │ │ ├── autoencoderkl_magvit.md
│ │ │ │ ├── autoencoderkl_mochi.md
│ │ │ │ ├── autoencoderkl_qwenimage.md
│ │ │ │ ├── bria_transformer.md
│ │ │ │ ├── chroma_transformer.md
│ │ │ │ ├── chronoedit_transformer_3d.md
│ │ │ │ ├── cogvideox_transformer3d.md
│ │ │ │ ├── cogview3plus_transformer2d.md
│ │ │ │ ├── cogview4_transformer2d.md
│ │ │ │ ├── consisid_transformer3d.md
│ │ │ │ ├── consistency_decoder_vae.md
│ │ │ │ ├── controlnet.md
│ │ │ │ ├── controlnet_flux.md
│ │ │ │ ├── controlnet_hunyuandit.md
│ │ │ │ ├── controlnet_sana.md
│ │ │ │ ├── controlnet_sd3.md
│ │ │ │ ├── controlnet_sparsectrl.md
│ │ │ │ ├── controlnet_union.md
│ │ │ │ ├── cosmos_transformer3d.md
│ │ │ │ ├── dit_transformer2d.md
│ │ │ │ ├── easyanimate_transformer3d.md
│ │ │ │ ├── flux2_transformer.md
│ │ │ │ ├── flux_transformer.md
│ │ │ │ ├── glm_image_transformer2d.md
│ │ │ │ ├── helios_transformer3d.md
│ │ │ │ ├── hidream_image_transformer.md
│ │ │ │ ├── hunyuan_transformer2d.md
│ │ │ │ ├── hunyuan_video15_transformer_3d.md
│ │ │ │ ├── hunyuan_video_transformer_3d.md
│ │ │ │ ├── hunyuanimage_transformer_2d.md
│ │ │ │ ├── latte_transformer3d.md
│ │ │ │ ├── longcat_image_transformer2d.md
│ │ │ │ ├── ltx2_video_transformer3d.md
│ │ │ │ ├── ltx_video_transformer3d.md
│ │ │ │ ├── lumina2_transformer2d.md
│ │ │ │ ├── lumina_nextdit2d.md
│ │ │ │ ├── mochi_transformer3d.md
│ │ │ │ ├── omnigen_transformer.md
│ │ │ │ ├── overview.md
│ │ │ │ ├── ovisimage_transformer2d.md
│ │ │ │ ├── pixart_transformer2d.md
│ │ │ │ ├── prior_transformer.md
│ │ │ │ ├── qwenimage_transformer2d.md
│ │ │ │ ├── sana_transformer2d.md
│ │ │ │ ├── sana_video_transformer3d.md
│ │ │ │ ├── sd3_transformer2d.md
│ │ │ │ ├── skyreels_v2_transformer_3d.md
│ │ │ │ ├── stable_audio_transformer.md
│ │ │ │ ├── stable_cascade_unet.md
│ │ │ │ ├── transformer2d.md
│ │ │ │ ├── transformer_bria_fibo.md
│ │ │ │ ├── transformer_temporal.md
│ │ │ │ ├── unet-motion.md
│ │ │ │ ├── unet.md
│ │ │ │ ├── unet2d-cond.md
│ │ │ │ ├── unet2d.md
│ │ │ │ ├── unet3d-cond.md
│ │ │ │ ├── uvit2d.md
│ │ │ │ ├── vq.md
│ │ │ │ ├── wan_animate_transformer_3d.md
│ │ │ │ ├── wan_transformer_3d.md
│ │ │ │ └── z_image_transformer2d.md
│ │ │ ├── modular_diffusers/
│ │ │ │ ├── guiders.md
│ │ │ │ ├── pipeline.md
│ │ │ │ ├── pipeline_blocks.md
│ │ │ │ ├── pipeline_components.md
│ │ │ │ └── pipeline_states.md
│ │ │ ├── normalization.md
│ │ │ ├── outputs.md
│ │ │ ├── parallel.md
│ │ │ ├── pipelines/
│ │ │ │ ├── allegro.md
│ │ │ │ ├── amused.md
│ │ │ │ ├── animatediff.md
│ │ │ │ ├── attend_and_excite.md
│ │ │ │ ├── audioldm.md
│ │ │ │ ├── audioldm2.md
│ │ │ │ ├── aura_flow.md
│ │ │ │ ├── auto_pipeline.md
│ │ │ │ ├── blip_diffusion.md
│ │ │ │ ├── bria_3_2.md
│ │ │ │ ├── bria_fibo.md
│ │ │ │ ├── bria_fibo_edit.md
│ │ │ │ ├── chroma.md
│ │ │ │ ├── chronoedit.md
│ │ │ │ ├── cogvideox.md
│ │ │ │ ├── cogview3.md
│ │ │ │ ├── cogview4.md
│ │ │ │ ├── consisid.md
│ │ │ │ ├── consistency_models.md
│ │ │ │ ├── control_flux_inpaint.md
│ │ │ │ ├── controlnet.md
│ │ │ │ ├── controlnet_flux.md
│ │ │ │ ├── controlnet_hunyuandit.md
│ │ │ │ ├── controlnet_sana.md
│ │ │ │ ├── controlnet_sd3.md
│ │ │ │ ├── controlnet_sdxl.md
│ │ │ │ ├── controlnet_union.md
│ │ │ │ ├── controlnetxs.md
│ │ │ │ ├── controlnetxs_sdxl.md
│ │ │ │ ├── cosmos.md
│ │ │ │ ├── dance_diffusion.md
│ │ │ │ ├── ddim.md
│ │ │ │ ├── ddpm.md
│ │ │ │ ├── deepfloyd_if.md
│ │ │ │ ├── diffedit.md
│ │ │ │ ├── dit.md
│ │ │ │ ├── easyanimate.md
│ │ │ │ ├── flux.md
│ │ │ │ ├── flux2.md
│ │ │ │ ├── framepack.md
│ │ │ │ ├── glm_image.md
│ │ │ │ ├── helios.md
│ │ │ │ ├── hidream.md
│ │ │ │ ├── hunyuan_video.md
│ │ │ │ ├── hunyuan_video15.md
│ │ │ │ ├── hunyuandit.md
│ │ │ │ ├── hunyuanimage21.md
│ │ │ │ ├── i2vgenxl.md
│ │ │ │ ├── kandinsky.md
│ │ │ │ ├── kandinsky3.md
│ │ │ │ ├── kandinsky5_image.md
│ │ │ │ ├── kandinsky5_video.md
│ │ │ │ ├── kandinsky_v22.md
│ │ │ │ ├── kolors.md
│ │ │ │ ├── latent_consistency_models.md
│ │ │ │ ├── latent_diffusion.md
│ │ │ │ ├── latte.md
│ │ │ │ ├── ledits_pp.md
│ │ │ │ ├── longcat_image.md
│ │ │ │ ├── ltx2.md
│ │ │ │ ├── ltx_video.md
│ │ │ │ ├── lumina.md
│ │ │ │ ├── lumina2.md
│ │ │ │ ├── marigold.md
│ │ │ │ ├── mochi.md
│ │ │ │ ├── musicldm.md
│ │ │ │ ├── omnigen.md
│ │ │ │ ├── overview.md
│ │ │ │ ├── ovis_image.md
│ │ │ │ ├── pag.md
│ │ │ │ ├── paint_by_example.md
│ │ │ │ ├── panorama.md
│ │ │ │ ├── pia.md
│ │ │ │ ├── pix2pix.md
│ │ │ │ ├── pixart.md
│ │ │ │ ├── pixart_sigma.md
│ │ │ │ ├── prx.md
│ │ │ │ ├── qwenimage.md
│ │ │ │ ├── sana.md
│ │ │ │ ├── sana_sprint.md
│ │ │ │ ├── sana_video.md
│ │ │ │ ├── self_attention_guidance.md
│ │ │ │ ├── semantic_stable_diffusion.md
│ │ │ │ ├── shap_e.md
│ │ │ │ ├── skyreels_v2.md
│ │ │ │ ├── stable_audio.md
│ │ │ │ ├── stable_cascade.md
│ │ │ │ ├── stable_diffusion/
│ │ │ │ │ ├── adapter.md
│ │ │ │ │ ├── depth2img.md
│ │ │ │ │ ├── gligen.md
│ │ │ │ │ ├── image_variation.md
│ │ │ │ │ ├── img2img.md
│ │ │ │ │ ├── inpaint.md
│ │ │ │ │ ├── latent_upscale.md
│ │ │ │ │ ├── ldm3d_diffusion.md
│ │ │ │ │ ├── overview.md
│ │ │ │ │ ├── sdxl_turbo.md
│ │ │ │ │ ├── stable_diffusion_2.md
│ │ │ │ │ ├── stable_diffusion_3.md
│ │ │ │ │ ├── stable_diffusion_safe.md
│ │ │ │ │ ├── stable_diffusion_xl.md
│ │ │ │ │ ├── svd.md
│ │ │ │ │ ├── text2img.md
│ │ │ │ │ └── upscale.md
│ │ │ │ ├── stable_unclip.md
│ │ │ │ ├── text_to_video.md
│ │ │ │ ├── text_to_video_zero.md
│ │ │ │ ├── unclip.md
│ │ │ │ ├── unidiffuser.md
│ │ │ │ ├── value_guided_sampling.md
│ │ │ │ ├── visualcloze.md
│ │ │ │ ├── wan.md
│ │ │ │ ├── wuerstchen.md
│ │ │ │ └── z_image.md
│ │ │ ├── quantization.md
│ │ │ ├── schedulers/
│ │ │ │ ├── cm_stochastic_iterative.md
│ │ │ │ ├── consistency_decoder.md
│ │ │ │ ├── cosine_dpm.md
│ │ │ │ ├── ddim.md
│ │ │ │ ├── ddim_cogvideox.md
│ │ │ │ ├── ddim_inverse.md
│ │ │ │ ├── ddpm.md
│ │ │ │ ├── deis.md
│ │ │ │ ├── dpm_discrete.md
│ │ │ │ ├── dpm_discrete_ancestral.md
│ │ │ │ ├── dpm_sde.md
│ │ │ │ ├── edm_euler.md
│ │ │ │ ├── edm_multistep_dpm_solver.md
│ │ │ │ ├── euler.md
│ │ │ │ ├── euler_ancestral.md
│ │ │ │ ├── flow_match_euler_discrete.md
│ │ │ │ ├── flow_match_heun_discrete.md
│ │ │ │ ├── helios.md
│ │ │ │ ├── helios_dmd.md
│ │ │ │ ├── heun.md
│ │ │ │ ├── ipndm.md
│ │ │ │ ├── lcm.md
│ │ │ │ ├── lms_discrete.md
│ │ │ │ ├── multistep_dpm_solver.md
│ │ │ │ ├── multistep_dpm_solver_cogvideox.md
│ │ │ │ ├── multistep_dpm_solver_inverse.md
│ │ │ │ ├── overview.md
│ │ │ │ ├── pndm.md
│ │ │ │ ├── repaint.md
│ │ │ │ ├── score_sde_ve.md
│ │ │ │ ├── score_sde_vp.md
│ │ │ │ ├── singlestep_dpm_solver.md
│ │ │ │ ├── stochastic_karras_ve.md
│ │ │ │ ├── tcd.md
│ │ │ │ ├── unipc.md
│ │ │ │ └── vq_diffusion.md
│ │ │ ├── utilities.md
│ │ │ └── video_processor.md
│ │ ├── community_projects.md
│ │ ├── conceptual/
│ │ │ ├── contribution.md
│ │ │ ├── ethical_guidelines.md
│ │ │ ├── evaluation.md
│ │ │ └── philosophy.md
│ │ ├── hybrid_inference/
│ │ │ ├── api_reference.md
│ │ │ └── overview.md
│ │ ├── index.md
│ │ ├── installation.md
│ │ ├── modular_diffusers/
│ │ │ ├── auto_pipeline_blocks.md
│ │ │ ├── components_manager.md
│ │ │ ├── custom_blocks.md
│ │ │ ├── loop_sequential_pipeline_blocks.md
│ │ │ ├── mellon.md
│ │ │ ├── modular_diffusers_states.md
│ │ │ ├── modular_pipeline.md
│ │ │ ├── overview.md
│ │ │ ├── pipeline_block.md
│ │ │ ├── quickstart.md
│ │ │ └── sequential_pipeline_blocks.md
│ │ ├── optimization/
│ │ │ ├── attention_backends.md
│ │ │ ├── cache.md
│ │ │ ├── cache_dit.md
│ │ │ ├── coreml.md
│ │ │ ├── deepcache.md
│ │ │ ├── fp16.md
│ │ │ ├── habana.md
│ │ │ ├── memory.md
│ │ │ ├── mps.md
│ │ │ ├── neuron.md
│ │ │ ├── onnx.md
│ │ │ ├── open_vino.md
│ │ │ ├── para_attn.md
│ │ │ ├── pruna.md
│ │ │ ├── speed-memory-optims.md
│ │ │ ├── tgate.md
│ │ │ ├── tome.md
│ │ │ ├── xdit.md
│ │ │ └── xformers.md
│ │ ├── quantization/
│ │ │ ├── bitsandbytes.md
│ │ │ ├── gguf.md
│ │ │ ├── modelopt.md
│ │ │ ├── overview.md
│ │ │ ├── quanto.md
│ │ │ └── torchao.md
│ │ ├── quicktour.md
│ │ ├── stable_diffusion.md
│ │ ├── training/
│ │ │ ├── adapt_a_model.md
│ │ │ ├── cogvideox.md
│ │ │ ├── controlnet.md
│ │ │ ├── create_dataset.md
│ │ │ ├── custom_diffusion.md
│ │ │ ├── ddpo.md
│ │ │ ├── distributed_inference.md
│ │ │ ├── dreambooth.md
│ │ │ ├── instructpix2pix.md
│ │ │ ├── kandinsky.md
│ │ │ ├── lcm_distill.md
│ │ │ ├── lora.md
│ │ │ ├── overview.md
│ │ │ ├── sdxl.md
│ │ │ ├── t2i_adapters.md
│ │ │ ├── text2image.md
│ │ │ ├── text_inversion.md
│ │ │ ├── unconditional_training.md
│ │ │ └── wuerstchen.md
│ │ ├── tutorials/
│ │ │ ├── autopipeline.md
│ │ │ ├── basic_training.md
│ │ │ └── using_peft_for_inference.md
│ │ └── using-diffusers/
│ │ ├── automodel.md
│ │ ├── batched_inference.md
│ │ ├── callback.md
│ │ ├── conditional_image_generation.md
│ │ ├── consisid.md
│ │ ├── controlling_generation.md
│ │ ├── controlnet.md
│ │ ├── create_a_server.md
│ │ ├── custom_pipeline_overview.md
│ │ ├── depth2img.md
│ │ ├── diffedit.md
│ │ ├── dreambooth.md
│ │ ├── guiders.md
│ │ ├── helios.md
│ │ ├── image_quality.md
│ │ ├── img2img.md
│ │ ├── inference_with_lcm.md
│ │ ├── inference_with_tcd_lora.md
│ │ ├── inpaint.md
│ │ ├── ip_adapter.md
│ │ ├── kandinsky.md
│ │ ├── loading.md
│ │ ├── marigold_usage.md
│ │ ├── omnigen.md
│ │ ├── other-formats.md
│ │ ├── pag.md
│ │ ├── push_to_hub.md
│ │ ├── reusing_seeds.md
│ │ ├── schedulers.md
│ │ ├── sdxl.md
│ │ ├── sdxl_turbo.md
│ │ ├── shap-e.md
│ │ ├── svd.md
│ │ ├── t2i_adapter.md
│ │ ├── text-img2vid.md
│ │ ├── textual_inversion_inference.md
│ │ ├── unconditional_image_generation.md
│ │ ├── weighted_prompts.md
│ │ └── write_own_pipeline.md
│ ├── ja/
│ │ ├── _toctree.yml
│ │ ├── index.md
│ │ ├── installation.md
│ │ ├── quicktour.md
│ │ ├── stable_diffusion.md
│ │ └── tutorials/
│ │ ├── autopipeline.md
│ │ └── tutorial_overview.md
│ ├── ko/
│ │ ├── _toctree.yml
│ │ ├── api/
│ │ │ └── pipelines/
│ │ │ └── stable_diffusion/
│ │ │ └── stable_diffusion_xl.md
│ │ ├── conceptual/
│ │ │ ├── contribution.md
│ │ │ ├── ethical_guidelines.md
│ │ │ ├── evaluation.md
│ │ │ └── philosophy.md
│ │ ├── in_translation.md
│ │ ├── index.md
│ │ ├── installation.md
│ │ ├── optimization/
│ │ │ ├── coreml.md
│ │ │ ├── fp16.md
│ │ │ ├── habana.md
│ │ │ ├── mps.md
│ │ │ ├── onnx.md
│ │ │ ├── open_vino.md
│ │ │ ├── tome.md
│ │ │ ├── torch2.0.md
│ │ │ └── xformers.md
│ │ ├── quicktour.md
│ │ ├── stable_diffusion.md
│ │ ├── training/
│ │ │ ├── adapt_a_model.md
│ │ │ ├── controlnet.md
│ │ │ ├── create_dataset.md
│ │ │ ├── custom_diffusion.md
│ │ │ ├── distributed_inference.md
│ │ │ ├── dreambooth.md
│ │ │ ├── instructpix2pix.md
│ │ │ ├── lora.md
│ │ │ ├── overview.md
│ │ │ ├── text2image.md
│ │ │ ├── text_inversion.md
│ │ │ └── unconditional_training.md
│ │ ├── tutorials/
│ │ │ ├── basic_training.md
│ │ │ └── tutorial_overview.md
│ │ └── using-diffusers/
│ │ ├── conditional_image_generation.md
│ │ ├── controlling_generation.md
│ │ ├── custom_pipeline_overview.md
│ │ ├── depth2img.md
│ │ ├── diffedit.md
│ │ ├── img2img.md
│ │ ├── inpaint.md
│ │ ├── kandinsky.md
│ │ ├── loading.md
│ │ ├── loading_adapters.md
│ │ ├── other-formats.md
│ │ ├── push_to_hub.md
│ │ ├── schedulers.md
│ │ ├── sdxl_turbo.md
│ │ ├── shap-e.md
│ │ ├── stable_diffusion_jax_how_to.md
│ │ ├── svd.md
│ │ ├── textual_inversion_inference.md
│ │ ├── unconditional_image_generation.md
│ │ ├── weighted_prompts.md
│ │ └── write_own_pipeline.md
│ ├── pt/
│ │ ├── _toctree.yml
│ │ ├── index.md
│ │ ├── installation.md
│ │ ├── quicktour.md
│ │ └── stable_diffusion.md
│ └── zh/
│ ├── _toctree.yml
│ ├── community_projects.md
│ ├── conceptual/
│ │ ├── contribution.md
│ │ ├── ethical_guidelines.md
│ │ ├── evaluation.md
│ │ └── philosophy.md
│ ├── hybrid_inference/
│ │ ├── api_reference.md
│ │ ├── overview.md
│ │ └── vae_encode.md
│ ├── index.md
│ ├── installation.md
│ ├── modular_diffusers/
│ │ ├── auto_pipeline_blocks.md
│ │ ├── components_manager.md
│ │ ├── loop_sequential_pipeline_blocks.md
│ │ ├── modular_diffusers_states.md
│ │ ├── modular_pipeline.md
│ │ ├── overview.md
│ │ ├── pipeline_block.md
│ │ ├── quickstart.md
│ │ └── sequential_pipeline_blocks.md
│ ├── optimization/
│ │ ├── cache.md
│ │ ├── coreml.md
│ │ ├── deepcache.md
│ │ ├── fp16.md
│ │ ├── habana.md
│ │ ├── memory.md
│ │ ├── mps.md
│ │ ├── neuron.md
│ │ ├── onnx.md
│ │ ├── open_vino.md
│ │ ├── para_attn.md
│ │ ├── pruna.md
│ │ ├── speed-memory-optims.md
│ │ ├── tgate.md
│ │ ├── tome.md
│ │ ├── xdit.md
│ │ └── xformers.md
│ ├── quicktour.md
│ ├── stable_diffusion.md
│ ├── training/
│ │ ├── adapt_a_model.md
│ │ ├── controlnet.md
│ │ ├── distributed_inference.md
│ │ ├── dreambooth.md
│ │ ├── instructpix2pix.md
│ │ ├── kandinsky.md
│ │ ├── lora.md
│ │ ├── overview.md
│ │ ├── text2image.md
│ │ ├── text_inversion.md
│ │ └── wuerstchen.md
│ └── using-diffusers/
│ ├── consisid.md
│ ├── guiders.md
│ ├── helios.md
│ └── schedulers.md
├── examples/
│ ├── README.md
│ ├── advanced_diffusion_training/
│ │ ├── README.md
│ │ ├── README_flux.md
│ │ ├── requirements.txt
│ │ ├── requirements_flux.txt
│ │ ├── test_dreambooth_lora_flux_advanced.py
│ │ ├── train_dreambooth_lora_flux_advanced.py
│ │ ├── train_dreambooth_lora_sd15_advanced.py
│ │ └── train_dreambooth_lora_sdxl_advanced.py
│ ├── amused/
│ │ ├── README.md
│ │ └── train_amused.py
│ ├── cogvideo/
│ │ ├── README.md
│ │ ├── requirements.txt
│ │ ├── train_cogvideox_image_to_video_lora.py
│ │ └── train_cogvideox_lora.py
│ ├── cogview4-control/
│ │ ├── README.md
│ │ ├── requirements.txt
│ │ └── train_control_cogview4.py
│ ├── community/
│ │ ├── README.md
│ │ ├── README_community_scripts.md
│ │ ├── adaptive_mask_inpainting.py
│ │ ├── bit_diffusion.py
│ │ ├── checkpoint_merger.py
│ │ ├── clip_guided_images_mixing_stable_diffusion.py
│ │ ├── clip_guided_stable_diffusion.py
│ │ ├── clip_guided_stable_diffusion_img2img.py
│ │ ├── cogvideox_ddim_inversion.py
│ │ ├── composable_stable_diffusion.py
│ │ ├── ddim_noise_comparative_analysis.py
│ │ ├── dps_pipeline.py
│ │ ├── edict_pipeline.py
│ │ ├── fresco_v2v.py
│ │ ├── gluegen.py
│ │ ├── hd_painter.py
│ │ ├── iadb.py
│ │ ├── imagic_stable_diffusion.py
│ │ ├── img2img_inpainting.py
│ │ ├── instaflow_one_step.py
│ │ ├── interpolate_stable_diffusion.py
│ │ ├── ip_adapter_face_id.py
│ │ ├── kohya_hires_fix.py
│ │ ├── latent_consistency_img2img.py
│ │ ├── latent_consistency_interpolate.py
│ │ ├── latent_consistency_txt2img.py
│ │ ├── llm_grounded_diffusion.py
│ │ ├── lpw_stable_diffusion.py
│ │ ├── lpw_stable_diffusion_onnx.py
│ │ ├── lpw_stable_diffusion_xl.py
│ │ ├── magic_mix.py
│ │ ├── marigold_depth_estimation.py
│ │ ├── masked_stable_diffusion_img2img.py
│ │ ├── masked_stable_diffusion_xl_img2img.py
│ │ ├── matryoshka.py
│ │ ├── mixture_canvas.py
│ │ ├── mixture_tiling.py
│ │ ├── mixture_tiling_sdxl.py
│ │ ├── mod_controlnet_tile_sr_sdxl.py
│ │ ├── multilingual_stable_diffusion.py
│ │ ├── one_step_unet.py
│ │ ├── pipeline_animatediff_controlnet.py
│ │ ├── pipeline_animatediff_img2video.py
│ │ ├── pipeline_animatediff_ipex.py
│ │ ├── pipeline_controlnet_xl_kolors.py
│ │ ├── pipeline_controlnet_xl_kolors_img2img.py
│ │ ├── pipeline_controlnet_xl_kolors_inpaint.py
│ │ ├── pipeline_demofusion_sdxl.py
│ │ ├── pipeline_fabric.py
│ │ ├── pipeline_faithdiff_stable_diffusion_xl.py
│ │ ├── pipeline_flux_differential_img2img.py
│ │ ├── pipeline_flux_kontext_multiple_images.py
│ │ ├── pipeline_flux_rf_inversion.py
│ │ ├── pipeline_flux_semantic_guidance.py
│ │ ├── pipeline_flux_with_cfg.py
│ │ ├── pipeline_hunyuandit_differential_img2img.py
│ │ ├── pipeline_kolors_differential_img2img.py
│ │ ├── pipeline_kolors_inpainting.py
│ │ ├── pipeline_null_text_inversion.py
│ │ ├── pipeline_prompt2prompt.py
│ │ ├── pipeline_sdxl_style_aligned.py
│ │ ├── pipeline_stable_diffusion_3_differential_img2img.py
│ │ ├── pipeline_stable_diffusion_3_instruct_pix2pix.py
│ │ ├── pipeline_stable_diffusion_boxdiff.py
│ │ ├── pipeline_stable_diffusion_pag.py
│ │ ├── pipeline_stable_diffusion_upscale_ldm3d.py
│ │ ├── pipeline_stable_diffusion_xl_attentive_eraser.py
│ │ ├── pipeline_stable_diffusion_xl_controlnet_adapter.py
│ │ ├── pipeline_stable_diffusion_xl_controlnet_adapter_inpaint.py
│ │ ├── pipeline_stable_diffusion_xl_differential_img2img.py
│ │ ├── pipeline_stable_diffusion_xl_instandid_img2img.py
│ │ ├── pipeline_stable_diffusion_xl_instantid.py
│ │ ├── pipeline_stable_diffusion_xl_ipex.py
│ │ ├── pipeline_stable_diffusion_xl_t5.py
│ │ ├── pipeline_stg_cogvideox.py
│ │ ├── pipeline_stg_hunyuan_video.py
│ │ ├── pipeline_stg_ltx.py
│ │ ├── pipeline_stg_ltx_image2video.py
│ │ ├── pipeline_stg_mochi.py
│ │ ├── pipeline_stg_wan.py
│ │ ├── pipeline_z_image_differential_img2img.py
│ │ ├── pipeline_zero1to3.py
│ │ ├── pipline_flux_fill_controlnet_Inpaint.py
│ │ ├── regional_prompting_stable_diffusion.py
│ │ ├── rerender_a_video.py
│ │ ├── run_onnx_controlnet.py
│ │ ├── run_tensorrt_controlnet.py
│ │ ├── scheduling_ufogen.py
│ │ ├── sd_text2img_k_diffusion.py
│ │ ├── sde_drag.py
│ │ ├── seed_resize_stable_diffusion.py
│ │ ├── speech_to_image_diffusion.py
│ │ ├── stable_diffusion_comparison.py
│ │ ├── stable_diffusion_controlnet_img2img.py
│ │ ├── stable_diffusion_controlnet_inpaint.py
│ │ ├── stable_diffusion_controlnet_inpaint_img2img.py
│ │ ├── stable_diffusion_controlnet_reference.py
│ │ ├── stable_diffusion_ipex.py
│ │ ├── stable_diffusion_mega.py
│ │ ├── stable_diffusion_reference.py
│ │ ├── stable_diffusion_repaint.py
│ │ ├── stable_diffusion_tensorrt_img2img.py
│ │ ├── stable_diffusion_tensorrt_inpaint.py
│ │ ├── stable_diffusion_tensorrt_txt2img.py
│ │ ├── stable_diffusion_xl_controlnet_reference.py
│ │ ├── stable_diffusion_xl_reference.py
│ │ ├── stable_unclip.py
│ │ ├── text_inpainting.py
│ │ ├── tiled_upscaling.py
│ │ ├── unclip_image_interpolation.py
│ │ ├── unclip_text_interpolation.py
│ │ └── wildcard_stable_diffusion.py
│ ├── conftest.py
│ ├── consistency_distillation/
│ │ ├── README.md
│ │ ├── README_sdxl.md
│ │ ├── requirements.txt
│ │ ├── test_lcm_lora.py
│ │ ├── train_lcm_distill_lora_sd_wds.py
│ │ ├── train_lcm_distill_lora_sdxl.py
│ │ ├── train_lcm_distill_lora_sdxl_wds.py
│ │ ├── train_lcm_distill_sd_wds.py
│ │ └── train_lcm_distill_sdxl_wds.py
│ ├── controlnet/
│ │ ├── README.md
│ │ ├── README_flux.md
│ │ ├── README_sd3.md
│ │ ├── README_sdxl.md
│ │ ├── requirements.txt
│ │ ├── requirements_flax.txt
│ │ ├── requirements_flux.txt
│ │ ├── requirements_sd3.txt
│ │ ├── requirements_sdxl.txt
│ │ ├── test_controlnet.py
│ │ ├── train_controlnet.py
│ │ ├── train_controlnet_flax.py
│ │ ├── train_controlnet_flux.py
│ │ ├── train_controlnet_sd3.py
│ │ └── train_controlnet_sdxl.py
│ ├── custom_diffusion/
│ │ ├── README.md
│ │ ├── requirements.txt
│ │ ├── retrieve.py
│ │ ├── test_custom_diffusion.py
│ │ └── train_custom_diffusion.py
│ ├── dreambooth/
│ │ ├── README.md
│ │ ├── README_flux.md
│ │ ├── README_flux2.md
│ │ ├── README_hidream.md
│ │ ├── README_lumina2.md
│ │ ├── README_qwen.md
│ │ ├── README_sana.md
│ │ ├── README_sd3.md
│ │ ├── README_sdxl.md
│ │ ├── README_z_image.md
│ │ ├── convert_to_imagefolder.py
│ │ ├── requirements.txt
│ │ ├── requirements_flax.txt
│ │ ├── requirements_flux.txt
│ │ ├── requirements_hidream.txt
│ │ ├── requirements_sana.txt
│ │ ├── requirements_sd3.txt
│ │ ├── requirements_sdxl.txt
│ │ ├── test_dreambooth.py
│ │ ├── test_dreambooth_flux.py
│ │ ├── test_dreambooth_lora.py
│ │ ├── test_dreambooth_lora_edm.py
│ │ ├── test_dreambooth_lora_flux.py
│ │ ├── test_dreambooth_lora_flux2.py
│ │ ├── test_dreambooth_lora_flux2_klein.py
│ │ ├── test_dreambooth_lora_flux_kontext.py
│ │ ├── test_dreambooth_lora_hidream.py
│ │ ├── test_dreambooth_lora_lumina2.py
│ │ ├── test_dreambooth_lora_qwenimage.py
│ │ ├── test_dreambooth_lora_sana.py
│ │ ├── test_dreambooth_lora_sd3.py
│ │ ├── test_dreambooth_sd3.py
│ │ ├── train_dreambooth.py
│ │ ├── train_dreambooth_flax.py
│ │ ├── train_dreambooth_flux.py
│ │ ├── train_dreambooth_lora.py
│ │ ├── train_dreambooth_lora_flux.py
│ │ ├── train_dreambooth_lora_flux2.py
│ │ ├── train_dreambooth_lora_flux2_img2img.py
│ │ ├── train_dreambooth_lora_flux2_klein.py
│ │ ├── train_dreambooth_lora_flux2_klein_img2img.py
│ │ ├── train_dreambooth_lora_flux_kontext.py
│ │ ├── train_dreambooth_lora_hidream.py
│ │ ├── train_dreambooth_lora_lumina2.py
│ │ ├── train_dreambooth_lora_qwen_image.py
│ │ ├── train_dreambooth_lora_sana.py
│ │ ├── train_dreambooth_lora_sd3.py
│ │ ├── train_dreambooth_lora_sdxl.py
│ │ ├── train_dreambooth_lora_z_image.py
│ │ └── train_dreambooth_sd3.py
│ ├── flux-control/
│ │ ├── README.md
│ │ ├── requirements.txt
│ │ ├── train_control_flux.py
│ │ └── train_control_lora_flux.py
│ ├── inference/
│ │ ├── README.md
│ │ ├── image_to_image.py
│ │ └── inpainting.py
│ ├── instruct_pix2pix/
│ │ ├── README.md
│ │ ├── README_sdxl.md
│ │ ├── requirements.txt
│ │ ├── test_instruct_pix2pix.py
│ │ ├── train_instruct_pix2pix.py
│ │ └── train_instruct_pix2pix_sdxl.py
│ ├── kandinsky2_2/
│ │ └── text_to_image/
│ │ ├── README.md
│ │ ├── requirements.txt
│ │ ├── train_text_to_image_decoder.py
│ │ ├── train_text_to_image_lora_decoder.py
│ │ ├── train_text_to_image_lora_prior.py
│ │ └── train_text_to_image_prior.py
│ ├── model_search/
│ │ ├── README.md
│ │ ├── pipeline_easy.py
│ │ └── requirements.txt
│ ├── reinforcement_learning/
│ │ ├── README.md
│ │ ├── diffusion_policy.py
│ │ └── run_diffuser_locomotion.py
│ ├── research_projects/
│ │ ├── README.md
│ │ ├── anytext/
│ │ │ ├── README.md
│ │ │ ├── anytext.py
│ │ │ ├── anytext_controlnet.py
│ │ │ └── ocr_recog/
│ │ │ ├── RNN.py
│ │ │ ├── RecCTCHead.py
│ │ │ ├── RecModel.py
│ │ │ ├── RecMv1_enhance.py
│ │ │ ├── RecSVTR.py
│ │ │ ├── common.py
│ │ │ └── en_dict.txt
│ │ ├── autoencoder_rae/
│ │ │ ├── README.md
│ │ │ └── train_autoencoder_rae.py
│ │ ├── autoencoderkl/
│ │ │ ├── README.md
│ │ │ ├── requirements.txt
│ │ │ └── train_autoencoderkl.py
│ │ ├── colossalai/
│ │ │ ├── README.md
│ │ │ ├── inference.py
│ │ │ ├── requirement.txt
│ │ │ └── train_dreambooth_colossalai.py
│ │ ├── consistency_training/
│ │ │ ├── README.md
│ │ │ ├── requirements.txt
│ │ │ └── train_cm_ct_unconditional.py
│ │ ├── control_lora/
│ │ │ ├── README.md
│ │ │ └── control_lora.py
│ │ ├── controlnet/
│ │ │ └── train_controlnet_webdataset.py
│ │ ├── diffusion_dpo/
│ │ │ ├── README.md
│ │ │ ├── requirements.txt
│ │ │ ├── train_diffusion_dpo.py
│ │ │ └── train_diffusion_dpo_sdxl.py
│ │ ├── diffusion_orpo/
│ │ │ ├── README.md
│ │ │ ├── requirements.txt
│ │ │ ├── train_diffusion_orpo_sdxl_lora.py
│ │ │ └── train_diffusion_orpo_sdxl_lora_wds.py
│ │ ├── dreambooth_inpaint/
│ │ │ ├── README.md
│ │ │ ├── requirements.txt
│ │ │ ├── train_dreambooth_inpaint.py
│ │ │ └── train_dreambooth_inpaint_lora.py
│ │ ├── flux_lora_quantization/
│ │ │ ├── README.md
│ │ │ ├── accelerate.yaml
│ │ │ ├── compute_embeddings.py
│ │ │ ├── ds2.yaml
│ │ │ └── train_dreambooth_lora_flux_miniature.py
│ │ ├── geodiff/
│ │ │ ├── README.md
│ │ │ └── geodiff_molecule_conformation.ipynb
│ │ ├── gligen/
│ │ │ ├── README.md
│ │ │ ├── dataset.py
│ │ │ ├── demo.ipynb
│ │ │ ├── make_datasets.py
│ │ │ ├── requirements.txt
│ │ │ └── train_gligen_text.py
│ │ ├── instructpix2pix_lora/
│ │ │ ├── README.md
│ │ │ └── train_instruct_pix2pix_lora.py
│ │ ├── intel_opts/
│ │ │ ├── README.md
│ │ │ ├── inference_bf16.py
│ │ │ ├── textual_inversion/
│ │ │ │ ├── README.md
│ │ │ │ ├── requirements.txt
│ │ │ │ └── textual_inversion_bf16.py
│ │ │ └── textual_inversion_dfq/
│ │ │ ├── README.md
│ │ │ ├── requirements.txt
│ │ │ ├── text2images.py
│ │ │ └── textual_inversion.py
│ │ ├── ip_adapter/
│ │ │ ├── README.md
│ │ │ ├── requirements.txt
│ │ │ ├── tutorial_train_faceid.py
│ │ │ ├── tutorial_train_ip-adapter.py
│ │ │ ├── tutorial_train_plus.py
│ │ │ └── tutorial_train_sdxl.py
│ │ ├── lora/
│ │ │ ├── README.md
│ │ │ ├── requirements.txt
│ │ │ └── train_text_to_image_lora.py
│ │ ├── lpl/
│ │ │ ├── README.md
│ │ │ ├── lpl_loss.py
│ │ │ └── train_sdxl_lpl.py
│ │ ├── multi_subject_dreambooth/
│ │ │ ├── README.md
│ │ │ ├── requirements.txt
│ │ │ └── train_multi_subject_dreambooth.py
│ │ ├── multi_subject_dreambooth_inpainting/
│ │ │ ├── README.md
│ │ │ ├── requirements.txt
│ │ │ └── train_multi_subject_dreambooth_inpainting.py
│ │ ├── multi_token_textual_inversion/
│ │ │ ├── README.md
│ │ │ ├── multi_token_clip.py
│ │ │ ├── requirements.txt
│ │ │ ├── requirements_flax.txt
│ │ │ ├── textual_inversion.py
│ │ │ └── textual_inversion_flax.py
│ │ ├── onnxruntime/
│ │ │ ├── README.md
│ │ │ ├── text_to_image/
│ │ │ │ ├── README.md
│ │ │ │ ├── requirements.txt
│ │ │ │ └── train_text_to_image.py
│ │ │ ├── textual_inversion/
│ │ │ │ ├── README.md
│ │ │ │ ├── requirements.txt
│ │ │ │ └── textual_inversion.py
│ │ │ └── unconditional_image_generation/
│ │ │ ├── README.md
│ │ │ ├── requirements.txt
│ │ │ └── train_unconditional.py
│ │ ├── pixart/
│ │ │ ├── .gitignore
│ │ │ ├── controlnet_pixart_alpha.py
│ │ │ ├── pipeline_pixart_alpha_controlnet.py
│ │ │ ├── requirements.txt
│ │ │ ├── run_pixart_alpha_controlnet_pipeline.py
│ │ │ ├── train_controlnet_hf_diffusers.sh
│ │ │ └── train_pixart_controlnet_hf.py
│ │ ├── promptdiffusion/
│ │ │ ├── README.md
│ │ │ ├── convert_original_promptdiffusion_to_diffusers.py
│ │ │ ├── pipeline_prompt_diffusion.py
│ │ │ └── promptdiffusioncontrolnet.py
│ │ ├── pytorch_xla/
│ │ │ ├── inference/
│ │ │ │ └── flux/
│ │ │ │ ├── README.md
│ │ │ │ └── flux_inference.py
│ │ │ └── training/
│ │ │ └── text_to_image/
│ │ │ ├── README.md
│ │ │ ├── requirements.txt
│ │ │ └── train_text_to_image_xla.py
│ │ ├── rdm/
│ │ │ ├── README.md
│ │ │ ├── pipeline_rdm.py
│ │ │ └── retriever.py
│ │ ├── realfill/
│ │ │ ├── README.md
│ │ │ ├── infer.py
│ │ │ ├── requirements.txt
│ │ │ └── train_realfill.py
│ │ ├── sana/
│ │ │ ├── README.md
│ │ │ ├── train_sana_sprint_diffusers.py
│ │ │ └── train_sana_sprint_diffusers.sh
│ │ ├── scheduled_huber_loss_training/
│ │ │ ├── README.md
│ │ │ ├── dreambooth/
│ │ │ │ ├── train_dreambooth.py
│ │ │ │ ├── train_dreambooth_lora.py
│ │ │ │ └── train_dreambooth_lora_sdxl.py
│ │ │ └── text_to_image/
│ │ │ ├── train_text_to_image.py
│ │ │ ├── train_text_to_image_lora.py
│ │ │ ├── train_text_to_image_lora_sdxl.py
│ │ │ └── train_text_to_image_sdxl.py
│ │ ├── sd3_lora_colab/
│ │ │ ├── README.md
│ │ │ ├── compute_embeddings.py
│ │ │ ├── sd3_dreambooth_lora_16gb.ipynb
│ │ │ └── train_dreambooth_lora_sd3_miniature.py
│ │ ├── sdxl_flax/
│ │ │ ├── README.md
│ │ │ ├── sdxl_single.py
│ │ │ └── sdxl_single_aot.py
│ │ ├── vae/
│ │ │ ├── README.md
│ │ │ └── vae_roundtrip.py
│ │ └── wuerstchen/
│ │ └── text_to_image/
│ │ ├── README.md
│ │ ├── __init__.py
│ │ ├── modeling_efficient_net_encoder.py
│ │ ├── requirements.txt
│ │ ├── train_text_to_image_lora_prior.py
│ │ └── train_text_to_image_prior.py
│ ├── server/
│ │ ├── README.md
│ │ ├── requirements.in
│ │ ├── requirements.txt
│ │ └── server.py
│ ├── server-async/
│ │ ├── Pipelines.py
│ │ ├── README.md
│ │ ├── requirements.txt
│ │ ├── serverasync.py
│ │ ├── test.py
│ │ └── utils/
│ │ ├── __init__.py
│ │ ├── requestscopedpipeline.py
│ │ ├── scheduler.py
│ │ ├── utils.py
│ │ └── wrappers.py
│ ├── t2i_adapter/
│ │ ├── README.md
│ │ ├── README_sdxl.md
│ │ ├── requirements.txt
│ │ ├── test_t2i_adapter.py
│ │ └── train_t2i_adapter_sdxl.py
│ ├── test_examples_utils.py
│ ├── text_to_image/
│ │ ├── README.md
│ │ ├── README_sdxl.md
│ │ ├── requirements.txt
│ │ ├── requirements_flax.txt
│ │ ├── requirements_sdxl.txt
│ │ ├── test_text_to_image.py
│ │ ├── test_text_to_image_lora.py
│ │ ├── train_text_to_image.py
│ │ ├── train_text_to_image_flax.py
│ │ ├── train_text_to_image_lora.py
│ │ ├── train_text_to_image_lora_sdxl.py
│ │ └── train_text_to_image_sdxl.py
│ ├── textual_inversion/
│ │ ├── README.md
│ │ ├── README_sdxl.md
│ │ ├── requirements.txt
│ │ ├── requirements_flax.txt
│ │ ├── test_textual_inversion.py
│ │ ├── test_textual_inversion_sdxl.py
│ │ ├── textual_inversion.py
│ │ ├── textual_inversion_flax.py
│ │ └── textual_inversion_sdxl.py
│ ├── unconditional_image_generation/
│ │ ├── README.md
│ │ ├── requirements.txt
│ │ ├── test_unconditional.py
│ │ └── train_unconditional.py
│ └── vqgan/
│ ├── README.md
│ ├── discriminator.py
│ ├── requirements.txt
│ ├── test_vqgan.py
│ └── train_vqgan.py
├── pyproject.toml
├── scripts/
│ ├── __init__.py
│ ├── change_naming_configs_and_checkpoints.py
│ ├── conversion_ldm_uncond.py
│ ├── convert_amused.py
│ ├── convert_animatediff_motion_lora_to_diffusers.py
│ ├── convert_animatediff_motion_module_to_diffusers.py
│ ├── convert_animatediff_sparsectrl_to_diffusers.py
│ ├── convert_asymmetric_vqgan_to_diffusers.py
│ ├── convert_aura_flow_to_diffusers.py
│ ├── convert_blipdiffusion_to_diffusers.py
│ ├── convert_cogvideox_to_diffusers.py
│ ├── convert_cogview3_to_diffusers.py
│ ├── convert_cogview4_to_diffusers.py
│ ├── convert_cogview4_to_diffusers_megatron.py
│ ├── convert_consistency_decoder.py
│ ├── convert_consistency_to_diffusers.py
│ ├── convert_cosmos_to_diffusers.py
│ ├── convert_dance_diffusion_to_diffusers.py
│ ├── convert_dcae_to_diffusers.py
│ ├── convert_ddpm_original_checkpoint_to_diffusers.py
│ ├── convert_diffusers_sdxl_lora_to_webui.py
│ ├── convert_diffusers_to_original_sdxl.py
│ ├── convert_diffusers_to_original_stable_diffusion.py
│ ├── convert_dit_to_diffusers.py
│ ├── convert_flux2_to_diffusers.py
│ ├── convert_flux_to_diffusers.py
│ ├── convert_flux_xlabs_ipadapter_to_diffusers.py
│ ├── convert_gligen_to_diffusers.py
│ ├── convert_hunyuan_image_to_diffusers.py
│ ├── convert_hunyuan_video1_5_to_diffusers.py
│ ├── convert_hunyuan_video_to_diffusers.py
│ ├── convert_hunyuandit_controlnet_to_diffusers.py
│ ├── convert_hunyuandit_to_diffusers.py
│ ├── convert_i2vgen_to_diffusers.py
│ ├── convert_if.py
│ ├── convert_k_upscaler_to_diffusers.py
│ ├── convert_kakao_brain_unclip_to_diffusers.py
│ ├── convert_kandinsky3_unet.py
│ ├── convert_kandinsky_to_diffusers.py
│ ├── convert_ldm_original_checkpoint_to_diffusers.py
│ ├── convert_lora_safetensor_to_diffusers.py
│ ├── convert_ltx2_to_diffusers.py
│ ├── convert_ltx_to_diffusers.py
│ ├── convert_lumina_to_diffusers.py
│ ├── convert_mochi_to_diffusers.py
│ ├── convert_models_diffuser_to_diffusers.py
│ ├── convert_ms_text_to_video_to_diffusers.py
│ ├── convert_music_spectrogram_to_diffusers.py
│ ├── convert_ncsnpp_original_checkpoint_to_diffusers.py
│ ├── convert_omnigen_to_diffusers.py
│ ├── convert_original_audioldm2_to_diffusers.py
│ ├── convert_original_audioldm_to_diffusers.py
│ ├── convert_original_controlnet_to_diffusers.py
│ ├── convert_original_musicldm_to_diffusers.py
│ ├── convert_original_stable_diffusion_to_diffusers.py
│ ├── convert_original_t2i_adapter.py
│ ├── convert_ovis_image_to_diffusers.py
│ ├── convert_pixart_alpha_to_diffusers.py
│ ├── convert_pixart_sigma_to_diffusers.py
│ ├── convert_prx_to_diffusers.py
│ ├── convert_rae_to_diffusers.py
│ ├── convert_sana_controlnet_to_diffusers.py
│ ├── convert_sana_to_diffusers.py
│ ├── convert_sana_video_to_diffusers.py
│ ├── convert_sd3_controlnet_to_diffusers.py
│ ├── convert_sd3_to_diffusers.py
│ ├── convert_shap_e_to_diffusers.py
│ ├── convert_skyreelsv2_to_diffusers.py
│ ├── convert_stable_audio.py
│ ├── convert_stable_cascade.py
│ ├── convert_stable_cascade_lite.py
│ ├── convert_stable_diffusion_checkpoint_to_onnx.py
│ ├── convert_stable_diffusion_controlnet_to_onnx.py
│ ├── convert_stable_diffusion_controlnet_to_tensorrt.py
│ ├── convert_svd_to_diffusers.py
│ ├── convert_tiny_autoencoder_to_diffusers.py
│ ├── convert_unclip_txt2img_to_image_variation.py
│ ├── convert_unidiffuser_to_diffusers.py
│ ├── convert_vae_diff_to_onnx.py
│ ├── convert_vae_pt_to_diffusers.py
│ ├── convert_versatile_diffusion_to_diffusers.py
│ ├── convert_vq_diffusion_to_diffusers.py
│ ├── convert_wan_to_diffusers.py
│ ├── convert_wuerstchen.py
│ ├── convert_zero123_to_diffusers.py
│ ├── extract_lora_from_model.py
│ └── generate_logits.py
├── setup.py
├── src/
│ └── diffusers/
│ ├── __init__.py
│ ├── callbacks.py
│ ├── commands/
│ │ ├── __init__.py
│ │ ├── custom_blocks.py
│ │ ├── diffusers_cli.py
│ │ ├── env.py
│ │ └── fp16_safetensors.py
│ ├── configuration_utils.py
│ ├── dependency_versions_check.py
│ ├── dependency_versions_table.py
│ ├── experimental/
│ │ ├── README.md
│ │ ├── __init__.py
│ │ └── rl/
│ │ ├── __init__.py
│ │ └── value_guided_sampling.py
│ ├── guiders/
│ │ ├── __init__.py
│ │ ├── adaptive_projected_guidance.py
│ │ ├── adaptive_projected_guidance_mix.py
│ │ ├── auto_guidance.py
│ │ ├── classifier_free_guidance.py
│ │ ├── classifier_free_zero_star_guidance.py
│ │ ├── frequency_decoupled_guidance.py
│ │ ├── guider_utils.py
│ │ ├── magnitude_aware_guidance.py
│ │ ├── perturbed_attention_guidance.py
│ │ ├── skip_layer_guidance.py
│ │ ├── smoothed_energy_guidance.py
│ │ └── tangential_classifier_free_guidance.py
│ ├── hooks/
│ │ ├── __init__.py
│ │ ├── _common.py
│ │ ├── _helpers.py
│ │ ├── context_parallel.py
│ │ ├── faster_cache.py
│ │ ├── first_block_cache.py
│ │ ├── group_offloading.py
│ │ ├── hooks.py
│ │ ├── layer_skip.py
│ │ ├── layerwise_casting.py
│ │ ├── mag_cache.py
│ │ ├── pyramid_attention_broadcast.py
│ │ ├── smoothed_energy_guidance_utils.py
│ │ ├── taylorseer_cache.py
│ │ └── utils.py
│ ├── image_processor.py
│ ├── loaders/
│ │ ├── __init__.py
│ │ ├── ip_adapter.py
│ │ ├── lora_base.py
│ │ ├── lora_conversion_utils.py
│ │ ├── lora_pipeline.py
│ │ ├── peft.py
│ │ ├── single_file.py
│ │ ├── single_file_model.py
│ │ ├── single_file_utils.py
│ │ ├── textual_inversion.py
│ │ ├── transformer_flux.py
│ │ ├── transformer_sd3.py
│ │ ├── unet.py
│ │ ├── unet_loader_utils.py
│ │ └── utils.py
│ ├── models/
│ │ ├── README.md
│ │ ├── __init__.py
│ │ ├── _modeling_parallel.py
│ │ ├── activations.py
│ │ ├── adapter.py
│ │ ├── attention.py
│ │ ├── attention_dispatch.py
│ │ ├── attention_flax.py
│ │ ├── attention_processor.py
│ │ ├── auto_model.py
│ │ ├── autoencoders/
│ │ │ ├── __init__.py
│ │ │ ├── autoencoder_asym_kl.py
│ │ │ ├── autoencoder_dc.py
│ │ │ ├── autoencoder_kl.py
│ │ │ ├── autoencoder_kl_allegro.py
│ │ │ ├── autoencoder_kl_cogvideox.py
│ │ │ ├── autoencoder_kl_cosmos.py
│ │ │ ├── autoencoder_kl_flux2.py
│ │ │ ├── autoencoder_kl_hunyuan_video.py
│ │ │ ├── autoencoder_kl_hunyuanimage.py
│ │ │ ├── autoencoder_kl_hunyuanimage_refiner.py
│ │ │ ├── autoencoder_kl_hunyuanvideo15.py
│ │ │ ├── autoencoder_kl_ltx.py
│ │ │ ├── autoencoder_kl_ltx2.py
│ │ │ ├── autoencoder_kl_ltx2_audio.py
│ │ │ ├── autoencoder_kl_magvit.py
│ │ │ ├── autoencoder_kl_mochi.py
│ │ │ ├── autoencoder_kl_qwenimage.py
│ │ │ ├── autoencoder_kl_temporal_decoder.py
│ │ │ ├── autoencoder_kl_wan.py
│ │ │ ├── autoencoder_oobleck.py
│ │ │ ├── autoencoder_rae.py
│ │ │ ├── autoencoder_tiny.py
│ │ │ ├── autoencoder_vidtok.py
│ │ │ ├── consistency_decoder_vae.py
│ │ │ ├── vae.py
│ │ │ └── vq_model.py
│ │ ├── cache_utils.py
│ │ ├── controlnets/
│ │ │ ├── __init__.py
│ │ │ ├── controlnet.py
│ │ │ ├── controlnet_cosmos.py
│ │ │ ├── controlnet_flax.py
│ │ │ ├── controlnet_flux.py
│ │ │ ├── controlnet_hunyuan.py
│ │ │ ├── controlnet_qwenimage.py
│ │ │ ├── controlnet_sana.py
│ │ │ ├── controlnet_sd3.py
│ │ │ ├── controlnet_sparsectrl.py
│ │ │ ├── controlnet_union.py
│ │ │ ├── controlnet_xs.py
│ │ │ ├── controlnet_z_image.py
│ │ │ ├── multicontrolnet.py
│ │ │ └── multicontrolnet_union.py
│ │ ├── downsampling.py
│ │ ├── embeddings.py
│ │ ├── embeddings_flax.py
│ │ ├── lora.py
│ │ ├── model_loading_utils.py
│ │ ├── modeling_flax_pytorch_utils.py
│ │ ├── modeling_flax_utils.py
│ │ ├── modeling_outputs.py
│ │ ├── modeling_pytorch_flax_utils.py
│ │ ├── modeling_utils.py
│ │ ├── normalization.py
│ │ ├── resnet.py
│ │ ├── resnet_flax.py
│ │ ├── transformers/
│ │ │ ├── __init__.py
│ │ │ ├── auraflow_transformer_2d.py
│ │ │ ├── cogvideox_transformer_3d.py
│ │ │ ├── consisid_transformer_3d.py
│ │ │ ├── dit_transformer_2d.py
│ │ │ ├── dual_transformer_2d.py
│ │ │ ├── hunyuan_transformer_2d.py
│ │ │ ├── latte_transformer_3d.py
│ │ │ ├── lumina_nextdit2d.py
│ │ │ ├── pixart_transformer_2d.py
│ │ │ ├── prior_transformer.py
│ │ │ ├── sana_transformer.py
│ │ │ ├── stable_audio_transformer.py
│ │ │ ├── t5_film_transformer.py
│ │ │ ├── transformer_2d.py
│ │ │ ├── transformer_allegro.py
│ │ │ ├── transformer_bria.py
│ │ │ ├── transformer_bria_fibo.py
│ │ │ ├── transformer_chroma.py
│ │ │ ├── transformer_chronoedit.py
│ │ │ ├── transformer_cogview3plus.py
│ │ │ ├── transformer_cogview4.py
│ │ │ ├── transformer_cosmos.py
│ │ │ ├── transformer_easyanimate.py
│ │ │ ├── transformer_flux.py
│ │ │ ├── transformer_flux2.py
│ │ │ ├── transformer_glm_image.py
│ │ │ ├── transformer_helios.py
│ │ │ ├── transformer_hidream_image.py
│ │ │ ├── transformer_hunyuan_video.py
│ │ │ ├── transformer_hunyuan_video15.py
│ │ │ ├── transformer_hunyuan_video_framepack.py
│ │ │ ├── transformer_hunyuanimage.py
│ │ │ ├── transformer_kandinsky.py
│ │ │ ├── transformer_longcat_image.py
│ │ │ ├── transformer_ltx.py
│ │ │ ├── transformer_ltx2.py
│ │ │ ├── transformer_lumina2.py
│ │ │ ├── transformer_mochi.py
│ │ │ ├── transformer_omnigen.py
│ │ │ ├── transformer_ovis_image.py
│ │ │ ├── transformer_prx.py
│ │ │ ├── transformer_qwenimage.py
│ │ │ ├── transformer_sana_video.py
│ │ │ ├── transformer_sd3.py
│ │ │ ├── transformer_skyreels_v2.py
│ │ │ ├── transformer_temporal.py
│ │ │ ├── transformer_wan.py
│ │ │ ├── transformer_wan_animate.py
│ │ │ ├── transformer_wan_vace.py
│ │ │ └── transformer_z_image.py
│ │ ├── unets/
│ │ │ ├── __init__.py
│ │ │ ├── unet_1d.py
│ │ │ ├── unet_1d_blocks.py
│ │ │ ├── unet_2d.py
│ │ │ ├── unet_2d_blocks.py
│ │ │ ├── unet_2d_blocks_flax.py
│ │ │ ├── unet_2d_condition.py
│ │ │ ├── unet_2d_condition_flax.py
│ │ │ ├── unet_3d_blocks.py
│ │ │ ├── unet_3d_condition.py
│ │ │ ├── unet_i2vgen_xl.py
│ │ │ ├── unet_kandinsky3.py
│ │ │ ├── unet_motion_model.py
│ │ │ ├── unet_spatio_temporal_condition.py
│ │ │ ├── unet_stable_cascade.py
│ │ │ └── uvit_2d.py
│ │ ├── upsampling.py
│ │ ├── vae_flax.py
│ │ └── vq_model.py
│ ├── modular_pipelines/
│ │ ├── __init__.py
│ │ ├── components_manager.py
│ │ ├── flux/
│ │ │ ├── __init__.py
│ │ │ ├── before_denoise.py
│ │ │ ├── decoders.py
│ │ │ ├── denoise.py
│ │ │ ├── encoders.py
│ │ │ ├── inputs.py
│ │ │ ├── modular_blocks_flux.py
│ │ │ ├── modular_blocks_flux_kontext.py
│ │ │ └── modular_pipeline.py
│ │ ├── flux2/
│ │ │ ├── __init__.py
│ │ │ ├── before_denoise.py
│ │ │ ├── decoders.py
│ │ │ ├── denoise.py
│ │ │ ├── encoders.py
│ │ │ ├── inputs.py
│ │ │ ├── modular_blocks_flux2.py
│ │ │ ├── modular_blocks_flux2_klein.py
│ │ │ ├── modular_blocks_flux2_klein_base.py
│ │ │ └── modular_pipeline.py
│ │ ├── helios/
│ │ │ ├── __init__.py
│ │ │ ├── before_denoise.py
│ │ │ ├── decoders.py
│ │ │ ├── denoise.py
│ │ │ ├── encoders.py
│ │ │ ├── modular_blocks_helios.py
│ │ │ ├── modular_blocks_helios_pyramid.py
│ │ │ ├── modular_blocks_helios_pyramid_distilled.py
│ │ │ └── modular_pipeline.py
│ │ ├── mellon_node_utils.py
│ │ ├── modular_pipeline.py
│ │ ├── modular_pipeline_utils.py
│ │ ├── qwenimage/
│ │ │ ├── __init__.py
│ │ │ ├── before_denoise.py
│ │ │ ├── decoders.py
│ │ │ ├── denoise.py
│ │ │ ├── encoders.py
│ │ │ ├── inputs.py
│ │ │ ├── modular_blocks_qwenimage.py
│ │ │ ├── modular_blocks_qwenimage_edit.py
│ │ │ ├── modular_blocks_qwenimage_edit_plus.py
│ │ │ ├── modular_blocks_qwenimage_layered.py
│ │ │ ├── modular_pipeline.py
│ │ │ └── prompt_templates.py
│ │ ├── stable_diffusion_xl/
│ │ │ ├── __init__.py
│ │ │ ├── before_denoise.py
│ │ │ ├── decoders.py
│ │ │ ├── denoise.py
│ │ │ ├── encoders.py
│ │ │ ├── modular_blocks_stable_diffusion_xl.py
│ │ │ └── modular_pipeline.py
│ │ ├── wan/
│ │ │ ├── __init__.py
│ │ │ ├── before_denoise.py
│ │ │ ├── decoders.py
│ │ │ ├── denoise.py
│ │ │ ├── encoders.py
│ │ │ ├── modular_blocks_wan.py
│ │ │ ├── modular_blocks_wan22.py
│ │ │ ├── modular_blocks_wan22_i2v.py
│ │ │ ├── modular_blocks_wan_i2v.py
│ │ │ └── modular_pipeline.py
│ │ └── z_image/
│ │ ├── __init__.py
│ │ ├── before_denoise.py
│ │ ├── decoders.py
│ │ ├── denoise.py
│ │ ├── encoders.py
│ │ ├── modular_blocks_z_image.py
│ │ └── modular_pipeline.py
│ ├── optimization.py
│ ├── pipelines/
│ │ ├── README.md
│ │ ├── __init__.py
│ │ ├── allegro/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_allegro.py
│ │ │ └── pipeline_output.py
│ │ ├── amused/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_amused.py
│ │ │ ├── pipeline_amused_img2img.py
│ │ │ └── pipeline_amused_inpaint.py
│ │ ├── animatediff/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_animatediff.py
│ │ │ ├── pipeline_animatediff_controlnet.py
│ │ │ ├── pipeline_animatediff_sdxl.py
│ │ │ ├── pipeline_animatediff_sparsectrl.py
│ │ │ ├── pipeline_animatediff_video2video.py
│ │ │ ├── pipeline_animatediff_video2video_controlnet.py
│ │ │ └── pipeline_output.py
│ │ ├── audioldm/
│ │ │ ├── __init__.py
│ │ │ └── pipeline_audioldm.py
│ │ ├── audioldm2/
│ │ │ ├── __init__.py
│ │ │ ├── modeling_audioldm2.py
│ │ │ └── pipeline_audioldm2.py
│ │ ├── aura_flow/
│ │ │ ├── __init__.py
│ │ │ └── pipeline_aura_flow.py
│ │ ├── auto_pipeline.py
│ │ ├── blip_diffusion/
│ │ │ ├── __init__.py
│ │ │ ├── blip_image_processing.py
│ │ │ ├── modeling_blip2.py
│ │ │ ├── modeling_ctx_clip.py
│ │ │ └── pipeline_blip_diffusion.py
│ │ ├── bria/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_bria.py
│ │ │ └── pipeline_output.py
│ │ ├── bria_fibo/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_bria_fibo.py
│ │ │ ├── pipeline_bria_fibo_edit.py
│ │ │ └── pipeline_output.py
│ │ ├── chroma/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_chroma.py
│ │ │ ├── pipeline_chroma_img2img.py
│ │ │ ├── pipeline_chroma_inpainting.py
│ │ │ └── pipeline_output.py
│ │ ├── chronoedit/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_chronoedit.py
│ │ │ └── pipeline_output.py
│ │ ├── cogvideo/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_cogvideox.py
│ │ │ ├── pipeline_cogvideox_fun_control.py
│ │ │ ├── pipeline_cogvideox_image2video.py
│ │ │ ├── pipeline_cogvideox_video2video.py
│ │ │ └── pipeline_output.py
│ │ ├── cogview3/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_cogview3plus.py
│ │ │ └── pipeline_output.py
│ │ ├── cogview4/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_cogview4.py
│ │ │ ├── pipeline_cogview4_control.py
│ │ │ └── pipeline_output.py
│ │ ├── consisid/
│ │ │ ├── __init__.py
│ │ │ ├── consisid_utils.py
│ │ │ ├── pipeline_consisid.py
│ │ │ └── pipeline_output.py
│ │ ├── consistency_models/
│ │ │ ├── __init__.py
│ │ │ └── pipeline_consistency_models.py
│ │ ├── controlnet/
│ │ │ ├── __init__.py
│ │ │ ├── multicontrolnet.py
│ │ │ ├── pipeline_controlnet.py
│ │ │ ├── pipeline_controlnet_blip_diffusion.py
│ │ │ ├── pipeline_controlnet_img2img.py
│ │ │ ├── pipeline_controlnet_inpaint.py
│ │ │ ├── pipeline_controlnet_inpaint_sd_xl.py
│ │ │ ├── pipeline_controlnet_sd_xl.py
│ │ │ ├── pipeline_controlnet_sd_xl_img2img.py
│ │ │ ├── pipeline_controlnet_union_inpaint_sd_xl.py
│ │ │ ├── pipeline_controlnet_union_sd_xl.py
│ │ │ ├── pipeline_controlnet_union_sd_xl_img2img.py
│ │ │ └── pipeline_flax_controlnet.py
│ │ ├── controlnet_hunyuandit/
│ │ │ ├── __init__.py
│ │ │ └── pipeline_hunyuandit_controlnet.py
│ │ ├── controlnet_sd3/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_stable_diffusion_3_controlnet.py
│ │ │ └── pipeline_stable_diffusion_3_controlnet_inpainting.py
│ │ ├── controlnet_xs/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_controlnet_xs.py
│ │ │ └── pipeline_controlnet_xs_sd_xl.py
│ │ ├── cosmos/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_cosmos2_5_predict.py
│ │ │ ├── pipeline_cosmos2_5_transfer.py
│ │ │ ├── pipeline_cosmos2_text2image.py
│ │ │ ├── pipeline_cosmos2_video2world.py
│ │ │ ├── pipeline_cosmos_text2world.py
│ │ │ ├── pipeline_cosmos_video2world.py
│ │ │ └── pipeline_output.py
│ │ ├── dance_diffusion/
│ │ │ ├── __init__.py
│ │ │ └── pipeline_dance_diffusion.py
│ │ ├── ddim/
│ │ │ ├── __init__.py
│ │ │ └── pipeline_ddim.py
│ │ ├── ddpm/
│ │ │ ├── __init__.py
│ │ │ └── pipeline_ddpm.py
│ │ ├── deepfloyd_if/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_if.py
│ │ │ ├── pipeline_if_img2img.py
│ │ │ ├── pipeline_if_img2img_superresolution.py
│ │ │ ├── pipeline_if_inpainting.py
│ │ │ ├── pipeline_if_inpainting_superresolution.py
│ │ │ ├── pipeline_if_superresolution.py
│ │ │ ├── pipeline_output.py
│ │ │ ├── safety_checker.py
│ │ │ ├── timesteps.py
│ │ │ └── watermark.py
│ │ ├── deprecated/
│ │ │ ├── README.md
│ │ │ ├── __init__.py
│ │ │ ├── alt_diffusion/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── modeling_roberta_series.py
│ │ │ │ ├── pipeline_alt_diffusion.py
│ │ │ │ ├── pipeline_alt_diffusion_img2img.py
│ │ │ │ └── pipeline_output.py
│ │ │ ├── audio_diffusion/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── mel.py
│ │ │ │ └── pipeline_audio_diffusion.py
│ │ │ ├── latent_diffusion_uncond/
│ │ │ │ ├── __init__.py
│ │ │ │ └── pipeline_latent_diffusion_uncond.py
│ │ │ ├── pndm/
│ │ │ │ ├── __init__.py
│ │ │ │ └── pipeline_pndm.py
│ │ │ ├── repaint/
│ │ │ │ ├── __init__.py
│ │ │ │ └── pipeline_repaint.py
│ │ │ ├── score_sde_ve/
│ │ │ │ ├── __init__.py
│ │ │ │ └── pipeline_score_sde_ve.py
│ │ │ ├── spectrogram_diffusion/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── continuous_encoder.py
│ │ │ │ ├── midi_utils.py
│ │ │ │ ├── notes_encoder.py
│ │ │ │ └── pipeline_spectrogram_diffusion.py
│ │ │ ├── stable_diffusion_variants/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── pipeline_cycle_diffusion.py
│ │ │ │ ├── pipeline_onnx_stable_diffusion_inpaint_legacy.py
│ │ │ │ ├── pipeline_stable_diffusion_inpaint_legacy.py
│ │ │ │ ├── pipeline_stable_diffusion_model_editing.py
│ │ │ │ ├── pipeline_stable_diffusion_paradigms.py
│ │ │ │ └── pipeline_stable_diffusion_pix2pix_zero.py
│ │ │ ├── stochastic_karras_ve/
│ │ │ │ ├── __init__.py
│ │ │ │ └── pipeline_stochastic_karras_ve.py
│ │ │ ├── versatile_diffusion/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── modeling_text_unet.py
│ │ │ │ ├── pipeline_versatile_diffusion.py
│ │ │ │ ├── pipeline_versatile_diffusion_dual_guided.py
│ │ │ │ ├── pipeline_versatile_diffusion_image_variation.py
│ │ │ │ └── pipeline_versatile_diffusion_text_to_image.py
│ │ │ └── vq_diffusion/
│ │ │ ├── __init__.py
│ │ │ └── pipeline_vq_diffusion.py
│ │ ├── dit/
│ │ │ ├── __init__.py
│ │ │ └── pipeline_dit.py
│ │ ├── easyanimate/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_easyanimate.py
│ │ │ ├── pipeline_easyanimate_control.py
│ │ │ ├── pipeline_easyanimate_inpaint.py
│ │ │ └── pipeline_output.py
│ │ ├── flux/
│ │ │ ├── __init__.py
│ │ │ ├── modeling_flux.py
│ │ │ ├── pipeline_flux.py
│ │ │ ├── pipeline_flux_control.py
│ │ │ ├── pipeline_flux_control_img2img.py
│ │ │ ├── pipeline_flux_control_inpaint.py
│ │ │ ├── pipeline_flux_controlnet.py
│ │ │ ├── pipeline_flux_controlnet_image_to_image.py
│ │ │ ├── pipeline_flux_controlnet_inpainting.py
│ │ │ ├── pipeline_flux_fill.py
│ │ │ ├── pipeline_flux_img2img.py
│ │ │ ├── pipeline_flux_inpaint.py
│ │ │ ├── pipeline_flux_kontext.py
│ │ │ ├── pipeline_flux_kontext_inpaint.py
│ │ │ ├── pipeline_flux_prior_redux.py
│ │ │ └── pipeline_output.py
│ │ ├── flux2/
│ │ │ ├── __init__.py
│ │ │ ├── image_processor.py
│ │ │ ├── pipeline_flux2.py
│ │ │ ├── pipeline_flux2_klein.py
│ │ │ ├── pipeline_flux2_klein_kv.py
│ │ │ ├── pipeline_output.py
│ │ │ └── system_messages.py
│ │ ├── free_init_utils.py
│ │ ├── free_noise_utils.py
│ │ ├── glm_image/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_glm_image.py
│ │ │ └── pipeline_output.py
│ │ ├── helios/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_helios.py
│ │ │ ├── pipeline_helios_pyramid.py
│ │ │ └── pipeline_output.py
│ │ ├── hidream_image/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_hidream_image.py
│ │ │ └── pipeline_output.py
│ │ ├── hunyuan_image/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_hunyuanimage.py
│ │ │ ├── pipeline_hunyuanimage_refiner.py
│ │ │ └── pipeline_output.py
│ │ ├── hunyuan_video/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_hunyuan_skyreels_image2video.py
│ │ │ ├── pipeline_hunyuan_video.py
│ │ │ ├── pipeline_hunyuan_video_framepack.py
│ │ │ ├── pipeline_hunyuan_video_image2video.py
│ │ │ └── pipeline_output.py
│ │ ├── hunyuan_video1_5/
│ │ │ ├── __init__.py
│ │ │ ├── image_processor.py
│ │ │ ├── pipeline_hunyuan_video1_5.py
│ │ │ ├── pipeline_hunyuan_video1_5_image2video.py
│ │ │ └── pipeline_output.py
│ │ ├── hunyuandit/
│ │ │ ├── __init__.py
│ │ │ └── pipeline_hunyuandit.py
│ │ ├── i2vgen_xl/
│ │ │ ├── __init__.py
│ │ │ └── pipeline_i2vgen_xl.py
│ │ ├── kandinsky/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_kandinsky.py
│ │ │ ├── pipeline_kandinsky_combined.py
│ │ │ ├── pipeline_kandinsky_img2img.py
│ │ │ ├── pipeline_kandinsky_inpaint.py
│ │ │ ├── pipeline_kandinsky_prior.py
│ │ │ └── text_encoder.py
│ │ ├── kandinsky2_2/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_kandinsky2_2.py
│ │ │ ├── pipeline_kandinsky2_2_combined.py
│ │ │ ├── pipeline_kandinsky2_2_controlnet.py
│ │ │ ├── pipeline_kandinsky2_2_controlnet_img2img.py
│ │ │ ├── pipeline_kandinsky2_2_img2img.py
│ │ │ ├── pipeline_kandinsky2_2_inpainting.py
│ │ │ ├── pipeline_kandinsky2_2_prior.py
│ │ │ └── pipeline_kandinsky2_2_prior_emb2emb.py
│ │ ├── kandinsky3/
│ │ │ ├── __init__.py
│ │ │ ├── convert_kandinsky3_unet.py
│ │ │ ├── pipeline_kandinsky3.py
│ │ │ └── pipeline_kandinsky3_img2img.py
│ │ ├── kandinsky5/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_kandinsky.py
│ │ │ ├── pipeline_kandinsky_i2i.py
│ │ │ ├── pipeline_kandinsky_i2v.py
│ │ │ ├── pipeline_kandinsky_t2i.py
│ │ │ └── pipeline_output.py
│ │ ├── kolors/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_kolors.py
│ │ │ ├── pipeline_kolors_img2img.py
│ │ │ ├── pipeline_output.py
│ │ │ ├── text_encoder.py
│ │ │ └── tokenizer.py
│ │ ├── latent_consistency_models/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_latent_consistency_img2img.py
│ │ │ └── pipeline_latent_consistency_text2img.py
│ │ ├── latent_diffusion/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_latent_diffusion.py
│ │ │ └── pipeline_latent_diffusion_superresolution.py
│ │ ├── latte/
│ │ │ ├── __init__.py
│ │ │ └── pipeline_latte.py
│ │ ├── ledits_pp/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_leditspp_stable_diffusion.py
│ │ │ ├── pipeline_leditspp_stable_diffusion_xl.py
│ │ │ └── pipeline_output.py
│ │ ├── longcat_image/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_longcat_image.py
│ │ │ ├── pipeline_longcat_image_edit.py
│ │ │ ├── pipeline_output.py
│ │ │ └── system_messages.py
│ │ ├── ltx/
│ │ │ ├── __init__.py
│ │ │ ├── modeling_latent_upsampler.py
│ │ │ ├── pipeline_ltx.py
│ │ │ ├── pipeline_ltx_condition.py
│ │ │ ├── pipeline_ltx_i2v_long_multi_prompt.py
│ │ │ ├── pipeline_ltx_image2video.py
│ │ │ ├── pipeline_ltx_latent_upsample.py
│ │ │ └── pipeline_output.py
│ │ ├── ltx2/
│ │ │ ├── __init__.py
│ │ │ ├── connectors.py
│ │ │ ├── export_utils.py
│ │ │ ├── latent_upsampler.py
│ │ │ ├── pipeline_ltx2.py
│ │ │ ├── pipeline_ltx2_condition.py
│ │ │ ├── pipeline_ltx2_image2video.py
│ │ │ ├── pipeline_ltx2_latent_upsample.py
│ │ │ ├── pipeline_output.py
│ │ │ ├── utils.py
│ │ │ └── vocoder.py
│ │ ├── lucy/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_lucy_edit.py
│ │ │ └── pipeline_output.py
│ │ ├── lumina/
│ │ │ ├── __init__.py
│ │ │ └── pipeline_lumina.py
│ │ ├── lumina2/
│ │ │ ├── __init__.py
│ │ │ └── pipeline_lumina2.py
│ │ ├── marigold/
│ │ │ ├── __init__.py
│ │ │ ├── marigold_image_processing.py
│ │ │ ├── pipeline_marigold_depth.py
│ │ │ ├── pipeline_marigold_intrinsics.py
│ │ │ └── pipeline_marigold_normals.py
│ │ ├── mochi/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_mochi.py
│ │ │ └── pipeline_output.py
│ │ ├── musicldm/
│ │ │ ├── __init__.py
│ │ │ └── pipeline_musicldm.py
│ │ ├── omnigen/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_omnigen.py
│ │ │ └── processor_omnigen.py
│ │ ├── onnx_utils.py
│ │ ├── ovis_image/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_output.py
│ │ │ └── pipeline_ovis_image.py
│ │ ├── pag/
│ │ │ ├── __init__.py
│ │ │ ├── pag_utils.py
│ │ │ ├── pipeline_pag_controlnet_sd.py
│ │ │ ├── pipeline_pag_controlnet_sd_inpaint.py
│ │ │ ├── pipeline_pag_controlnet_sd_xl.py
│ │ │ ├── pipeline_pag_controlnet_sd_xl_img2img.py
│ │ │ ├── pipeline_pag_hunyuandit.py
│ │ │ ├── pipeline_pag_kolors.py
│ │ │ ├── pipeline_pag_pixart_sigma.py
│ │ │ ├── pipeline_pag_sana.py
│ │ │ ├── pipeline_pag_sd.py
│ │ │ ├── pipeline_pag_sd_3.py
│ │ │ ├── pipeline_pag_sd_3_img2img.py
│ │ │ ├── pipeline_pag_sd_animatediff.py
│ │ │ ├── pipeline_pag_sd_img2img.py
│ │ │ ├── pipeline_pag_sd_inpaint.py
│ │ │ ├── pipeline_pag_sd_xl.py
│ │ │ ├── pipeline_pag_sd_xl_img2img.py
│ │ │ └── pipeline_pag_sd_xl_inpaint.py
│ │ ├── paint_by_example/
│ │ │ ├── __init__.py
│ │ │ ├── image_encoder.py
│ │ │ └── pipeline_paint_by_example.py
│ │ ├── pia/
│ │ │ ├── __init__.py
│ │ │ └── pipeline_pia.py
│ │ ├── pipeline_flax_utils.py
│ │ ├── pipeline_loading_utils.py
│ │ ├── pipeline_utils.py
│ │ ├── pixart_alpha/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_pixart_alpha.py
│ │ │ └── pipeline_pixart_sigma.py
│ │ ├── prx/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_output.py
│ │ │ └── pipeline_prx.py
│ │ ├── qwenimage/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_output.py
│ │ │ ├── pipeline_qwenimage.py
│ │ │ ├── pipeline_qwenimage_controlnet.py
│ │ │ ├── pipeline_qwenimage_controlnet_inpaint.py
│ │ │ ├── pipeline_qwenimage_edit.py
│ │ │ ├── pipeline_qwenimage_edit_inpaint.py
│ │ │ ├── pipeline_qwenimage_edit_plus.py
│ │ │ ├── pipeline_qwenimage_img2img.py
│ │ │ ├── pipeline_qwenimage_inpaint.py
│ │ │ └── pipeline_qwenimage_layered.py
│ │ ├── sana/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_output.py
│ │ │ ├── pipeline_sana.py
│ │ │ ├── pipeline_sana_controlnet.py
│ │ │ ├── pipeline_sana_sprint.py
│ │ │ └── pipeline_sana_sprint_img2img.py
│ │ ├── sana_video/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_output.py
│ │ │ ├── pipeline_sana_video.py
│ │ │ └── pipeline_sana_video_i2v.py
│ │ ├── semantic_stable_diffusion/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_output.py
│ │ │ └── pipeline_semantic_stable_diffusion.py
│ │ ├── shap_e/
│ │ │ ├── __init__.py
│ │ │ ├── camera.py
│ │ │ ├── pipeline_shap_e.py
│ │ │ ├── pipeline_shap_e_img2img.py
│ │ │ └── renderer.py
│ │ ├── skyreels_v2/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_output.py
│ │ │ ├── pipeline_skyreels_v2.py
│ │ │ ├── pipeline_skyreels_v2_diffusion_forcing.py
│ │ │ ├── pipeline_skyreels_v2_diffusion_forcing_i2v.py
│ │ │ ├── pipeline_skyreels_v2_diffusion_forcing_v2v.py
│ │ │ └── pipeline_skyreels_v2_i2v.py
│ │ ├── stable_audio/
│ │ │ ├── __init__.py
│ │ │ ├── modeling_stable_audio.py
│ │ │ └── pipeline_stable_audio.py
│ │ ├── stable_cascade/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_stable_cascade.py
│ │ │ ├── pipeline_stable_cascade_combined.py
│ │ │ └── pipeline_stable_cascade_prior.py
│ │ ├── stable_diffusion/
│ │ │ ├── README.md
│ │ │ ├── __init__.py
│ │ │ ├── clip_image_project_model.py
│ │ │ ├── convert_from_ckpt.py
│ │ │ ├── pipeline_flax_stable_diffusion.py
│ │ │ ├── pipeline_flax_stable_diffusion_img2img.py
│ │ │ ├── pipeline_flax_stable_diffusion_inpaint.py
│ │ │ ├── pipeline_onnx_stable_diffusion.py
│ │ │ ├── pipeline_onnx_stable_diffusion_img2img.py
│ │ │ ├── pipeline_onnx_stable_diffusion_inpaint.py
│ │ │ ├── pipeline_onnx_stable_diffusion_upscale.py
│ │ │ ├── pipeline_output.py
│ │ │ ├── pipeline_stable_diffusion.py
│ │ │ ├── pipeline_stable_diffusion_depth2img.py
│ │ │ ├── pipeline_stable_diffusion_image_variation.py
│ │ │ ├── pipeline_stable_diffusion_img2img.py
│ │ │ ├── pipeline_stable_diffusion_inpaint.py
│ │ │ ├── pipeline_stable_diffusion_instruct_pix2pix.py
│ │ │ ├── pipeline_stable_diffusion_latent_upscale.py
│ │ │ ├── pipeline_stable_diffusion_upscale.py
│ │ │ ├── pipeline_stable_unclip.py
│ │ │ ├── pipeline_stable_unclip_img2img.py
│ │ │ ├── safety_checker.py
│ │ │ ├── safety_checker_flax.py
│ │ │ └── stable_unclip_image_normalizer.py
│ │ ├── stable_diffusion_3/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_output.py
│ │ │ ├── pipeline_stable_diffusion_3.py
│ │ │ ├── pipeline_stable_diffusion_3_img2img.py
│ │ │ └── pipeline_stable_diffusion_3_inpaint.py
│ │ ├── stable_diffusion_attend_and_excite/
│ │ │ ├── __init__.py
│ │ │ └── pipeline_stable_diffusion_attend_and_excite.py
│ │ ├── stable_diffusion_diffedit/
│ │ │ ├── __init__.py
│ │ │ └── pipeline_stable_diffusion_diffedit.py
│ │ ├── stable_diffusion_gligen/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_stable_diffusion_gligen.py
│ │ │ └── pipeline_stable_diffusion_gligen_text_image.py
│ │ ├── stable_diffusion_ldm3d/
│ │ │ ├── __init__.py
│ │ │ └── pipeline_stable_diffusion_ldm3d.py
│ │ ├── stable_diffusion_panorama/
│ │ │ ├── __init__.py
│ │ │ └── pipeline_stable_diffusion_panorama.py
│ │ ├── stable_diffusion_safe/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_output.py
│ │ │ ├── pipeline_stable_diffusion_safe.py
│ │ │ └── safety_checker.py
│ │ ├── stable_diffusion_sag/
│ │ │ ├── __init__.py
│ │ │ └── pipeline_stable_diffusion_sag.py
│ │ ├── stable_diffusion_xl/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_flax_stable_diffusion_xl.py
│ │ │ ├── pipeline_output.py
│ │ │ ├── pipeline_stable_diffusion_xl.py
│ │ │ ├── pipeline_stable_diffusion_xl_img2img.py
│ │ │ ├── pipeline_stable_diffusion_xl_inpaint.py
│ │ │ ├── pipeline_stable_diffusion_xl_instruct_pix2pix.py
│ │ │ └── watermark.py
│ │ ├── stable_video_diffusion/
│ │ │ ├── __init__.py
│ │ │ └── pipeline_stable_video_diffusion.py
│ │ ├── t2i_adapter/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_stable_diffusion_adapter.py
│ │ │ └── pipeline_stable_diffusion_xl_adapter.py
│ │ ├── text_to_video_synthesis/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_output.py
│ │ │ ├── pipeline_text_to_video_synth.py
│ │ │ ├── pipeline_text_to_video_synth_img2img.py
│ │ │ ├── pipeline_text_to_video_zero.py
│ │ │ └── pipeline_text_to_video_zero_sdxl.py
│ │ ├── transformers_loading_utils.py
│ │ ├── unclip/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_unclip.py
│ │ │ ├── pipeline_unclip_image_variation.py
│ │ │ └── text_proj.py
│ │ ├── unidiffuser/
│ │ │ ├── __init__.py
│ │ │ ├── modeling_text_decoder.py
│ │ │ ├── modeling_uvit.py
│ │ │ └── pipeline_unidiffuser.py
│ │ ├── visualcloze/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_visualcloze_combined.py
│ │ │ ├── pipeline_visualcloze_generation.py
│ │ │ └── visualcloze_utils.py
│ │ ├── wan/
│ │ │ ├── __init__.py
│ │ │ ├── image_processor.py
│ │ │ ├── pipeline_output.py
│ │ │ ├── pipeline_wan.py
│ │ │ ├── pipeline_wan_animate.py
│ │ │ ├── pipeline_wan_i2v.py
│ │ │ ├── pipeline_wan_vace.py
│ │ │ └── pipeline_wan_video2video.py
│ │ ├── wuerstchen/
│ │ │ ├── __init__.py
│ │ │ ├── modeling_paella_vq_model.py
│ │ │ ├── modeling_wuerstchen_common.py
│ │ │ ├── modeling_wuerstchen_diffnext.py
│ │ │ ├── modeling_wuerstchen_prior.py
│ │ │ ├── pipeline_wuerstchen.py
│ │ │ ├── pipeline_wuerstchen_combined.py
│ │ │ └── pipeline_wuerstchen_prior.py
│ │ └── z_image/
│ │ ├── __init__.py
│ │ ├── pipeline_output.py
│ │ ├── pipeline_z_image.py
│ │ ├── pipeline_z_image_controlnet.py
│ │ ├── pipeline_z_image_controlnet_inpaint.py
│ │ ├── pipeline_z_image_img2img.py
│ │ ├── pipeline_z_image_inpaint.py
│ │ └── pipeline_z_image_omni.py
│ ├── py.typed
│ ├── quantizers/
│ │ ├── __init__.py
│ │ ├── auto.py
│ │ ├── base.py
│ │ ├── bitsandbytes/
│ │ │ ├── __init__.py
│ │ │ ├── bnb_quantizer.py
│ │ │ └── utils.py
│ │ ├── gguf/
│ │ │ ├── __init__.py
│ │ │ ├── gguf_quantizer.py
│ │ │ └── utils.py
│ │ ├── modelopt/
│ │ │ ├── __init__.py
│ │ │ └── modelopt_quantizer.py
│ │ ├── pipe_quant_config.py
│ │ ├── quantization_config.py
│ │ ├── quanto/
│ │ │ ├── __init__.py
│ │ │ ├── quanto_quantizer.py
│ │ │ └── utils.py
│ │ └── torchao/
│ │ ├── __init__.py
│ │ └── torchao_quantizer.py
│ ├── schedulers/
│ │ ├── README.md
│ │ ├── __init__.py
│ │ ├── deprecated/
│ │ │ ├── __init__.py
│ │ │ ├── scheduling_karras_ve.py
│ │ │ └── scheduling_sde_vp.py
│ │ ├── scheduling_amused.py
│ │ ├── scheduling_consistency_decoder.py
│ │ ├── scheduling_consistency_models.py
│ │ ├── scheduling_cosine_dpmsolver_multistep.py
│ │ ├── scheduling_ddim.py
│ │ ├── scheduling_ddim_cogvideox.py
│ │ ├── scheduling_ddim_flax.py
│ │ ├── scheduling_ddim_inverse.py
│ │ ├── scheduling_ddim_parallel.py
│ │ ├── scheduling_ddpm.py
│ │ ├── scheduling_ddpm_flax.py
│ │ ├── scheduling_ddpm_parallel.py
│ │ ├── scheduling_ddpm_wuerstchen.py
│ │ ├── scheduling_deis_multistep.py
│ │ ├── scheduling_dpm_cogvideox.py
│ │ ├── scheduling_dpmsolver_multistep.py
│ │ ├── scheduling_dpmsolver_multistep_flax.py
│ │ ├── scheduling_dpmsolver_multistep_inverse.py
│ │ ├── scheduling_dpmsolver_sde.py
│ │ ├── scheduling_dpmsolver_singlestep.py
│ │ ├── scheduling_edm_dpmsolver_multistep.py
│ │ ├── scheduling_edm_euler.py
│ │ ├── scheduling_euler_ancestral_discrete.py
│ │ ├── scheduling_euler_discrete.py
│ │ ├── scheduling_euler_discrete_flax.py
│ │ ├── scheduling_flow_match_euler_discrete.py
│ │ ├── scheduling_flow_match_heun_discrete.py
│ │ ├── scheduling_flow_match_lcm.py
│ │ ├── scheduling_helios.py
│ │ ├── scheduling_helios_dmd.py
│ │ ├── scheduling_heun_discrete.py
│ │ ├── scheduling_ipndm.py
│ │ ├── scheduling_k_dpm_2_ancestral_discrete.py
│ │ ├── scheduling_k_dpm_2_discrete.py
│ │ ├── scheduling_karras_ve_flax.py
│ │ ├── scheduling_lcm.py
│ │ ├── scheduling_lms_discrete.py
│ │ ├── scheduling_lms_discrete_flax.py
│ │ ├── scheduling_ltx_euler_ancestral_rf.py
│ │ ├── scheduling_pndm.py
│ │ ├── scheduling_pndm_flax.py
│ │ ├── scheduling_repaint.py
│ │ ├── scheduling_sasolver.py
│ │ ├── scheduling_scm.py
│ │ ├── scheduling_sde_ve.py
│ │ ├── scheduling_sde_ve_flax.py
│ │ ├── scheduling_tcd.py
│ │ ├── scheduling_unclip.py
│ │ ├── scheduling_unipc_multistep.py
│ │ ├── scheduling_utils.py
│ │ ├── scheduling_utils_flax.py
│ │ └── scheduling_vq_diffusion.py
│ ├── training_utils.py
│ ├── utils/
│ │ ├── __init__.py
│ │ ├── accelerate_utils.py
│ │ ├── constants.py
│ │ ├── deprecation_utils.py
│ │ ├── distributed_utils.py
│ │ ├── doc_utils.py
│ │ ├── dummy_bitsandbytes_objects.py
│ │ ├── dummy_flax_and_transformers_objects.py
│ │ ├── dummy_flax_objects.py
│ │ ├── dummy_gguf_objects.py
│ │ ├── dummy_note_seq_objects.py
│ │ ├── dummy_nvidia_modelopt_objects.py
│ │ ├── dummy_onnx_objects.py
│ │ ├── dummy_optimum_quanto_objects.py
│ │ ├── dummy_pt_objects.py
│ │ ├── dummy_torch_and_librosa_objects.py
│ │ ├── dummy_torch_and_scipy_objects.py
│ │ ├── dummy_torch_and_torchsde_objects.py
│ │ ├── dummy_torch_and_transformers_and_onnx_objects.py
│ │ ├── dummy_torch_and_transformers_and_opencv_objects.py
│ │ ├── dummy_torch_and_transformers_and_sentencepiece_objects.py
│ │ ├── dummy_torch_and_transformers_objects.py
│ │ ├── dummy_torchao_objects.py
│ │ ├── dummy_transformers_and_torch_and_note_seq_objects.py
│ │ ├── dynamic_modules_utils.py
│ │ ├── export_utils.py
│ │ ├── hub_utils.py
│ │ ├── import_utils.py
│ │ ├── loading_utils.py
│ │ ├── logging.py
│ │ ├── model_card_template.md
│ │ ├── outputs.py
│ │ ├── peft_utils.py
│ │ ├── pil_utils.py
│ │ ├── remote_utils.py
│ │ ├── source_code_parsing_utils.py
│ │ ├── state_dict_utils.py
│ │ ├── testing_utils.py
│ │ ├── torch_utils.py
│ │ ├── typing_utils.py
│ │ └── versions.py
│ └── video_processor.py
├── tests/
│ ├── __init__.py
│ ├── conftest.py
│ ├── fixtures/
│ │ ├── custom_pipeline/
│ │ │ ├── pipeline.py
│ │ │ └── what_ever.py
│ │ └── elise_format0.mid
│ ├── hooks/
│ │ ├── __init__.py
│ │ ├── test_group_offloading.py
│ │ ├── test_hooks.py
│ │ └── test_mag_cache.py
│ ├── lora/
│ │ ├── __init__.py
│ │ ├── test_lora_layers_auraflow.py
│ │ ├── test_lora_layers_cogvideox.py
│ │ ├── test_lora_layers_cogview4.py
│ │ ├── test_lora_layers_flux.py
│ │ ├── test_lora_layers_flux2.py
│ │ ├── test_lora_layers_helios.py
│ │ ├── test_lora_layers_hunyuanvideo.py
│ │ ├── test_lora_layers_ltx2.py
│ │ ├── test_lora_layers_ltx_video.py
│ │ ├── test_lora_layers_lumina2.py
│ │ ├── test_lora_layers_mochi.py
│ │ ├── test_lora_layers_qwenimage.py
│ │ ├── test_lora_layers_sana.py
│ │ ├── test_lora_layers_sd.py
│ │ ├── test_lora_layers_sd3.py
│ │ ├── test_lora_layers_sdxl.py
│ │ ├── test_lora_layers_wan.py
│ │ ├── test_lora_layers_wanvace.py
│ │ ├── test_lora_layers_z_image.py
│ │ └── utils.py
│ ├── models/
│ │ ├── __init__.py
│ │ ├── autoencoders/
│ │ │ ├── __init__.py
│ │ │ ├── test_models_asymmetric_autoencoder_kl.py
│ │ │ ├── test_models_autoencoder_cosmos.py
│ │ │ ├── test_models_autoencoder_dc.py
│ │ │ ├── test_models_autoencoder_hunyuan_video.py
│ │ │ ├── test_models_autoencoder_kl.py
│ │ │ ├── test_models_autoencoder_kl_cogvideox.py
│ │ │ ├── test_models_autoencoder_kl_ltx2_audio.py
│ │ │ ├── test_models_autoencoder_kl_temporal_decoder.py
│ │ │ ├── test_models_autoencoder_ltx2_video.py
│ │ │ ├── test_models_autoencoder_ltx_video.py
│ │ │ ├── test_models_autoencoder_magvit.py
│ │ │ ├── test_models_autoencoder_mochi.py
│ │ │ ├── test_models_autoencoder_oobleck.py
│ │ │ ├── test_models_autoencoder_rae.py
│ │ │ ├── test_models_autoencoder_tiny.py
│ │ │ ├── test_models_autoencoder_vidtok.py
│ │ │ ├── test_models_autoencoder_wan.py
│ │ │ ├── test_models_consistency_decoder_vae.py
│ │ │ ├── test_models_vq.py
│ │ │ ├── testing_utils.py
│ │ │ └── vae.py
│ │ ├── controlnets/
│ │ │ ├── __init__.py
│ │ │ └── test_models_controlnet_cosmos.py
│ │ ├── test_activations.py
│ │ ├── test_attention_processor.py
│ │ ├── test_layers_utils.py
│ │ ├── test_modeling_common.py
│ │ ├── test_models_auto.py
│ │ ├── testing_utils/
│ │ │ ├── __init__.py
│ │ │ ├── attention.py
│ │ │ ├── cache.py
│ │ │ ├── common.py
│ │ │ ├── compile.py
│ │ │ ├── ip_adapter.py
│ │ │ ├── lora.py
│ │ │ ├── memory.py
│ │ │ ├── parallelism.py
│ │ │ ├── quantization.py
│ │ │ ├── single_file.py
│ │ │ └── training.py
│ │ ├── transformers/
│ │ │ ├── __init__.py
│ │ │ ├── test_models_dit_transformer2d.py
│ │ │ ├── test_models_pixart_transformer2d.py
│ │ │ ├── test_models_prior.py
│ │ │ ├── test_models_transformer_allegro.py
│ │ │ ├── test_models_transformer_aura_flow.py
│ │ │ ├── test_models_transformer_bria.py
│ │ │ ├── test_models_transformer_bria_fibo.py
│ │ │ ├── test_models_transformer_chroma.py
│ │ │ ├── test_models_transformer_cogvideox.py
│ │ │ ├── test_models_transformer_cogview3plus.py
│ │ │ ├── test_models_transformer_cogview4.py
│ │ │ ├── test_models_transformer_consisid.py
│ │ │ ├── test_models_transformer_cosmos.py
│ │ │ ├── test_models_transformer_easyanimate.py
│ │ │ ├── test_models_transformer_flux.py
│ │ │ ├── test_models_transformer_flux2.py
│ │ │ ├── test_models_transformer_helios.py
│ │ │ ├── test_models_transformer_hidream.py
│ │ │ ├── test_models_transformer_hunyuan_1_5.py
│ │ │ ├── test_models_transformer_hunyuan_dit.py
│ │ │ ├── test_models_transformer_hunyuan_video.py
│ │ │ ├── test_models_transformer_hunyuan_video_framepack.py
│ │ │ ├── test_models_transformer_latte.py
│ │ │ ├── test_models_transformer_ltx.py
│ │ │ ├── test_models_transformer_ltx2.py
│ │ │ ├── test_models_transformer_lumina.py
│ │ │ ├── test_models_transformer_lumina2.py
│ │ │ ├── test_models_transformer_mochi.py
│ │ │ ├── test_models_transformer_omnigen.py
│ │ │ ├── test_models_transformer_prx.py
│ │ │ ├── test_models_transformer_qwenimage.py
│ │ │ ├── test_models_transformer_sana.py
│ │ │ ├── test_models_transformer_sana_video.py
│ │ │ ├── test_models_transformer_sd3.py
│ │ │ ├── test_models_transformer_skyreels_v2.py
│ │ │ ├── test_models_transformer_temporal.py
│ │ │ ├── test_models_transformer_wan.py
│ │ │ ├── test_models_transformer_wan_animate.py
│ │ │ ├── test_models_transformer_wan_vace.py
│ │ │ └── test_models_transformer_z_image.py
│ │ └── unets/
│ │ ├── __init__.py
│ │ ├── test_models_unet_1d.py
│ │ ├── test_models_unet_2d.py
│ │ ├── test_models_unet_2d_condition.py
│ │ ├── test_models_unet_3d_condition.py
│ │ ├── test_models_unet_controlnetxs.py
│ │ ├── test_models_unet_motion.py
│ │ ├── test_models_unet_spatiotemporal.py
│ │ ├── test_unet_2d_blocks.py
│ │ └── test_unet_blocks_common.py
│ ├── modular_pipelines/
│ │ ├── __init__.py
│ │ ├── flux/
│ │ │ ├── __init__.py
│ │ │ └── test_modular_pipeline_flux.py
│ │ ├── flux2/
│ │ │ ├── __init__.py
│ │ │ ├── test_modular_pipeline_flux2.py
│ │ │ ├── test_modular_pipeline_flux2_klein.py
│ │ │ └── test_modular_pipeline_flux2_klein_base.py
│ │ ├── helios/
│ │ │ ├── __init__.py
│ │ │ └── test_modular_pipeline_helios.py
│ │ ├── qwen/
│ │ │ ├── __init__.py
│ │ │ └── test_modular_pipeline_qwenimage.py
│ │ ├── stable_diffusion_xl/
│ │ │ ├── __init__.py
│ │ │ └── test_modular_pipeline_stable_diffusion_xl.py
│ │ ├── test_modular_pipelines_common.py
│ │ ├── test_modular_pipelines_custom_blocks.py
│ │ ├── wan/
│ │ │ ├── __init__.py
│ │ │ └── test_modular_pipeline_wan.py
│ │ └── z_image/
│ │ ├── __init__.py
│ │ └── test_modular_pipeline_z_image.py
│ ├── others/
│ │ ├── __init__.py
│ │ ├── test_attention_backends.py
│ │ ├── test_check_copies.py
│ │ ├── test_check_dummies.py
│ │ ├── test_check_support_list.py
│ │ ├── test_config.py
│ │ ├── test_dependencies.py
│ │ ├── test_ema.py
│ │ ├── test_hub_utils.py
│ │ ├── test_image_processor.py
│ │ ├── test_outputs.py
│ │ ├── test_training.py
│ │ ├── test_utils.py
│ │ └── test_video_processor.py
│ ├── pipelines/
│ │ ├── __init__.py
│ │ ├── allegro/
│ │ │ ├── __init__.py
│ │ │ └── test_allegro.py
│ │ ├── animatediff/
│ │ │ ├── __init__.py
│ │ │ ├── test_animatediff.py
│ │ │ ├── test_animatediff_controlnet.py
│ │ │ ├── test_animatediff_sdxl.py
│ │ │ ├── test_animatediff_sparsectrl.py
│ │ │ ├── test_animatediff_video2video.py
│ │ │ └── test_animatediff_video2video_controlnet.py
│ │ ├── audioldm2/
│ │ │ ├── __init__.py
│ │ │ └── test_audioldm2.py
│ │ ├── aura_flow/
│ │ │ ├── __init__.py
│ │ │ └── test_pipeline_aura_flow.py
│ │ ├── bria/
│ │ │ ├── __init__.py
│ │ │ └── test_pipeline_bria.py
│ │ ├── bria_fibo/
│ │ │ ├── __init__.py
│ │ │ └── test_pipeline_bria_fibo.py
│ │ ├── bria_fibo_edit/
│ │ │ ├── __init__.py
│ │ │ └── test_pipeline_bria_fibo_edit.py
│ │ ├── chroma/
│ │ │ ├── __init__.py
│ │ │ ├── test_pipeline_chroma.py
│ │ │ └── test_pipeline_chroma_img2img.py
│ │ ├── chronoedit/
│ │ │ ├── __init__.py
│ │ │ └── test_chronoedit.py
│ │ ├── cogvideo/
│ │ │ ├── __init__.py
│ │ │ ├── test_cogvideox.py
│ │ │ ├── test_cogvideox_fun_control.py
│ │ │ ├── test_cogvideox_image2video.py
│ │ │ └── test_cogvideox_video2video.py
│ │ ├── cogview3/
│ │ │ ├── __init__.py
│ │ │ └── test_cogview3plus.py
│ │ ├── cogview4/
│ │ │ ├── __init__.py
│ │ │ └── test_cogview4.py
│ │ ├── consisid/
│ │ │ ├── __init__.py
│ │ │ └── test_consisid.py
│ │ ├── consistency_models/
│ │ │ ├── __init__.py
│ │ │ └── test_consistency_models.py
│ │ ├── controlnet/
│ │ │ ├── __init__.py
│ │ │ ├── test_controlnet.py
│ │ │ ├── test_controlnet_img2img.py
│ │ │ ├── test_controlnet_inpaint.py
│ │ │ ├── test_controlnet_inpaint_sdxl.py
│ │ │ ├── test_controlnet_sdxl.py
│ │ │ └── test_controlnet_sdxl_img2img.py
│ │ ├── controlnet_flux/
│ │ │ ├── __init__.py
│ │ │ ├── test_controlnet_flux.py
│ │ │ ├── test_controlnet_flux_img2img.py
│ │ │ └── test_controlnet_flux_inpaint.py
│ │ ├── controlnet_hunyuandit/
│ │ │ ├── __init__.py
│ │ │ └── test_controlnet_hunyuandit.py
│ │ ├── controlnet_sd3/
│ │ │ ├── __init__.py
│ │ │ ├── test_controlnet_inpaint_sd3.py
│ │ │ └── test_controlnet_sd3.py
│ │ ├── cosmos/
│ │ │ ├── __init__.py
│ │ │ ├── cosmos_guardrail.py
│ │ │ ├── test_cosmos.py
│ │ │ ├── test_cosmos2_5_predict.py
│ │ │ ├── test_cosmos2_5_transfer.py
│ │ │ ├── test_cosmos2_text2image.py
│ │ │ ├── test_cosmos2_video2world.py
│ │ │ └── test_cosmos_video2world.py
│ │ ├── ddim/
│ │ │ ├── __init__.py
│ │ │ └── test_ddim.py
│ │ ├── ddpm/
│ │ │ ├── __init__.py
│ │ │ └── test_ddpm.py
│ │ ├── deepfloyd_if/
│ │ │ ├── __init__.py
│ │ │ ├── test_if.py
│ │ │ ├── test_if_img2img.py
│ │ │ ├── test_if_img2img_superresolution.py
│ │ │ ├── test_if_inpainting.py
│ │ │ ├── test_if_inpainting_superresolution.py
│ │ │ └── test_if_superresolution.py
│ │ ├── dit/
│ │ │ ├── __init__.py
│ │ │ └── test_dit.py
│ │ ├── easyanimate/
│ │ │ ├── __init__.py
│ │ │ └── test_easyanimate.py
│ │ ├── flux/
│ │ │ ├── __init__.py
│ │ │ ├── test_pipeline_flux.py
│ │ │ ├── test_pipeline_flux_control.py
│ │ │ ├── test_pipeline_flux_control_img2img.py
│ │ │ ├── test_pipeline_flux_control_inpaint.py
│ │ │ ├── test_pipeline_flux_fill.py
│ │ │ ├── test_pipeline_flux_img2img.py
│ │ │ ├── test_pipeline_flux_inpaint.py
│ │ │ ├── test_pipeline_flux_kontext.py
│ │ │ ├── test_pipeline_flux_kontext_inpaint.py
│ │ │ └── test_pipeline_flux_redux.py
│ │ ├── flux2/
│ │ │ ├── __init__.py
│ │ │ ├── test_pipeline_flux2.py
│ │ │ ├── test_pipeline_flux2_klein.py
│ │ │ └── test_pipeline_flux2_klein_kv.py
│ │ ├── glm_image/
│ │ │ ├── __init__.py
│ │ │ └── test_glm_image.py
│ │ ├── helios/
│ │ │ ├── __init__.py
│ │ │ └── test_helios.py
│ │ ├── hidream_image/
│ │ │ ├── __init__.py
│ │ │ └── test_pipeline_hidream.py
│ │ ├── hunyuan_image_21/
│ │ │ ├── __init__.py
│ │ │ └── test_hunyuanimage.py
│ │ ├── hunyuan_video/
│ │ │ ├── __init__.py
│ │ │ ├── test_hunyuan_image2video.py
│ │ │ ├── test_hunyuan_skyreels_image2video.py
│ │ │ ├── test_hunyuan_video.py
│ │ │ └── test_hunyuan_video_framepack.py
│ │ ├── hunyuan_video1_5/
│ │ │ ├── __init__.py
│ │ │ └── test_hunyuan_1_5.py
│ │ ├── hunyuandit/
│ │ │ ├── __init__.py
│ │ │ └── test_hunyuan_dit.py
│ │ ├── ip_adapters/
│ │ │ ├── __init__.py
│ │ │ └── test_ip_adapter_stable_diffusion.py
│ │ ├── kandinsky/
│ │ │ ├── __init__.py
│ │ │ ├── test_kandinsky.py
│ │ │ ├── test_kandinsky_combined.py
│ │ │ ├── test_kandinsky_img2img.py
│ │ │ ├── test_kandinsky_inpaint.py
│ │ │ └── test_kandinsky_prior.py
│ │ ├── kandinsky2_2/
│ │ │ ├── __init__.py
│ │ │ ├── test_kandinsky.py
│ │ │ ├── test_kandinsky_combined.py
│ │ │ ├── test_kandinsky_controlnet.py
│ │ │ ├── test_kandinsky_controlnet_img2img.py
│ │ │ ├── test_kandinsky_img2img.py
│ │ │ ├── test_kandinsky_inpaint.py
│ │ │ ├── test_kandinsky_prior.py
│ │ │ └── test_kandinsky_prior_emb2emb.py
│ │ ├── kandinsky3/
│ │ │ ├── __init__.py
│ │ │ ├── test_kandinsky3.py
│ │ │ └── test_kandinsky3_img2img.py
│ │ ├── kandinsky5/
│ │ │ ├── __init__.py
│ │ │ ├── test_kandinsky5.py
│ │ │ ├── test_kandinsky5_i2i.py
│ │ │ ├── test_kandinsky5_i2v.py
│ │ │ └── test_kandinsky5_t2i.py
│ │ ├── kolors/
│ │ │ ├── __init__.py
│ │ │ ├── test_kolors.py
│ │ │ └── test_kolors_img2img.py
│ │ ├── latent_consistency_models/
│ │ │ ├── __init__.py
│ │ │ ├── test_latent_consistency_models.py
│ │ │ └── test_latent_consistency_models_img2img.py
│ │ ├── latent_diffusion/
│ │ │ ├── __init__.py
│ │ │ ├── test_latent_diffusion.py
│ │ │ └── test_latent_diffusion_superresolution.py
│ │ ├── latte/
│ │ │ ├── __init__.py
│ │ │ └── test_latte.py
│ │ ├── ledits_pp/
│ │ │ ├── __init__.py
│ │ │ ├── test_ledits_pp_stable_diffusion.py
│ │ │ └── test_ledits_pp_stable_diffusion_xl.py
│ │ ├── longcat_image/
│ │ │ └── __init__.py
│ │ ├── ltx/
│ │ │ ├── __init__.py
│ │ │ ├── test_ltx.py
│ │ │ ├── test_ltx_condition.py
│ │ │ ├── test_ltx_image2video.py
│ │ │ └── test_ltx_latent_upsample.py
│ │ ├── ltx2/
│ │ │ ├── __init__.py
│ │ │ ├── test_ltx2.py
│ │ │ └── test_ltx2_image2video.py
│ │ ├── lumina/
│ │ │ ├── __init__.py
│ │ │ └── test_lumina_nextdit.py
│ │ ├── lumina2/
│ │ │ ├── __init__.py
│ │ │ └── test_pipeline_lumina2.py
│ │ ├── marigold/
│ │ │ ├── __init__.py
│ │ │ ├── test_marigold_depth.py
│ │ │ ├── test_marigold_intrinsics.py
│ │ │ └── test_marigold_normals.py
│ │ ├── mochi/
│ │ │ ├── __init__.py
│ │ │ └── test_mochi.py
│ │ ├── omnigen/
│ │ │ ├── __init__.py
│ │ │ └── test_pipeline_omnigen.py
│ │ ├── ovis_image/
│ │ │ └── __init__.py
│ │ ├── pag/
│ │ │ ├── __init__.py
│ │ │ ├── test_pag_animatediff.py
│ │ │ ├── test_pag_controlnet_sd.py
│ │ │ ├── test_pag_controlnet_sd_inpaint.py
│ │ │ ├── test_pag_controlnet_sdxl.py
│ │ │ ├── test_pag_controlnet_sdxl_img2img.py
│ │ │ ├── test_pag_hunyuan_dit.py
│ │ │ ├── test_pag_kolors.py
│ │ │ ├── test_pag_pixart_sigma.py
│ │ │ ├── test_pag_sana.py
│ │ │ ├── test_pag_sd.py
│ │ │ ├── test_pag_sd3.py
│ │ │ ├── test_pag_sd3_img2img.py
│ │ │ ├── test_pag_sd_img2img.py
│ │ │ ├── test_pag_sd_inpaint.py
│ │ │ ├── test_pag_sdxl.py
│ │ │ ├── test_pag_sdxl_img2img.py
│ │ │ └── test_pag_sdxl_inpaint.py
│ │ ├── pipeline_params.py
│ │ ├── pixart_alpha/
│ │ │ ├── __init__.py
│ │ │ └── test_pixart.py
│ │ ├── pixart_sigma/
│ │ │ ├── __init__.py
│ │ │ └── test_pixart.py
│ │ ├── pndm/
│ │ │ ├── __init__.py
│ │ │ └── test_pndm.py
│ │ ├── prx/
│ │ │ ├── __init__.py
│ │ │ └── test_pipeline_prx.py
│ │ ├── qwenimage/
│ │ │ ├── __init__.py
│ │ │ ├── test_qwenimage.py
│ │ │ ├── test_qwenimage_controlnet.py
│ │ │ ├── test_qwenimage_edit.py
│ │ │ ├── test_qwenimage_edit_plus.py
│ │ │ ├── test_qwenimage_img2img.py
│ │ │ └── test_qwenimage_inpaint.py
│ │ ├── sana/
│ │ │ ├── __init__.py
│ │ │ ├── test_sana.py
│ │ │ ├── test_sana_controlnet.py
│ │ │ ├── test_sana_sprint.py
│ │ │ └── test_sana_sprint_img2img.py
│ │ ├── sana_video/
│ │ │ ├── __init__.py
│ │ │ ├── test_sana_video.py
│ │ │ └── test_sana_video_i2v.py
│ │ ├── shap_e/
│ │ │ ├── __init__.py
│ │ │ ├── test_shap_e.py
│ │ │ └── test_shap_e_img2img.py
│ │ ├── skyreels_v2/
│ │ │ ├── __init__.py
│ │ │ ├── test_skyreels_v2.py
│ │ │ ├── test_skyreels_v2_df.py
│ │ │ ├── test_skyreels_v2_df_image_to_video.py
│ │ │ ├── test_skyreels_v2_df_video_to_video.py
│ │ │ └── test_skyreels_v2_image_to_video.py
│ │ ├── stable_audio/
│ │ │ ├── __init__.py
│ │ │ └── test_stable_audio.py
│ │ ├── stable_cascade/
│ │ │ ├── __init__.py
│ │ │ ├── test_stable_cascade_combined.py
│ │ │ ├── test_stable_cascade_decoder.py
│ │ │ └── test_stable_cascade_prior.py
│ │ ├── stable_diffusion/
│ │ │ ├── __init__.py
│ │ │ ├── test_onnx_stable_diffusion.py
│ │ │ ├── test_onnx_stable_diffusion_img2img.py
│ │ │ ├── test_onnx_stable_diffusion_inpaint.py
│ │ │ ├── test_onnx_stable_diffusion_upscale.py
│ │ │ ├── test_stable_diffusion.py
│ │ │ ├── test_stable_diffusion_img2img.py
│ │ │ ├── test_stable_diffusion_inpaint.py
│ │ │ └── test_stable_diffusion_instruction_pix2pix.py
│ │ ├── stable_diffusion_2/
│ │ │ ├── __init__.py
│ │ │ ├── test_stable_diffusion.py
│ │ │ ├── test_stable_diffusion_depth.py
│ │ │ ├── test_stable_diffusion_inpaint.py
│ │ │ ├── test_stable_diffusion_latent_upscale.py
│ │ │ ├── test_stable_diffusion_upscale.py
│ │ │ └── test_stable_diffusion_v_pred.py
│ │ ├── stable_diffusion_3/
│ │ │ ├── __init__.py
│ │ │ ├── test_pipeline_stable_diffusion_3.py
│ │ │ ├── test_pipeline_stable_diffusion_3_img2img.py
│ │ │ └── test_pipeline_stable_diffusion_3_inpaint.py
│ │ ├── stable_diffusion_adapter/
│ │ │ ├── __init__.py
│ │ │ └── test_stable_diffusion_adapter.py
│ │ ├── stable_diffusion_image_variation/
│ │ │ ├── __init__.py
│ │ │ └── test_stable_diffusion_image_variation.py
│ │ ├── stable_diffusion_xl/
│ │ │ ├── __init__.py
│ │ │ ├── test_stable_diffusion_xl.py
│ │ │ ├── test_stable_diffusion_xl_adapter.py
│ │ │ ├── test_stable_diffusion_xl_img2img.py
│ │ │ ├── test_stable_diffusion_xl_inpaint.py
│ │ │ └── test_stable_diffusion_xl_instruction_pix2pix.py
│ │ ├── stable_unclip/
│ │ │ ├── __init__.py
│ │ │ ├── test_stable_unclip.py
│ │ │ └── test_stable_unclip_img2img.py
│ │ ├── stable_video_diffusion/
│ │ │ ├── __init__.py
│ │ │ └── test_stable_video_diffusion.py
│ │ ├── test_pipeline_utils.py
│ │ ├── test_pipelines.py
│ │ ├── test_pipelines_auto.py
│ │ ├── test_pipelines_combined.py
│ │ ├── test_pipelines_common.py
│ │ ├── test_pipelines_onnx_common.py
│ │ ├── visualcloze/
│ │ │ ├── __init__.py
│ │ │ ├── test_pipeline_visualcloze_combined.py
│ │ │ └── test_pipeline_visualcloze_generation.py
│ │ ├── wan/
│ │ │ ├── __init__.py
│ │ │ ├── test_wan.py
│ │ │ ├── test_wan_22.py
│ │ │ ├── test_wan_22_image_to_video.py
│ │ │ ├── test_wan_animate.py
│ │ │ ├── test_wan_image_to_video.py
│ │ │ ├── test_wan_vace.py
│ │ │ └── test_wan_video_to_video.py
│ │ └── z_image/
│ │ ├── __init__.py
│ │ ├── test_z_image.py
│ │ ├── test_z_image_img2img.py
│ │ └── test_z_image_inpaint.py
│ ├── quantization/
│ │ ├── __init__.py
│ │ ├── bnb/
│ │ │ ├── README.md
│ │ │ ├── __init__.py
│ │ │ ├── test_4bit.py
│ │ │ └── test_mixed_int8.py
│ │ ├── gguf/
│ │ │ ├── __init__.py
│ │ │ └── test_gguf.py
│ │ ├── modelopt/
│ │ │ ├── __init__.py
│ │ │ └── test_modelopt.py
│ │ ├── quanto/
│ │ │ ├── __init__.py
│ │ │ └── test_quanto.py
│ │ ├── test_pipeline_level_quantization.py
│ │ ├── test_torch_compile_utils.py
│ │ ├── torchao/
│ │ │ ├── README.md
│ │ │ ├── __init__.py
│ │ │ └── test_torchao.py
│ │ └── utils.py
│ ├── remote/
│ │ ├── __init__.py
│ │ ├── test_remote_decode.py
│ │ └── test_remote_encode.py
│ ├── schedulers/
│ │ ├── __init__.py
│ │ ├── test_scheduler_consistency_model.py
│ │ ├── test_scheduler_ddim.py
│ │ ├── test_scheduler_ddim_inverse.py
│ │ ├── test_scheduler_ddim_parallel.py
│ │ ├── test_scheduler_ddpm.py
│ │ ├── test_scheduler_ddpm_parallel.py
│ │ ├── test_scheduler_deis.py
│ │ ├── test_scheduler_dpm_multi.py
│ │ ├── test_scheduler_dpm_multi_inverse.py
│ │ ├── test_scheduler_dpm_sde.py
│ │ ├── test_scheduler_dpm_single.py
│ │ ├── test_scheduler_edm_dpmsolver_multistep.py
│ │ ├── test_scheduler_edm_euler.py
│ │ ├── test_scheduler_euler.py
│ │ ├── test_scheduler_euler_ancestral.py
│ │ ├── test_scheduler_heun.py
│ │ ├── test_scheduler_ipndm.py
│ │ ├── test_scheduler_kdpm2_ancestral.py
│ │ ├── test_scheduler_kdpm2_discrete.py
│ │ ├── test_scheduler_lcm.py
│ │ ├── test_scheduler_lms.py
│ │ ├── test_scheduler_pndm.py
│ │ ├── test_scheduler_sasolver.py
│ │ ├── test_scheduler_score_sde_ve.py
│ │ ├── test_scheduler_tcd.py
│ │ ├── test_scheduler_unclip.py
│ │ ├── test_scheduler_unipc.py
│ │ ├── test_scheduler_vq_diffusion.py
│ │ └── test_schedulers.py
│ ├── single_file/
│ │ ├── __init__.py
│ │ ├── single_file_testing_utils.py
│ │ ├── test_lumina2_transformer.py
│ │ ├── test_model_autoencoder_dc_single_file.py
│ │ ├── test_model_controlnet_single_file.py
│ │ ├── test_model_flux_transformer_single_file.py
│ │ ├── test_model_motion_adapter_single_file.py
│ │ ├── test_model_sd_cascade_unet_single_file.py
│ │ ├── test_model_vae_single_file.py
│ │ ├── test_model_wan_autoencoder_single_file.py
│ │ ├── test_model_wan_transformer3d_single_file.py
│ │ ├── test_sana_transformer.py
│ │ ├── test_stable_diffusion_controlnet_img2img_single_file.py
│ │ ├── test_stable_diffusion_controlnet_inpaint_single_file.py
│ │ ├── test_stable_diffusion_controlnet_single_file.py
│ │ ├── test_stable_diffusion_img2img_single_file.py
│ │ ├── test_stable_diffusion_inpaint_single_file.py
│ │ ├── test_stable_diffusion_single_file.py
│ │ ├── test_stable_diffusion_upscale_single_file.py
│ │ ├── test_stable_diffusion_xl_adapter_single_file.py
│ │ ├── test_stable_diffusion_xl_controlnet_single_file.py
│ │ ├── test_stable_diffusion_xl_img2img_single_file.py
│ │ ├── test_stable_diffusion_xl_instruct_pix2pix.py
│ │ └── test_stable_diffusion_xl_single_file.py
│ └── testing_utils.py
└── utils/
├── check_config_docstrings.py
├── check_copies.py
├── check_doc_toc.py
├── check_dummies.py
├── check_inits.py
├── check_repo.py
├── check_support_list.py
├── check_table.py
├── consolidated_test_report.py
├── custom_init_isort.py
├── extract_tests_from_mixin.py
├── fetch_latest_release_branch.py
├── fetch_torch_cuda_pipeline_test_matrix.py
├── generate_model_tests.py
├── get_modified_files.py
├── log_reports.py
├── modular_auto_docstring.py
├── notify_benchmarking_status.py
├── notify_community_pipelines_mirror.py
├── notify_slack_about_release.py
├── overwrite_expected_slice.py
├── print_env.py
├── release.py
├── stale.py
├── tests_fetcher.py
└── update_metadata.py
================================================
FILE CONTENTS
================================================
================================================
FILE: .ai/AGENTS.md
================================================
# Diffusers — Agent Guide
## Coding style
Strive to write code as simple and explicit as possible.
- Minimize small helper/utility functions — inline the logic instead. A reader should be able to follow the full flow without jumping between functions.
- No defensive code or unused code paths — do not add fallback paths, safety checks, or configuration options "just in case". When porting from a research repo, delete training-time code paths, experimental flags, and ablation branches entirely — only keep the inference path you are actually integrating.
- Do not guess user intent and silently correct behavior. Make the expected inputs clear in the docstring, and raise a concise error for unsupported cases rather than adding complex fallback logic.
---
### Dependencies
- No new mandatory dependency without discussion (e.g. `einops`)
- Optional deps guarded with `is_X_available()` and a dummy in `utils/dummy_*.py`
## Code formatting
- `make style` and `make fix-copies` should be run as the final step before opening a PR
### Copied Code
- Many classes are kept in sync with a source via a `# Copied from ...` header comment
- Do not edit a `# Copied from` block directly — run `make fix-copies` to propagate changes from the source
- Remove the header to intentionally break the link
### Models
- All layer calls should be visible directly in `forward` — avoid helper functions that hide `nn.Module` calls.
- Avoid graph breaks for `torch.compile` compatibility — do not insert NumPy operations in forward implementations and any other patterns that can break `torch.compile` compatibility with `fullgraph=True`.
- See the **model-integration** skill for the attention pattern, pipeline rules, test setup instructions, and other important details.
## Skills
Task-specific guides live in `.ai/skills/` and are loaded on demand by AI agents.
Available skills: **model-integration** (adding/converting pipelines), **parity-testing** (debugging numerical parity).
================================================
FILE: .ai/skills/model-integration/SKILL.md
================================================
---
name: integrating-models
description: >
Use when adding a new model or pipeline to diffusers, setting up file
structure for a new model, converting a pipeline to modular format, or
converting weights for a new version of an already-supported model.
---
## Goal
Integrate a new model into diffusers end-to-end. The overall flow:
1. **Gather info** — ask the user for the reference repo, setup guide, a runnable inference script, and other objectives such as standard vs modular.
2. **Confirm the plan** — once you have everything, tell the user exactly what you'll do: e.g. "I'll integrate model X with pipeline Y into diffusers based on your script. I'll run parity tests (model-level and pipeline-level) using the `parity-testing` skill to verify numerical correctness against the reference."
3. **Implement** — write the diffusers code (model, pipeline, scheduler if needed), convert weights, register in `__init__.py`.
4. **Parity test** — use the `parity-testing` skill to verify component and e2e parity against the reference implementation.
5. **Deliver a unit test** — provide a self-contained test script that runs the diffusers implementation, checks numerical output (np allclose), and saves an image/video for visual verification. This is what the user runs to confirm everything works.
Work one workflow at a time — get it to full parity before moving on.
## Setup — gather before starting
Before writing any code, gather info in this order:
1. **Reference repo** — ask for the github link. If they've already set it up locally, ask for the path. Otherwise, ask what setup steps are needed (install deps, download checkpoints, set env vars, etc.) and run through them before proceeding.
2. **Inference script** — ask for a runnable end-to-end script for a basic workflow first (e.g. T2V). Then ask what other workflows they want to support (I2V, V2V, etc.) and agree on the full implementation order together.
3. **Standard vs modular** — standard pipelines, modular, or both?
Use `AskUserQuestion` with structured choices for step 3 when the options are known.
## Standard Pipeline Integration
### File structure for a new model
```
src/diffusers/
models/transformers/transformer_<model>.py # The core model
schedulers/scheduling_<model>.py # If model needs a custom scheduler
pipelines/<model>/
__init__.py
pipeline_<model>.py # Main pipeline
pipeline_<model>_<variant>.py # Variant pipelines (e.g. pyramid, distilled)
pipeline_output.py # Output dataclass
loaders/lora_pipeline.py # LoRA mixin (add to existing file)
tests/
models/transformers/test_models_transformer_<model>.py
pipelines/<model>/test_<model>.py
lora/test_lora_layers_<model>.py
docs/source/en/api/
pipelines/<model>.md
models/<model>_transformer3d.md # or appropriate name
```
### Integration checklist
- [ ] Implement transformer model with `from_pretrained` support
- [ ] Implement or reuse scheduler
- [ ] Implement pipeline(s) with `__call__` method
- [ ] Add LoRA support if applicable
- [ ] Register all classes in `__init__.py` files (lazy imports)
- [ ] Write unit tests (model, pipeline, LoRA)
- [ ] Write docs
- [ ] Run `make style` and `make quality`
- [ ] Test parity with reference implementation (see `parity-testing` skill)
### Attention pattern
Attention must follow the diffusers pattern: both the `Attention` class and its processor are defined in the model file. The processor's `__call__` handles the actual compute and must use `dispatch_attention_fn` rather than calling `F.scaled_dot_product_attention` directly. The attention class inherits `AttentionModuleMixin` and declares `_default_processor_cls` and `_available_processors`.
```python
# transformer_mymodel.py
class MyModelAttnProcessor:
_attention_backend = None
_parallel_config = None
def __call__(self, attn, hidden_states, attention_mask=None, ...):
query = attn.to_q(hidden_states)
key = attn.to_k(hidden_states)
value = attn.to_v(hidden_states)
# reshape, apply rope, etc.
hidden_states = dispatch_attention_fn(
query, key, value,
attn_mask=attention_mask,
backend=self._attention_backend,
parallel_config=self._parallel_config,
)
hidden_states = hidden_states.flatten(2, 3)
return attn.to_out[0](hidden_states)
class MyModelAttention(nn.Module, AttentionModuleMixin):
_default_processor_cls = MyModelAttnProcessor
_available_processors = [MyModelAttnProcessor]
def __init__(self, query_dim, heads=8, dim_head=64, ...):
super().__init__()
self.to_q = nn.Linear(query_dim, heads * dim_head, bias=False)
self.to_k = nn.Linear(query_dim, heads * dim_head, bias=False)
self.to_v = nn.Linear(query_dim, heads * dim_head, bias=False)
self.to_out = nn.ModuleList([nn.Linear(heads * dim_head, query_dim), nn.Dropout(0.0)])
self.set_processor(MyModelAttnProcessor())
def forward(self, hidden_states, attention_mask=None, **kwargs):
return self.processor(self, hidden_states, attention_mask, **kwargs)
```
Consult the implementations in `src/diffusers/models/transformers/` if you need further references.
### Implementation rules
1. **Don't combine structural changes with behavioral changes.** Restructuring code to fit diffusers APIs (ModelMixin, ConfigMixin, etc.) is unavoidable. But don't also "improve" the algorithm, refactor computation order, or rename internal variables for aesthetics. Keep numerical logic as close to the reference as possible, even if it looks unclean. For standard → modular, this is stricter: copy loop logic verbatim and only restructure into blocks. Clean up in a separate commit after parity is confirmed.
2. **Pipelines must inherit from `DiffusionPipeline`.** Consult implementations in `src/diffusers/pipelines` in case you need references.
3. **Don't subclass an existing pipeline for a variant.** DO NOT use an existing pipeline class (e.g., `FluxPipeline`) to override another pipeline (e.g., `FluxImg2ImgPipeline`) which will be a part of the core codebase (`src`).
### Test setup
- Slow tests gated with `@slow` and `RUN_SLOW=1`
- All model-level tests must use the `BaseModelTesterConfig`, `ModelTesterMixin`, `MemoryTesterMixin`, `AttentionTesterMixin`, `LoraTesterMixin`, and `TrainingTesterMixin` classes initially to write the tests. Any additional tests should be added after discussions with the maintainers. Use `tests/models/transformers/test_models_transformer_flux.py` as a reference.
### Common diffusers conventions
- Pipelines inherit from `DiffusionPipeline`
- Models use `ModelMixin` with `register_to_config` for config serialization
- Schedulers use `SchedulerMixin` with `ConfigMixin`
- Use `@torch.no_grad()` on pipeline `__call__`
- Support `output_type="latent"` for skipping VAE decode
- Support `generator` parameter for reproducibility
- Use `self.progress_bar(timesteps)` for progress tracking
## Gotchas
1. **Forgetting `__init__.py` lazy imports.** Every new class must be registered in the appropriate `__init__.py` with lazy imports. Missing this causes `ImportError` that only shows up when users try `from diffusers import YourNewClass`.
2. **Using `einops` or other non-PyTorch deps.** Reference implementations often use `einops.rearrange`. Always rewrite with native PyTorch (`reshape`, `permute`, `unflatten`). Don't add the dependency. If a dependency is truly unavoidable, guard its import: `if is_my_dependency_available(): import my_dependency`.
3. **Missing `make fix-copies` after `# Copied from`.** If you add `# Copied from` annotations, you must run `make fix-copies` to propagate them. CI will fail otherwise.
4. **Wrong `_supports_cache_class` / `_no_split_modules`.** These class attributes control KV cache and device placement. Copy from a similar model and verify -- wrong values cause silent correctness bugs or OOM errors.
5. **Missing `@torch.no_grad()` on pipeline `__call__`.** Forgetting this causes GPU OOM from gradient accumulation during inference.
6. **Config serialization gaps.** Every `__init__` parameter in a `ModelMixin` subclass must be captured by `register_to_config`. If you add a new param but forget to register it, `from_pretrained` will silently use the default instead of the saved value.
7. **Forgetting to update `_import_structure` and `_lazy_modules`.** The top-level `src/diffusers/__init__.py` has both -- missing either one causes partial import failures.
8. **Hardcoded dtype in model forward.** Don't hardcode `torch.float32` or `torch.bfloat16` in the model's forward pass. Use the dtype of the input tensors or `self.dtype` so the model works with any precision.
---
## Modular Pipeline Conversion
See [modular-conversion.md](modular-conversion.md) for the full guide on converting standard pipelines to modular format, including block types, build order, guider abstraction, and conversion checklist.
---
## Weight Conversion Tips
<!-- TODO: Add concrete examples as we encounter them. Common patterns to watch for:
- Fused QKV weights that need splitting into separate Q, K, V
- Scale/shift ordering differences (reference stores [shift, scale], diffusers expects [scale, shift])
- Weight transpositions (linear stored as transposed conv, or vice versa)
- Interleaved head dimensions that need reshaping
- Bias terms absorbed into different layers
Add each with a before/after code snippet showing the conversion. -->
================================================
FILE: .ai/skills/model-integration/modular-conversion.md
================================================
# Modular Pipeline Conversion Reference
## When to use
Modular pipelines break a monolithic `__call__` into composable blocks. Convert when:
- The model supports multiple workflows (T2V, I2V, V2V, etc.)
- Users need to swap guidance strategies (CFG, CFG-Zero*, PAG)
- You want to share blocks across pipeline variants
## File structure
```
src/diffusers/modular_pipelines/<model>/
__init__.py # Lazy imports
modular_pipeline.py # Pipeline class (tiny, mostly config)
encoders.py # Text encoder + image/video VAE encoder blocks
before_denoise.py # Pre-denoise setup blocks
denoise.py # The denoising loop blocks
decoders.py # VAE decode block
modular_blocks_<model>.py # Block assembly (AutoBlocks)
```
## Block types decision tree
```
Is this a single operation?
YES -> ModularPipelineBlocks (leaf block)
Does it run multiple blocks in sequence?
YES -> SequentialPipelineBlocks
Does it iterate (e.g. chunk loop)?
YES -> LoopSequentialPipelineBlocks
Does it choose ONE block based on which input is present?
Is the selection 1:1 with trigger inputs?
YES -> AutoPipelineBlocks (simple trigger mapping)
NO -> ConditionalPipelineBlocks (custom select_block method)
```
## Build order (easiest first)
1. `decoders.py` -- Takes latents, runs VAE decode, returns images/videos
2. `encoders.py` -- Takes prompt, returns prompt_embeds. Add image/video VAE encoder if needed
3. `before_denoise.py` -- Timesteps, latent prep, noise setup. Each logical operation = one block
4. `denoise.py` -- The hardest. Convert guidance to guider abstraction
## Key pattern: Guider abstraction
Original pipeline has guidance baked in:
```python
for i, t in enumerate(timesteps):
noise_pred = self.transformer(latents, prompt_embeds, ...)
if self.do_classifier_free_guidance:
noise_uncond = self.transformer(latents, negative_prompt_embeds, ...)
noise_pred = noise_uncond + scale * (noise_pred - noise_uncond)
latents = self.scheduler.step(noise_pred, t, latents).prev_sample
```
Modular pipeline separates concerns:
```python
guider_inputs = {
"encoder_hidden_states": (prompt_embeds, negative_prompt_embeds),
}
for i, t in enumerate(timesteps):
components.guider.set_state(step=i, num_inference_steps=num_steps, timestep=t)
guider_state = components.guider.prepare_inputs(guider_inputs)
for batch in guider_state:
components.guider.prepare_models(components.transformer)
cond_kwargs = {k: getattr(batch, k) for k in guider_inputs}
context_name = getattr(batch, components.guider._identifier_key)
with components.transformer.cache_context(context_name):
batch.noise_pred = components.transformer(
hidden_states=latents, timestep=timestep,
return_dict=False, **cond_kwargs, **shared_kwargs,
)[0]
components.guider.cleanup_models(components.transformer)
noise_pred = components.guider(guider_state)[0]
latents = components.scheduler.step(noise_pred, t, latents, generator=generator)[0]
```
## Key pattern: Chunk loops for video models
Use `LoopSequentialPipelineBlocks` for outer loop:
```python
class ChunkDenoiseStep(LoopSequentialPipelineBlocks):
block_classes = [PrepareChunkStep, NoiseGenStep, DenoiseInnerStep, UpdateStep]
```
Note: blocks inside `LoopSequentialPipelineBlocks` receive `(components, block_state, k)` where `k` is the loop iteration index.
## Key pattern: Workflow selection
```python
class AutoDenoise(ConditionalPipelineBlocks):
block_classes = [V2VDenoiseStep, I2VDenoiseStep, T2VDenoiseStep]
block_trigger_inputs = ["video_latents", "image_latents"]
default_block_name = "text2video"
```
## Standard InputParam/OutputParam templates
```python
# Inputs
InputParam.template("prompt") # str, required
InputParam.template("negative_prompt") # str, optional
InputParam.template("image") # PIL.Image, optional
InputParam.template("generator") # torch.Generator, optional
InputParam.template("num_inference_steps") # int, default=50
InputParam.template("latents") # torch.Tensor, optional
# Outputs
OutputParam.template("prompt_embeds")
OutputParam.template("negative_prompt_embeds")
OutputParam.template("image_latents")
OutputParam.template("latents")
OutputParam.template("videos")
OutputParam.template("images")
```
## ComponentSpec patterns
```python
# Heavy models - loaded from pretrained
ComponentSpec("transformer", YourTransformerModel)
ComponentSpec("vae", AutoencoderKL)
# Lightweight objects - created inline from config
ComponentSpec(
"guider",
ClassifierFreeGuidance,
config=FrozenDict({"guidance_scale": 7.5}),
default_creation_method="from_config"
)
```
## Conversion checklist
- [ ] Read original pipeline's `__call__` end-to-end, map stages
- [ ] Write test scripts (reference + target) with identical seeds
- [ ] Create file structure under `modular_pipelines/<model>/`
- [ ] Write decoder block (simplest)
- [ ] Write encoder blocks (text, image, video)
- [ ] Write before_denoise blocks (timesteps, latent prep, noise)
- [ ] Write denoise block with guider abstraction (hardest)
- [ ] Create pipeline class with `default_blocks_name`
- [ ] Assemble blocks in `modular_blocks_<model>.py`
- [ ] Wire up `__init__.py` with lazy imports
- [ ] Run `make style` and `make quality`
- [ ] Test all workflows for parity with reference
================================================
FILE: .ai/skills/parity-testing/SKILL.md
================================================
---
name: testing-parity
description: >
Use when debugging or verifying numerical parity between pipeline
implementations (e.g., research repo vs diffusers, standard vs modular).
Also relevant when outputs look wrong — washed out, pixelated, or have
visual artifacts — as these are usually parity bugs.
---
## Setup — gather before starting
Before writing any test code, gather:
1. **Which two implementations** are being compared (e.g. research repo → diffusers, standard → modular, or research → modular). Use `AskUserQuestion` with structured choices if not already clear.
2. **Two equivalent runnable scripts** — one for each implementation, both expected to produce identical output given the same inputs. These scripts define what "parity" means concretely.
When invoked from the `model-integration` skill, you already have context: the reference script comes from step 2 of setup, and the diffusers script is the one you just wrote. You just need to make sure both scripts are runnable and use the same inputs/seed/params.
## Test strategy
**Component parity (CPU/float32) -- always run, as you build.**
Test each component before assembling the pipeline. This is the foundation -- if individual pieces are wrong, the pipeline can't be right. Each component in isolation, strict max_diff < 1e-3.
Test freshly converted checkpoints and saved checkpoints.
- **Fresh**: convert from checkpoint weights, compare against reference (catches conversion bugs)
- **Saved**: load from saved model on disk, compare against reference (catches stale saves)
Keep component test scripts around -- you will need to re-run them during pipeline debugging with different inputs or config values.
Template -- one self-contained script per component, reference and diffusers side-by-side:
```python
@torch.inference_mode()
def test_my_component(mode="fresh", model_path=None):
# 1. Deterministic input
gen = torch.Generator().manual_seed(42)
x = torch.randn(1, 3, 64, 64, generator=gen, dtype=torch.float32)
# 2. Reference: load from checkpoint, run, free
ref_model = ReferenceModel.from_config(config)
ref_model.load_state_dict(load_weights("prefix"), strict=True)
ref_model = ref_model.float().eval()
ref_out = ref_model(x).clone()
del ref_model
# 3. Diffusers: fresh (convert weights) or saved (from_pretrained)
if mode == "fresh":
diff_model = convert_my_component(load_weights("prefix"))
else:
diff_model = DiffusersModel.from_pretrained(model_path, torch_dtype=torch.float32)
diff_model = diff_model.float().eval()
diff_out = diff_model(x)
del diff_model
# 4. Compare in same script -- no saving to disk
max_diff = (ref_out - diff_out).abs().max().item()
assert max_diff < 1e-3, f"FAIL: max_diff={max_diff:.2e}"
```
Key points: (a) both reference and diffusers component in one script -- never split into separate scripts that save/load intermediates, (b) deterministic input via seeded generator, (c) load one model at a time to fit in CPU RAM, (d) `.clone()` the reference output before deleting the model.
**E2E visual (GPU/bfloat16) -- once the pipeline is assembled.**
Both pipelines generate independently with identical seeds/params. Save outputs and compare visually. If outputs look identical, you're done -- no need for deeper testing.
**Pipeline stage tests -- only if E2E fails and you need to isolate the bug.**
If the user already suspects where divergence is, start there. Otherwise, work through stages in order.
First, **match noise generation**: the way initial noise/latents are constructed (seed handling, generator, randn call order) often differs between the two scripts. If the noise doesn't match, nothing downstream will match. Check how noise is initialized in the diffusers script — if it doesn't match the reference, temporarily change it to match. Note what you changed so it can be reverted after parity is confirmed.
For small models, run on CPU/float32 for strict comparison. For large models (e.g. 22B params), CPU/float32 is impractical -- use GPU/bfloat16 with `enable_model_cpu_offload()` and relax tolerances (max_diff < 1e-1 for bfloat16 is typical for passing tests; cosine similarity > 0.9999 is a good secondary check).
Test encode and decode stages first -- they're simpler and bugs there are easier to fix. Only debug the denoising loop if encode and decode both pass.
The challenge: pipelines are monolithic `__call__` methods -- you can't just call "the encode part". See [checkpoint-mechanism.md](checkpoint-mechanism.md) for the checkpoint class that lets you stop, save, or inject tensors at named locations inside the pipeline.
**Stage test order — encode, decode, then denoise:**
- **`encode`** (test first): Stop both pipelines at `"preloop"`. Compare **every single variable** that will be consumed by the denoising loop -- not just latents and sigmas, but also prompt embeddings, attention masks, positional coordinates, connector outputs, and any conditioning inputs.
- **`decode`** (test second, before denoise): Run the reference pipeline fully -- checkpoint the post-loop latents AND let it finish to get the decoded output. Then feed those same post-loop latents through the diffusers pipeline's decode path. Compare both numerically AND visually.
- **`denoise`** (test last): Run both pipelines with realistic `num_steps` (e.g. 30) so the scheduler computes correct sigmas/timesteps, but stop after 2 loop iterations using `after_step_1`. Don't set `num_steps=2` -- that produces unrealistic sigma schedules.
```python
# Encode stage -- stop before the loop, compare ALL inputs:
ref_ckpts = {"preloop": Checkpoint(save=True, stop=True)}
run_reference_pipeline(ref_ckpts)
ref_data = ref_ckpts["preloop"].data
diff_ckpts = {"preloop": Checkpoint(save=True, stop=True)}
run_diffusers_pipeline(diff_ckpts)
diff_data = diff_ckpts["preloop"].data
# Compare EVERY variable consumed by the denoise loop:
compare_tensors("latents", ref_data["latents"], diff_data["latents"])
compare_tensors("sigmas", ref_data["sigmas"], diff_data["sigmas"])
compare_tensors("prompt_embeds", ref_data["prompt_embeds"], diff_data["prompt_embeds"])
# ... every single tensor the transformer forward() will receive
```
**E2E-injected visual test**: Once you've identified a suspected root cause using stage tests, confirm it with an e2e-injected run -- inject the known-good tensor from reference and generate a full video. If the output looks identical to reference, you've confirmed the root cause.
## Debugging technique: Injection for root-cause isolation
When stage tests show divergence, **inject a known-good tensor from one pipeline into the other** to test whether the remaining code is correct.
The principle: if you suspect input X is the root cause of divergence in stage S:
1. Run the reference pipeline and capture X
2. Run the diffusers pipeline but **replace** its X with the reference's X (via checkpoint load)
3. Compare outputs of stage S
If outputs now match: X was the root cause. If they still diverge: the bug is in the stage logic itself, not in X.
| What you're testing | What you inject | Where you inject |
|---|---|---|
| Is the decode stage correct? | Post-loop latents from reference | Before decode |
| Is the denoise loop correct? | Pre-loop latents from reference | Before the loop |
| Is step N correct? | Post-step-(N-1) latents from reference | Before step N |
**Per-step accumulation tracing**: When injection confirms the loop is correct but you want to understand *how* a small initial difference compounds, capture `after_step_{i}` for every step and plot the max_diff curve. A healthy curve stays bounded; an exponential blowup in later steps points to an amplification mechanism (see Pitfall #13 in [pitfalls.md](pitfalls.md)).
## Debugging technique: Visual comparison via frame extraction
For video pipelines, numerical metrics alone can be misleading. Extract and view individual frames:
```python
import numpy as np
from PIL import Image
def extract_frames(video_np, frame_indices):
"""video_np: (frames, H, W, 3) float array in [0, 1]"""
for idx in frame_indices:
frame = (video_np[idx] * 255).clip(0, 255).astype(np.uint8)
img = Image.fromarray(frame)
img.save(f"frame_{idx}.png")
# Compare specific frames from both pipelines
extract_frames(ref_video, [0, 60, 120])
extract_frames(diff_video, [0, 60, 120])
```
## Testing rules
1. **Never use reference code in the diffusers test path.** Each side must use only its own code.
2. **Never monkey-patch model internals in tests.** Do not replace `model.forward` or patch internal methods.
3. **Debugging instrumentation must be non-destructive.** Checkpoint captures for debugging are fine, but must not alter control flow or outputs.
4. **Prefer CPU/float32 for numerical comparison when practical.** Float32 avoids bfloat16 precision noise that obscures real bugs. But for large models (22B+), GPU/bfloat16 with `enable_model_cpu_offload()` is necessary -- use relaxed tolerances and cosine similarity as a secondary metric.
5. **Test both fresh conversion AND saved model.** Fresh catches conversion logic bugs; saved catches stale/corrupted weights from previous runs.
6. **Diff configs before debugging.** Before investigating any divergence, dump and compare all config values. A 30-second config diff prevents hours of debugging based on wrong assumptions.
7. **Never modify cached/downloaded model configs directly.** Don't edit files in `~/.cache/huggingface/`. Instead, save to a local directory or open a PR on the upstream repo.
8. **Compare ALL loop inputs in the encode test.** The preloop checkpoint must capture every single tensor the transformer forward() will receive.
## Comparison utilities
```python
def compare_tensors(name: str, a: torch.Tensor, b: torch.Tensor, tol: float = 1e-3) -> bool:
if a.shape != b.shape:
print(f" FAIL {name}: shape mismatch {a.shape} vs {b.shape}")
return False
diff = (a.float() - b.float()).abs()
max_diff = diff.max().item()
mean_diff = diff.mean().item()
cos = torch.nn.functional.cosine_similarity(
a.float().flatten().unsqueeze(0), b.float().flatten().unsqueeze(0)
).item()
passed = max_diff < tol
print(f" {'PASS' if passed else 'FAIL'} {name}: max={max_diff:.2e}, mean={mean_diff:.2e}, cos={cos:.5f}")
return passed
```
Cosine similarity is especially useful for GPU/bfloat16 tests where max_diff can be noisy -- `cos > 0.9999` is a strong signal even when max_diff exceeds tolerance.
## Gotchas
See [pitfalls.md](pitfalls.md) for the full list of gotchas to watch for during parity testing.
================================================
FILE: .ai/skills/parity-testing/checkpoint-mechanism.md
================================================
# Checkpoint Mechanism for Stage Testing
## Overview
Pipelines are monolithic `__call__` methods -- you can't just call "the encode part". The checkpoint mechanism lets you stop, save, or inject tensors at named locations inside the pipeline.
## The Checkpoint class
Add a `_checkpoints` argument to both the diffusers pipeline and the reference implementation.
```python
@dataclass
class Checkpoint:
save: bool = False # capture variables into ckpt.data
stop: bool = False # halt pipeline after this point
load: bool = False # inject ckpt.data into local variables
data: dict = field(default_factory=dict)
```
## Pipeline instrumentation
The pipeline accepts an optional `dict[str, Checkpoint]`. Place checkpoint calls at boundaries between pipeline stages -- after each encoder, before the denoising loop (capture all loop inputs), after each loop iteration, after the loop (capture final latents before decode).
```python
def __call__(self, prompt, ..., _checkpoints=None):
# --- text encoding ---
prompt_embeds = self.text_encoder(prompt)
_maybe_checkpoint(_checkpoints, "text_encoding", {
"prompt_embeds": prompt_embeds,
})
# --- prepare latents, sigmas, positions ---
latents = self.prepare_latents(...)
sigmas = self.scheduler.sigmas
# ...
_maybe_checkpoint(_checkpoints, "preloop", {
"latents": latents,
"sigmas": sigmas,
"prompt_embeds": prompt_embeds,
"prompt_attention_mask": prompt_attention_mask,
"video_coords": video_coords,
# capture EVERYTHING the loop needs -- every tensor the transformer
# forward() receives. Missing even one variable here means you can't
# tell if it's the source of divergence during denoise debugging.
})
# --- denoising loop ---
for i, t in enumerate(timesteps):
noise_pred = self.transformer(latents, t, prompt_embeds, ...)
latents = self.scheduler.step(noise_pred, t, latents)[0]
_maybe_checkpoint(_checkpoints, f"after_step_{i}", {
"latents": latents,
})
_maybe_checkpoint(_checkpoints, "post_loop", {
"latents": latents,
})
# --- decode ---
video = self.vae.decode(latents)
return video
```
## The helper function
Each `_maybe_checkpoint` call does three things based on the Checkpoint's flags: `save` captures the local variables into `ckpt.data`, `load` injects pre-populated `ckpt.data` back into local variables, `stop` halts execution (raises an exception caught at the top level).
```python
def _maybe_checkpoint(checkpoints, name, data):
if not checkpoints:
return
ckpt = checkpoints.get(name)
if ckpt is None:
return
if ckpt.save:
ckpt.data.update(data)
if ckpt.stop:
raise PipelineStop # caught at __call__ level, returns None
```
## Injection support
Add `load` support at each checkpoint where you might want to inject:
```python
_maybe_checkpoint(_checkpoints, "preloop", {"latents": latents, ...})
# Load support: replace local variables with injected data
if _checkpoints:
ckpt = _checkpoints.get("preloop")
if ckpt is not None and ckpt.load:
latents = ckpt.data["latents"].to(device=device, dtype=latents.dtype)
```
## Key insight
The checkpoint dict is passed into the pipeline and mutated in-place. After the pipeline returns (or stops early), you read back `ckpt.data` to get the captured tensors. Both pipelines save under their own key names, so the test maps between them (e.g. reference `"video_state.latent"` -> diffusers `"latents"`).
## Memory management for large models
For large models, free the source pipeline's GPU memory before loading the target pipeline. Clone injected tensors to CPU, delete everything else, then run the target with `enable_model_cpu_offload()`.
================================================
FILE: .ai/skills/parity-testing/pitfalls.md
================================================
# Complete Pitfalls Reference
## 1. Global CPU RNG
`MultivariateNormal.sample()` uses the global CPU RNG, not `torch.Generator`. Must call `torch.manual_seed(seed)` before each pipeline run. A `generator=` kwarg won't help.
## 2. Timestep dtype
Many transformers expect `int64` timesteps. `get_timestep_embedding` casts to float, so `745.3` and `745` produce different embeddings. Match the reference's casting.
## 3. Guidance parameter mapping
Parameter names may differ: reference `zero_steps=1` (meaning `i <= 1`, 2 steps) vs target `zero_init_steps=2` (meaning `step < 2`, same thing). Check exact semantics.
## 4. `patch_size` in noise generation
If noise generation depends on `patch_size` (e.g. `sample_block_noise`), it must be passed through. Missing it changes noise spatial structure.
## 5. Variable shadowing in nested loops
Nested loops (stages -> chunks -> timesteps) can shadow variable names. If outer loop uses `latents` and inner loop also assigns to `latents`, scoping must match the reference.
## 6. Float precision differences -- don't dismiss them
Target may compute in float32 where reference used bfloat16. Small per-element diffs (1e-3 to 1e-2) *look* harmless but can compound catastrophically over iterative processes like denoising loops (see Pitfalls #11 and #13). Before dismissing a precision difference: (a) check whether it feeds into an iterative process, (b) if so, trace the accumulation curve over all iterations to see if it stays bounded or grows exponentially. Only truly non-iterative precision diffs (e.g. in a single-pass encoder) are safe to accept.
## 7. Scheduler state reset between stages
Some schedulers accumulate state (e.g. `model_outputs` in UniPC) that must be cleared between stages.
## 8. Component access
Standard: `self.transformer`. Modular: `components.transformer`. Missing this causes AttributeError.
## 9. Guider state across stages
In multi-stage denoising, the guider's internal state (e.g. `zero_init_steps`) may need save/restore between stages.
## 10. Model storage location
NEVER store converted models in `/tmp/` -- temporary directories get wiped on restart. Always save converted checkpoints under a persistent path in the project repo (e.g. `models/ltx23-diffusers/`).
## 11. Noise dtype mismatch (causes washed-out output)
Reference code often generates noise in float32 then casts to model dtype (bfloat16) before storing:
```python
noise = torch.randn(..., dtype=torch.float32, generator=gen)
noise = noise.to(dtype=model_dtype) # bfloat16 -- values get quantized
```
Diffusers pipelines may keep latents in float32 throughout the loop. The per-element difference is only ~1.5e-02, but this compounds over 30 denoising steps via 1/sigma amplification (Pitfall #13) and produces completely washed-out output.
**Fix**: Match the reference -- generate noise in the model's working dtype:
```python
latent_dtype = self.transformer.dtype # e.g. bfloat16
latents = self.prepare_latents(..., dtype=latent_dtype, ...)
```
**Detection**: Encode stage test shows initial latent max_diff of exactly ~1.5e-02. This specific magnitude is the signature of float32->bfloat16 quantization error.
## 12. RoPE position dtype
RoPE cosine/sine values are sensitive to position coordinate dtype. If reference uses bfloat16 positions but diffusers uses float32, the RoPE output diverges significantly (max_diff up to 2.0). Different modalities may use different position dtypes (e.g. video bfloat16, audio float32) -- check the reference carefully.
## 13. 1/sigma error amplification in Euler denoising
In Euler/flow-matching, the velocity formula divides by sigma: `v = (latents - pred_x0) / sigma`. As sigma shrinks from ~1.0 (step 0) to ~0.001 (step 29), errors are amplified up to 1000x. A 1.5e-02 init difference grows linearly through mid-steps, then exponentially in final steps, reaching max_diff ~6.0. This is why dtype mismatches (Pitfalls #11, #12) that seem tiny at init produce visually broken output. Use per-step accumulation tracing to diagnose.
## 14. Config value assumptions -- always diff, never assume
When debugging parity, don't assume config values match code defaults. The published model checkpoint may override defaults with different values. A wrong assumption about a single config field can send you down hours of debugging in the wrong direction.
**The pattern that goes wrong:**
1. You see `param_x` has default `1` in the code
2. The reference code also uses `param_x` with a default of `1`
3. You assume both sides use `1` and apply a "fix" based on that
4. But the actual checkpoint config has `param_x: 1000`, and so does the published diffusers config
5. Your "fix" now *creates* divergence instead of fixing it
**Prevention -- config diff first:**
```python
# Reference: read from checkpoint metadata (no model loading needed)
from safetensors import safe_open
import json
ref_config = json.loads(safe_open(checkpoint_path, framework="pt").metadata()["config"])
# Diffusers: read from model config
from diffusers import MyModel
diff_model = MyModel.from_pretrained(model_path, subfolder="transformer")
diff_config = dict(diff_model.config)
# Compare all values
for key in sorted(set(list(ref_config.get("transformer", {}).keys()) + list(diff_config.keys()))):
ref_val = ref_config.get("transformer", {}).get(key, "MISSING")
diff_val = diff_config.get(key, "MISSING")
if ref_val != diff_val:
print(f" DIFF {key}: ref={ref_val}, diff={diff_val}")
```
Run this **before** writing any hooks, analysis code, or fixes. It takes 30 seconds and catches wrong assumptions immediately.
**When debugging divergence -- trace values, don't reason about them:**
If two implementations diverge, hook the actual intermediate values at the point of divergence rather than reading code to figure out what the values "should" be. Code analysis builds on assumptions; value tracing reveals facts.
## 15. Decoder config mismatch (causes pixelated artifacts)
The upstream model config may have wrong values for decoder-specific parameters (e.g. `upsample_residual`, `upsample_type`). These control whether the decoder uses skip connections in upsampling -- getting them wrong produces severe pixelation or blocky artifacts.
**Detection**: Feed identical post-loop latents through both decoders. If max pixel diff is large (PSNR < 40 dB) on CPU/float32, it's a real bug, not precision noise. Trace through decoder blocks (conv_in -> mid_block -> up_blocks) to find where divergence starts.
**Fix**: Correct the config value. Don't edit cached files in `~/.cache/huggingface/` -- either save to a local model directory or open a PR on the upstream repo (see Testing Rule #7).
## 16. Incomplete injection tests -- inject ALL variables or the test is invalid
When doing injection tests (feeding reference tensors into the diffusers pipeline), you must inject **every** divergent input, including sigmas/timesteps. A common mistake: the preloop checkpoint saves sigmas but the injection code only loads latents and embeddings. The test then runs with different sigma schedules, making it impossible to isolate the real cause.
**Prevention**: After writing injection code, verify by listing every variable the injected stage consumes and checking each one is either (a) injected from reference, or (b) confirmed identical between pipelines.
## 17. bf16 connector/encoder divergence -- don't chase it
When running on GPU/bfloat16, multi-layer encoders (e.g. 8-layer connector transformers) accumulate bf16 rounding noise that looks alarming (max_diff 0.3-2.7). Before investigating, re-run the component test on CPU/float32. If it passes (max_diff < 1e-4), the divergence is pure precision noise, not a code bug. Don't spend hours tracing through layers -- confirm on CPU/float32 and move on.
## 18. Stale test fixtures
When using saved tensors for cross-pipeline comparison, always ensure both sets of tensors were captured from the same run configuration (same seed, same config, same code version). Mixing fixtures from different runs (e.g. reference tensors from yesterday, diffusers tensors from today after a code change) creates phantom divergence that wastes debugging time. Regenerate both sides in a single test script execution.
================================================
FILE: .github/ISSUE_TEMPLATE/bug-report.yml
================================================
name: "\U0001F41B Bug Report"
description: Report a bug on Diffusers
labels: [ "bug" ]
body:
- type: markdown
attributes:
value: |
Thanks a lot for taking the time to file this issue 🤗.
Issues do not only help to improve the library, but also publicly document common problems, questions, workflows for the whole community!
Thus, issues are of the same importance as pull requests when contributing to this library ❤️.
In order to make your issue as **useful for the community as possible**, let's try to stick to some simple guidelines:
- 1. Please try to be as precise and concise as possible.
*Give your issue a fitting title. Assume that someone which very limited knowledge of Diffusers can understand your issue. Add links to the source code, documentation other issues, pull requests etc...*
- 2. If your issue is about something not working, **always** provide a reproducible code snippet. The reader should be able to reproduce your issue by **only copy-pasting your code snippet into a Python shell**.
*The community cannot solve your issue if it cannot reproduce it. If your bug is related to training, add your training script and make everything needed to train public. Otherwise, just add a simple Python code snippet.*
- 3. Add the **minimum** amount of code / context that is needed to understand, reproduce your issue.
*Make the life of maintainers easy. `diffusers` is getting many issues every day. Make sure your issue is about one bug and one bug only. Make sure you add only the context, code needed to understand your issues - nothing more. Generally, every issue is a way of documenting this library, try to make it a good documentation entry.*
- 4. For issues related to community pipelines (i.e., the pipelines located in the `examples/community` folder), please tag the author of the pipeline in your issue thread as those pipelines are not maintained.
- type: markdown
attributes:
value: |
For more in-detail information on how to write good issues you can have a look [here](https://huggingface.co/course/chapter8/5?fw=pt).
- type: textarea
id: bug-description
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is. If you intend to submit a pull request for this issue, tell us in the description. Thanks!
placeholder: Bug description
validations:
required: true
- type: textarea
id: reproduction
attributes:
label: Reproduction
description: Please provide a minimal reproducible code which we can copy/paste and reproduce the issue.
placeholder: Reproduction
validations:
required: true
- type: textarea
id: logs
attributes:
label: Logs
description: "Please include the Python logs if you can."
render: shell
- type: textarea
id: system-info
attributes:
label: System Info
description: Please share your system info with us. You can run the command `diffusers-cli env` and copy-paste its output below.
placeholder: Diffusers version, platform, Python version, ...
validations:
required: true
- type: textarea
id: who-can-help
attributes:
label: Who can help?
description: |
Your issue will be replied to more quickly if you can figure out the right person to tag with @.
If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
All issues are read by one of the core maintainers, so if you don't know who to tag, just leave this blank and
a core maintainer will ping the right person.
Please tag a maximum of 2 people.
Questions on DiffusionPipeline (Saving, Loading, From pretrained, ...): @sayakpaul @DN6
Questions on pipelines:
- Stable Diffusion @yiyixuxu @asomoza
- Stable Diffusion XL @yiyixuxu @sayakpaul @DN6
- Stable Diffusion 3: @yiyixuxu @sayakpaul @DN6 @asomoza
- Kandinsky @yiyixuxu
- ControlNet @sayakpaul @yiyixuxu @DN6
- T2I Adapter @sayakpaul @yiyixuxu @DN6
- IF @DN6
- Text-to-Video / Video-to-Video @DN6 @a-r-r-o-w
- Wuerstchen @DN6
- Other: @yiyixuxu @DN6
- Improving generation quality: @asomoza
Questions on models:
- UNet @DN6 @yiyixuxu @sayakpaul
- VAE @sayakpaul @DN6 @yiyixuxu
- Transformers/Attention @DN6 @yiyixuxu @sayakpaul
Questions on single file checkpoints: @DN6
Questions on Schedulers: @yiyixuxu
Questions on LoRA: @sayakpaul
Questions on Textual Inversion: @sayakpaul
Questions on Training:
- DreamBooth @sayakpaul
- Text-to-Image Fine-tuning @sayakpaul
- Textual Inversion @sayakpaul
- ControlNet @sayakpaul
Questions on Tests: @DN6 @sayakpaul @yiyixuxu
Questions on Documentation: @stevhliu
Questions on JAX- and MPS-related things: @pcuenca
Questions on audio pipelines: @sanchit-gandhi
placeholder: "@Username ..."
================================================
FILE: .github/ISSUE_TEMPLATE/config.yml
================================================
contact_links:
- name: Questions / Discussions
url: https://github.com/huggingface/diffusers/discussions
about: General usage questions and community discussions
================================================
FILE: .github/ISSUE_TEMPLATE/feature_request.md
================================================
---
name: "\U0001F680 Feature Request"
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...].
**Describe the solution you'd like.**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered.**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context.**
Add any other context or screenshots about the feature request here.
================================================
FILE: .github/ISSUE_TEMPLATE/feedback.md
================================================
---
name: "💬 Feedback about API Design"
about: Give feedback about the current API design
title: ''
labels: ''
assignees: ''
---
**What API design would you like to have changed or added to the library? Why?**
**What use case would this enable or better enable? Can you give us a code example?**
================================================
FILE: .github/ISSUE_TEMPLATE/new-model-addition.yml
================================================
name: "\U0001F31F New Model/Pipeline/Scheduler Addition"
description: Submit a proposal/request to implement a new diffusion model/pipeline/scheduler
labels: [ "New model/pipeline/scheduler" ]
body:
- type: textarea
id: description-request
validations:
required: true
attributes:
label: Model/Pipeline/Scheduler description
description: |
Put any and all important information relative to the model/pipeline/scheduler
- type: checkboxes
id: information-tasks
attributes:
label: Open source status
description: |
Please note that if the model implementation isn't available or if the weights aren't open-source, we are less likely to implement it in `diffusers`.
options:
- label: "The model implementation is available."
- label: "The model weights are available (Only relevant if addition is not a scheduler)."
- type: textarea
id: additional-info
attributes:
label: Provide useful links for the implementation
description: |
Please provide information regarding the implementation, the weights, and the authors.
Please mention the authors by @gh-username if you're aware of their usernames.
================================================
FILE: .github/ISSUE_TEMPLATE/remote-vae-pilot-feedback.yml
================================================
name: "\U0001F31F Remote VAE"
description: Feedback for remote VAE pilot
labels: [ "Remote VAE" ]
body:
- type: textarea
id: positive
validations:
required: true
attributes:
label: Did you like the remote VAE solution?
description: |
If you liked it, we would appreciate it if you could elaborate what you liked.
- type: textarea
id: feedback
validations:
required: true
attributes:
label: What can be improved about the current solution?
description: |
Let us know the things you would like to see improved. Note that we will work optimizing the solution once the pilot is over and we have usage.
- type: textarea
id: others
validations:
required: true
attributes:
label: What other VAEs you would like to see if the pilot goes well?
description: |
Provide a list of the VAEs you would like to see in the future if the pilot goes well.
- type: textarea
id: additional-info
attributes:
label: Notify the members of the team
description: |
Tag the following folks when submitting this feedback: @hlky @sayakpaul
================================================
FILE: .github/ISSUE_TEMPLATE/translate.md
================================================
---
name: 🌐 Translating a New Language?
about: Start a new translation effort in your language
title: '[<languageCode>] Translating docs to <languageName>'
labels: WIP
assignees: ''
---
<!--
Note: Please search to see if an issue already exists for the language you are trying to translate.
-->
Hi!
Let's bring the documentation to all the <languageName>-speaking community 🌐.
Who would want to translate? Please follow the 🤗 [TRANSLATING guide](https://github.com/huggingface/diffusers/blob/main/docs/TRANSLATING.md). Here is a list of the files ready for translation. Let us know in this issue if you'd like to translate any, and we'll add your name to the list.
Some notes:
* Please translate using an informal tone (imagine you are talking with a friend about Diffusers 🤗).
* Please translate in a gender-neutral way.
* Add your translations to the folder called `<languageCode>` inside the [source folder](https://github.com/huggingface/diffusers/tree/main/docs/source).
* Register your translation in `<languageCode>/_toctree.yml`; please follow the order of the [English version](https://github.com/huggingface/diffusers/blob/main/docs/source/en/_toctree.yml).
* Once you're finished, open a pull request and tag this issue by including #issue-number in the description, where issue-number is the number of this issue. Please ping @stevhliu for review.
* 🙋 If you'd like others to help you with the translation, you can also post in the 🤗 [forums](https://discuss.huggingface.co/c/discussion-related-to-httpsgithubcomhuggingfacediffusers/63).
Thank you so much for your help! 🤗
================================================
FILE: .github/PULL_REQUEST_TEMPLATE.md
================================================
# What does this PR do?
<!--
Congratulations! You've made it this far! You're not quite done yet though.
Once merged, your PR is going to appear in the release notes with the title you set, so make sure it's a great title that fully reflects the extent of your awesome contribution.
Then, please replace this with a description of the change and which issue is fixed (if applicable). Please also include relevant motivation and context. List any dependencies (if any) that are required for this change.
Once you're done, someone will review your PR shortly (see the section "Who can review?" below to tag some potential reviewers). They may suggest changes to make the code even better. If no one reviewed your PR after a week has passed, don't hesitate to post a new comment @-mentioning the same persons---sometimes notifications get lost.
-->
<!-- Remove if not applicable -->
Fixes # (issue)
## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [ ] Did you read the [contributor guideline](https://github.com/huggingface/diffusers/blob/main/CONTRIBUTING.md)?
- [ ] Did you read our [philosophy doc](https://github.com/huggingface/diffusers/blob/main/PHILOSOPHY.md) (important for complex PRs)?
- [ ] Was this discussed/approved via a GitHub issue or the [forum](https://discuss.huggingface.co/c/discussion-related-to-httpsgithubcomhuggingfacediffusers/63)? Please add a link to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the
[documentation guidelines](https://github.com/huggingface/diffusers/tree/main/docs), and
[here are tips on formatting docstrings](https://github.com/huggingface/diffusers/tree/main/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?
## 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.
<!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @.
If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
Please tag fewer than 3 people.
Core library:
- Schedulers: @yiyixuxu
- Pipelines and pipeline callbacks: @yiyixuxu and @asomoza
- Training examples: @sayakpaul
- Docs: @stevhliu and @sayakpaul
- JAX and MPS: @pcuenca
- Audio: @sanchit-gandhi
- General functionalities: @sayakpaul @yiyixuxu @DN6
Integrations:
- deepspeed: HF Trainer/Accelerate: @SunMarc
- PEFT: @sayakpaul @BenjaminBossan
HF projects:
- accelerate: [different repo](https://github.com/huggingface/accelerate)
- datasets: [different repo](https://github.com/huggingface/datasets)
- transformers: [different repo](https://github.com/huggingface/transformers)
- safetensors: [different repo](https://github.com/huggingface/safetensors)
-->
================================================
FILE: .github/actions/setup-miniconda/action.yml
================================================
name: Set up conda environment for testing
description: Sets up miniconda in your ${RUNNER_TEMP} environment and gives you the ${CONDA_RUN} environment variable so you don't have to worry about polluting non-empeheral runners anymore
inputs:
python-version:
description: If set to any value, don't use sudo to clean the workspace
required: false
type: string
default: "3.9"
miniconda-version:
description: Miniconda version to install
required: false
type: string
default: "4.12.0"
environment-file:
description: Environment file to install dependencies from
required: false
type: string
default: ""
runs:
using: composite
steps:
# Use the same trick from https://github.com/marketplace/actions/setup-miniconda
# to refresh the cache daily. This is kind of optional though
- name: Get date
id: get-date
shell: bash
run: echo "today=$(/bin/date -u '+%Y%m%d')d" >> $GITHUB_OUTPUT
- name: Setup miniconda cache
id: miniconda-cache
uses: actions/cache@v2
with:
path: ${{ runner.temp }}/miniconda
key: miniconda-${{ runner.os }}-${{ runner.arch }}-${{ inputs.python-version }}-${{ steps.get-date.outputs.today }}
- name: Install miniconda (${{ inputs.miniconda-version }})
if: steps.miniconda-cache.outputs.cache-hit != 'true'
env:
MINICONDA_VERSION: ${{ inputs.miniconda-version }}
shell: bash -l {0}
run: |
MINICONDA_INSTALL_PATH="${RUNNER_TEMP}/miniconda"
mkdir -p "${MINICONDA_INSTALL_PATH}"
case ${RUNNER_OS}-${RUNNER_ARCH} in
Linux-X64)
MINICONDA_ARCH="Linux-x86_64"
;;
macOS-ARM64)
MINICONDA_ARCH="MacOSX-arm64"
;;
macOS-X64)
MINICONDA_ARCH="MacOSX-x86_64"
;;
*)
echo "::error::Platform ${RUNNER_OS}-${RUNNER_ARCH} currently unsupported using this action"
exit 1
;;
esac
MINICONDA_URL="https://repo.anaconda.com/miniconda/Miniconda3-py39_${MINICONDA_VERSION}-${MINICONDA_ARCH}.sh"
curl -fsSL "${MINICONDA_URL}" -o "${MINICONDA_INSTALL_PATH}/miniconda.sh"
bash "${MINICONDA_INSTALL_PATH}/miniconda.sh" -b -u -p "${MINICONDA_INSTALL_PATH}"
rm -rf "${MINICONDA_INSTALL_PATH}/miniconda.sh"
- name: Update GitHub path to include miniconda install
shell: bash
run: |
MINICONDA_INSTALL_PATH="${RUNNER_TEMP}/miniconda"
echo "${MINICONDA_INSTALL_PATH}/bin" >> $GITHUB_PATH
- name: Setup miniconda env cache (with env file)
id: miniconda-env-cache-env-file
if: ${{ runner.os }} == 'macOS' && ${{ inputs.environment-file }} != ''
uses: actions/cache@v2
with:
path: ${{ runner.temp }}/conda-python-${{ inputs.python-version }}
key: miniconda-env-${{ runner.os }}-${{ runner.arch }}-${{ inputs.python-version }}-${{ steps.get-date.outputs.today }}-${{ hashFiles(inputs.environment-file) }}
- name: Setup miniconda env cache (without env file)
id: miniconda-env-cache
if: ${{ runner.os }} == 'macOS' && ${{ inputs.environment-file }} == ''
uses: actions/cache@v2
with:
path: ${{ runner.temp }}/conda-python-${{ inputs.python-version }}
key: miniconda-env-${{ runner.os }}-${{ runner.arch }}-${{ inputs.python-version }}-${{ steps.get-date.outputs.today }}
- name: Setup conda environment with python (v${{ inputs.python-version }})
if: steps.miniconda-env-cache-env-file.outputs.cache-hit != 'true' && steps.miniconda-env-cache.outputs.cache-hit != 'true'
shell: bash
env:
PYTHON_VERSION: ${{ inputs.python-version }}
ENV_FILE: ${{ inputs.environment-file }}
run: |
CONDA_BASE_ENV="${RUNNER_TEMP}/conda-python-${PYTHON_VERSION}"
ENV_FILE_FLAG=""
if [[ -f "${ENV_FILE}" ]]; then
ENV_FILE_FLAG="--file ${ENV_FILE}"
elif [[ -n "${ENV_FILE}" ]]; then
echo "::warning::Specified env file (${ENV_FILE}) not found, not going to include it"
fi
conda create \
--yes \
--prefix "${CONDA_BASE_ENV}" \
"python=${PYTHON_VERSION}" \
${ENV_FILE_FLAG} \
cmake=3.22 \
conda-build=3.21 \
ninja=1.10 \
pkg-config=0.29 \
wheel=0.37
- name: Clone the base conda environment and update GitHub env
shell: bash
env:
PYTHON_VERSION: ${{ inputs.python-version }}
CONDA_BASE_ENV: ${{ runner.temp }}/conda-python-${{ inputs.python-version }}
run: |
CONDA_ENV="${RUNNER_TEMP}/conda_environment_${GITHUB_RUN_ID}"
conda create \
--yes \
--prefix "${CONDA_ENV}" \
--clone "${CONDA_BASE_ENV}"
# TODO: conda-build could not be cloned because it hardcodes the path, so it
# could not be cached
conda install --yes -p ${CONDA_ENV} conda-build=3.21
echo "CONDA_ENV=${CONDA_ENV}" >> "${GITHUB_ENV}"
echo "CONDA_RUN=conda run -p ${CONDA_ENV} --no-capture-output" >> "${GITHUB_ENV}"
echo "CONDA_BUILD=conda run -p ${CONDA_ENV} conda-build" >> "${GITHUB_ENV}"
echo "CONDA_INSTALL=conda install -p ${CONDA_ENV}" >> "${GITHUB_ENV}"
- name: Get disk space usage and throw an error for low disk space
shell: bash
run: |
echo "Print the available disk space for manual inspection"
df -h
# Set the minimum requirement space to 4GB
MINIMUM_AVAILABLE_SPACE_IN_GB=4
MINIMUM_AVAILABLE_SPACE_IN_KB=$(($MINIMUM_AVAILABLE_SPACE_IN_GB * 1024 * 1024))
# Use KB to avoid floating point warning like 3.1GB
df -k | tr -s ' ' | cut -d' ' -f 4,9 | while read -r LINE;
do
AVAIL=$(echo $LINE | cut -f1 -d' ')
MOUNT=$(echo $LINE | cut -f2 -d' ')
if [ "$MOUNT" = "/" ]; then
if [ "$AVAIL" -lt "$MINIMUM_AVAILABLE_SPACE_IN_KB" ]; then
echo "There is only ${AVAIL}KB free space left in $MOUNT, which is less than the minimum requirement of ${MINIMUM_AVAILABLE_SPACE_IN_KB}KB. Please help create an issue to PyTorch Release Engineering via https://github.com/pytorch/test-infra/issues and provide the link to the workflow run."
exit 1;
else
echo "There is ${AVAIL}KB free space left in $MOUNT, continue"
fi
fi
done
================================================
FILE: .github/workflows/benchmark.yml
================================================
name: Benchmarking tests
on:
workflow_dispatch:
schedule:
- cron: "30 1 1,15 * *" # every 2 weeks on the 1st and the 15th of every month at 1:30 AM
env:
DIFFUSERS_IS_CI: yes
HF_XET_HIGH_PERFORMANCE: 1
HF_HOME: /mnt/cache
OMP_NUM_THREADS: 8
MKL_NUM_THREADS: 8
BASE_PATH: benchmark_outputs
jobs:
torch_models_cuda_benchmark_tests:
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_BENCHMARK }}
name: Torch Core Models CUDA Benchmarking Tests
strategy:
fail-fast: false
max-parallel: 1
runs-on:
group: aws-g6e-4xlarge
container:
image: diffusers/diffusers-pytorch-cuda
options: --shm-size "16gb" --ipc host --gpus all
steps:
- name: Checkout diffusers
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: NVIDIA-SMI
run: |
nvidia-smi
- name: Install dependencies
run: |
apt update
apt install -y libpq-dev postgresql-client
uv pip install -e ".[quality]"
uv pip install -r benchmarks/requirements.txt
- name: Environment
run: |
python utils/print_env.py
- name: Diffusers Benchmarking
env:
HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }}
run: |
cd benchmarks && python run_all.py
- name: Push results to the Hub
env:
HF_TOKEN: ${{ secrets.DIFFUSERS_BOT_TOKEN }}
run: |
cd benchmarks && python push_results.py
mkdir $BASE_PATH && cp *.csv $BASE_PATH
- name: Test suite reports artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v6
with:
name: benchmark_test_reports
path: benchmarks/${{ env.BASE_PATH }}
- name: Report success status
if: ${{ success() }}
run: |
pip install requests && python utils/notify_benchmarking_status.py --status=success
- name: Report failure status
if: ${{ failure() }}
run: |
pip install requests && python utils/notify_benchmarking_status.py --status=failure
================================================
FILE: .github/workflows/build_docker_images.yml
================================================
name: Test, build, and push Docker images
on:
pull_request: # During PRs, we just check if the changes Dockerfiles can be successfully built
branches:
- main
paths:
- "docker/**"
workflow_dispatch:
schedule:
- cron: "0 0 * * *" # every day at midnight
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
REGISTRY: diffusers
CI_SLACK_CHANNEL: ${{ secrets.CI_DOCKER_CHANNEL }}
jobs:
test-build-docker-images:
runs-on:
group: aws-general-8-plus
if: github.event_name == 'pull_request'
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Check out code
uses: actions/checkout@v6
- name: Find Changed Dockerfiles
id: file_changes
uses: jitterbit/get-changed-files@v1
with:
format: "space-delimited"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Build Changed Docker Images
env:
CHANGED_FILES: ${{ steps.file_changes.outputs.all }}
run: |
echo "$CHANGED_FILES"
ALLOWED_IMAGES=(
diffusers-pytorch-cpu
diffusers-pytorch-cuda
diffusers-pytorch-xformers-cuda
diffusers-pytorch-minimum-cuda
diffusers-doc-builder
)
declare -A IMAGES_TO_BUILD=()
for FILE in $CHANGED_FILES; do
# skip anything that isn't still on disk
if [[ ! -e "$FILE" ]]; then
echo "Skipping removed file $FILE"
continue
fi
for IMAGE in "${ALLOWED_IMAGES[@]}"; do
if [[ "$FILE" == docker/${IMAGE}/* ]]; then
IMAGES_TO_BUILD["$IMAGE"]=1
fi
done
done
if [[ ${#IMAGES_TO_BUILD[@]} -eq 0 ]]; then
echo "No relevant Docker changes detected."
exit 0
fi
for IMAGE in "${!IMAGES_TO_BUILD[@]}"; do
DOCKER_PATH="docker/${IMAGE}"
echo "Building Docker image for $IMAGE"
docker build -t "$IMAGE" "$DOCKER_PATH"
done
if: steps.file_changes.outputs.all != ''
build-and-push-docker-images:
runs-on:
group: aws-general-8-plus
if: github.event_name != 'pull_request'
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
image-name:
- diffusers-pytorch-cpu
- diffusers-pytorch-cuda
- diffusers-pytorch-xformers-cuda
- diffusers-pytorch-minimum-cuda
- diffusers-doc-builder
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ env.REGISTRY }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
no-cache: true
context: ./docker/${{ matrix.image-name }}
push: true
tags: ${{ env.REGISTRY }}/${{ matrix.image-name }}:latest
- name: Post to a Slack channel
id: slack
uses: huggingface/hf-workflows/.github/actions/post-slack@main
with:
# Slack channel id, channel name, or user id to post message.
# See also: https://api.slack.com/methods/chat.postMessage#channels
slack_channel: ${{ env.CI_SLACK_CHANNEL }}
title: "🤗 Results of the ${{ matrix.image-name }} Docker Image build"
status: ${{ job.status }}
slack_token: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
================================================
FILE: .github/workflows/build_documentation.yml
================================================
name: Build documentation
on:
push:
branches:
- main
- doc-builder*
- v*-release
- v*-patch
paths:
- "src/diffusers/**.py"
- "examples/**"
- "docs/**"
jobs:
build:
uses: huggingface/doc-builder/.github/workflows/build_main_documentation.yml@main
with:
commit_sha: ${{ github.sha }}
install_libgl1: true
package: diffusers
notebook_folder: diffusers_doc
languages: en ko zh ja pt
custom_container: diffusers/diffusers-doc-builder
secrets:
token: ${{ secrets.HUGGINGFACE_PUSH }}
hf_token: ${{ secrets.HF_DOC_BUILD_PUSH }}
================================================
FILE: .github/workflows/build_pr_documentation.yml
================================================
name: Build PR Documentation
on:
pull_request:
paths:
- "src/diffusers/**.py"
- "examples/**"
- "docs/**"
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
check-links:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.10'
- name: Install uv
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Install doc-builder
run: |
uv pip install --system git+https://github.com/huggingface/doc-builder.git@main
- name: Check documentation links
run: |
uv run doc-builder check-links docs/source/en
build:
needs: check-links
uses: huggingface/doc-builder/.github/workflows/build_pr_documentation.yml@main
with:
commit_sha: ${{ github.event.pull_request.head.sha }}
pr_number: ${{ github.event.number }}
install_libgl1: true
package: diffusers
languages: en ko zh ja pt
custom_container: diffusers/diffusers-doc-builder
================================================
FILE: .github/workflows/codeql.yml
================================================
---
name: CodeQL Security Analysis For Github Actions
on:
push:
branches: ["main"]
workflow_dispatch:
# pull_request:
jobs:
codeql:
name: CodeQL Analysis
uses: huggingface/security-workflows/.github/workflows/codeql-reusable.yml@v1
permissions:
security-events: write
packages: read
actions: read
contents: read
with:
languages: '["actions","python"]'
queries: 'security-extended,security-and-quality'
runner: 'ubuntu-latest' #optional if need custom runner
================================================
FILE: .github/workflows/mirror_community_pipeline.yml
================================================
name: Mirror Community Pipeline
on:
# Push changes on the main branch
push:
branches:
- main
paths:
- 'examples/community/**.py'
# And on tag creation (e.g. `v0.28.1`)
tags:
- '*'
# Manual trigger with ref input
workflow_dispatch:
inputs:
ref:
description: "Either 'main' or a tag ref"
required: true
default: 'main'
jobs:
mirror_community_pipeline:
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_COMMUNITY_MIRROR }}
runs-on: ubuntu-22.04
steps:
# Checkout to correct ref
# If workflow dispatch
# If ref is 'main', set:
# CHECKOUT_REF=refs/heads/main
# PATH_IN_REPO=main
# Else it must be a tag. Set:
# CHECKOUT_REF=refs/tags/{tag}
# PATH_IN_REPO={tag}
# If not workflow dispatch
# If ref is 'refs/heads/main' => set 'main'
# Else it must be a tag => set {tag}
- name: Set checkout_ref and path_in_repo
env:
EVENT_NAME: ${{ github.event_name }}
EVENT_INPUT_REF: ${{ github.event.inputs.ref }}
GITHUB_REF: ${{ github.ref }}
run: |
if [ "$EVENT_NAME" == "workflow_dispatch" ]; then
if [ -z "$EVENT_INPUT_REF" ]; then
echo "Error: Missing ref input"
exit 1
elif [ "$EVENT_INPUT_REF" == "main" ]; then
echo "CHECKOUT_REF=refs/heads/main" >> $GITHUB_ENV
echo "PATH_IN_REPO=main" >> $GITHUB_ENV
else
echo "CHECKOUT_REF=refs/tags/$EVENT_INPUT_REF" >> $GITHUB_ENV
echo "PATH_IN_REPO=$EVENT_INPUT_REF" >> $GITHUB_ENV
fi
elif [ "$GITHUB_REF" == "refs/heads/main" ]; then
echo "CHECKOUT_REF=$GITHUB_REF" >> $GITHUB_ENV
echo "PATH_IN_REPO=main" >> $GITHUB_ENV
else
# e.g. refs/tags/v0.28.1 -> v0.28.1
echo "CHECKOUT_REF=$GITHUB_REF" >> $GITHUB_ENV
echo "PATH_IN_REPO=$(echo $GITHUB_REF | sed 's/^refs\/tags\///')" >> $GITHUB_ENV
fi
- name: Print env vars
run: |
echo "CHECKOUT_REF: ${{ env.CHECKOUT_REF }}"
echo "PATH_IN_REPO: ${{ env.PATH_IN_REPO }}"
- uses: actions/checkout@v6
with:
ref: ${{ env.CHECKOUT_REF }}
# Setup + install dependencies
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.10"
- name: Install dependencies
run: |
pip install --upgrade pip
pip install --upgrade huggingface_hub
# Check secret is set
- name: whoami
run: hf auth whoami
env:
HF_TOKEN: ${{ secrets.HF_TOKEN_MIRROR_COMMUNITY_PIPELINES }}
# Push to HF! (under subfolder based on checkout ref)
# https://huggingface.co/datasets/diffusers/community-pipelines-mirror
- name: Mirror community pipeline to HF
run: hf upload diffusers/community-pipelines-mirror ./examples/community ${PATH_IN_REPO} --repo-type dataset
env:
PATH_IN_REPO: ${{ env.PATH_IN_REPO }}
HF_TOKEN: ${{ secrets.HF_TOKEN_MIRROR_COMMUNITY_PIPELINES }}
- name: Report success status
if: ${{ success() }}
run: |
pip install requests && python utils/notify_community_pipelines_mirror.py --status=success
- name: Report failure status
if: ${{ failure() }}
run: |
pip install requests && python utils/notify_community_pipelines_mirror.py --status=failure
================================================
FILE: .github/workflows/nightly_tests.yml
================================================
name: Nightly and release tests on main/release branch
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *" # every day at midnight
env:
DIFFUSERS_IS_CI: yes
HF_XET_HIGH_PERFORMANCE: 1
OMP_NUM_THREADS: 8
MKL_NUM_THREADS: 8
PYTEST_TIMEOUT: 600
RUN_SLOW: yes
RUN_NIGHTLY: yes
PIPELINE_USAGE_CUTOFF: 0
SLACK_API_TOKEN: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
CONSOLIDATED_REPORT_PATH: consolidated_test_report.md
jobs:
setup_torch_cuda_pipeline_matrix:
name: Setup Torch Pipelines CUDA Slow Tests Matrix
runs-on:
group: aws-general-8-plus
container:
image: diffusers/diffusers-pytorch-cpu
outputs:
pipeline_test_matrix: ${{ steps.fetch_pipeline_matrix.outputs.pipeline_test_matrix }}
steps:
- name: Checkout diffusers
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: Install dependencies
run: |
pip install -e .[test]
pip install huggingface_hub
- name: Fetch Pipeline Matrix
id: fetch_pipeline_matrix
run: |
matrix=$(python utils/fetch_torch_cuda_pipeline_test_matrix.py)
echo $matrix
echo "pipeline_test_matrix=$matrix" >> $GITHUB_OUTPUT
- name: Pipeline Tests Artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v6
with:
name: test-pipelines.json
path: reports
run_nightly_tests_for_torch_pipelines:
name: Nightly Torch Pipelines CUDA Tests
needs: setup_torch_cuda_pipeline_matrix
strategy:
fail-fast: false
max-parallel: 8
matrix:
module: ${{ fromJson(needs.setup_torch_cuda_pipeline_matrix.outputs.pipeline_test_matrix) }}
runs-on:
group: aws-g4dn-2xlarge
container:
image: diffusers/diffusers-pytorch-cuda
options: --shm-size "16gb" --ipc host --gpus all
steps:
- name: Checkout diffusers
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: NVIDIA-SMI
run: nvidia-smi
- name: Install dependencies
run: |
uv pip install -e ".[quality]"
uv pip uninstall accelerate && uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git
#uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
uv pip uninstall transformers huggingface_hub && uv pip install transformers==4.57.1
uv pip install pytest-reportlog
- name: Environment
run: |
python utils/print_env.py
- name: Pipeline CUDA Test
env:
HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }}
# https://pytorch.org/docs/stable/notes/randomness.html#avoiding-nondeterministic-algorithms
CUBLAS_WORKSPACE_CONFIG: :16:8
run: |
pytest -n 1 --max-worker-restart=0 --dist=loadfile \
-k "not Flax and not Onnx" \
--make-reports=tests_pipeline_${{ matrix.module }}_cuda \
--report-log=tests_pipeline_${{ matrix.module }}_cuda.log \
tests/pipelines/${{ matrix.module }}
- name: Failure short reports
if: ${{ failure() }}
run: |
cat reports/tests_pipeline_${{ matrix.module }}_cuda_stats.txt
cat reports/tests_pipeline_${{ matrix.module }}_cuda_failures_short.txt
- name: Test suite reports artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v6
with:
name: pipeline_${{ matrix.module }}_test_reports
path: reports
run_nightly_tests_for_other_torch_modules:
name: Nightly Torch CUDA Tests
runs-on:
group: aws-g4dn-2xlarge
container:
image: diffusers/diffusers-pytorch-cuda
options: --shm-size "16gb" --ipc host --gpus all
defaults:
run:
shell: bash
strategy:
fail-fast: false
max-parallel: 2
matrix:
module: [models, schedulers, lora, others, single_file, examples]
steps:
- name: Checkout diffusers
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: Install dependencies
run: |
uv pip install -e ".[quality]"
uv pip install peft@git+https://github.com/huggingface/peft.git
uv pip uninstall accelerate && uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git
#uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
uv pip uninstall transformers huggingface_hub && uv pip install transformers==4.57.1
uv pip install pytest-reportlog
- name: Environment
run: python utils/print_env.py
- name: Run nightly PyTorch CUDA tests for non-pipeline modules
if: ${{ matrix.module != 'examples'}}
env:
HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }}
# https://pytorch.org/docs/stable/notes/randomness.html#avoiding-nondeterministic-algorithms
CUBLAS_WORKSPACE_CONFIG: :16:8
run: |
pytest -n 1 --max-worker-restart=0 --dist=loadfile \
-k "not Flax and not Onnx" \
--make-reports=tests_torch_${{ matrix.module }}_cuda \
--report-log=tests_torch_${{ matrix.module }}_cuda.log \
tests/${{ matrix.module }}
- name: Run nightly example tests with Torch
if: ${{ matrix.module == 'examples' }}
env:
HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }}
# https://pytorch.org/docs/stable/notes/randomness.html#avoiding-nondeterministic-algorithms
CUBLAS_WORKSPACE_CONFIG: :16:8
run: |
pytest -n 1 --max-worker-restart=0 --dist=loadfile \
--make-reports=examples_torch_cuda \
--report-log=examples_torch_cuda.log \
examples/
- name: Failure short reports
if: ${{ failure() }}
run: |
cat reports/tests_torch_${{ matrix.module }}_cuda_stats.txt
cat reports/tests_torch_${{ matrix.module }}_cuda_failures_short.txt
- name: Test suite reports artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v6
with:
name: torch_${{ matrix.module }}_cuda_test_reports
path: reports
run_torch_compile_tests:
name: PyTorch Compile CUDA tests
runs-on:
group: aws-g4dn-2xlarge
container:
image: diffusers/diffusers-pytorch-cuda
options: --gpus all --shm-size "16gb" --ipc host
steps:
- name: Checkout diffusers
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: NVIDIA-SMI
run: |
nvidia-smi
- name: Install dependencies
run: |
uv pip install -e ".[quality,training]"
#uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
uv pip uninstall transformers huggingface_hub && uv pip install transformers==4.57.1
- name: Environment
run: |
python utils/print_env.py
- name: Run torch compile tests on GPU
env:
HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }}
RUN_COMPILE: yes
run: |
pytest -n 1 --max-worker-restart=0 --dist=loadfile -k "compile" --make-reports=tests_torch_compile_cuda tests/
- name: Failure short reports
if: ${{ failure() }}
run: cat reports/tests_torch_compile_cuda_failures_short.txt
- name: Test suite reports artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v6
with:
name: torch_compile_test_reports
path: reports
run_big_gpu_torch_tests:
name: Torch tests on big GPU
strategy:
fail-fast: false
max-parallel: 2
runs-on:
group: aws-g6e-xlarge-plus
container:
image: diffusers/diffusers-pytorch-cuda
options: --shm-size "16gb" --ipc host --gpus all
steps:
- name: Checkout diffusers
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: NVIDIA-SMI
run: nvidia-smi
- name: Install dependencies
run: |
uv pip install -e ".[quality]"
uv pip install peft@git+https://github.com/huggingface/peft.git
uv pip uninstall accelerate && uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git
#uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
uv pip uninstall transformers huggingface_hub && uv pip install transformers==4.57.1
uv pip install pytest-reportlog
- name: Environment
run: |
python utils/print_env.py
- name: Selected Torch CUDA Test on big GPU
env:
HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }}
# https://pytorch.org/docs/stable/notes/randomness.html#avoiding-nondeterministic-algorithms
CUBLAS_WORKSPACE_CONFIG: :16:8
BIG_GPU_MEMORY: 40
run: |
pytest -n 1 --max-worker-restart=0 --dist=loadfile \
-m "big_accelerator" \
--make-reports=tests_big_gpu_torch_cuda \
--report-log=tests_big_gpu_torch_cuda.log \
tests/
- name: Failure short reports
if: ${{ failure() }}
run: |
cat reports/tests_big_gpu_torch_cuda_stats.txt
cat reports/tests_big_gpu_torch_cuda_failures_short.txt
- name: Test suite reports artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v6
with:
name: torch_cuda_big_gpu_test_reports
path: reports
torch_minimum_version_cuda_tests:
name: Torch Minimum Version CUDA Tests
runs-on:
group: aws-g4dn-2xlarge
container:
image: diffusers/diffusers-pytorch-minimum-cuda
options: --shm-size "16gb" --ipc host --gpus all
defaults:
run:
shell: bash
steps:
- name: Checkout diffusers
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: Install dependencies
run: |
uv pip install -e ".[quality]"
uv pip install peft@git+https://github.com/huggingface/peft.git
uv pip uninstall accelerate && uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git
#uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
uv pip uninstall transformers huggingface_hub && uv pip install transformers==4.57.1
- name: Environment
run: |
python utils/print_env.py
- name: Run PyTorch CUDA tests
env:
HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }}
# https://pytorch.org/docs/stable/notes/randomness.html#avoiding-nondeterministic-algorithms
CUBLAS_WORKSPACE_CONFIG: :16:8
run: |
pytest -n 1 --max-worker-restart=0 --dist=loadfile \
-k "not Flax and not Onnx" \
--make-reports=tests_torch_minimum_version_cuda \
tests/models/test_modeling_common.py \
tests/pipelines/test_pipelines_common.py \
tests/pipelines/test_pipeline_utils.py \
tests/pipelines/test_pipelines.py \
tests/pipelines/test_pipelines_auto.py \
tests/schedulers/test_schedulers.py \
tests/others
- name: Failure short reports
if: ${{ failure() }}
run: |
cat reports/tests_torch_minimum_version_cuda_stats.txt
cat reports/tests_torch_minimum_version_cuda_failures_short.txt
- name: Test suite reports artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v6
with:
name: torch_minimum_version_cuda_test_reports
path: reports
run_nightly_quantization_tests:
name: Torch quantization nightly tests
strategy:
fail-fast: false
max-parallel: 2
matrix:
config:
- backend: "bitsandbytes"
test_location: "bnb"
additional_deps: ["peft"]
- backend: "gguf"
test_location: "gguf"
additional_deps: ["peft", "kernels"]
- backend: "torchao"
test_location: "torchao"
additional_deps: []
- backend: "optimum_quanto"
test_location: "quanto"
additional_deps: []
- backend: "nvidia_modelopt"
test_location: "modelopt"
additional_deps: []
runs-on:
group: aws-g6e-xlarge-plus
container:
image: diffusers/diffusers-pytorch-cuda
options: --shm-size "20gb" --ipc host --gpus all
steps:
- name: Checkout diffusers
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: NVIDIA-SMI
run: nvidia-smi
- name: Install dependencies
run: |
uv pip install -e ".[quality]"
uv pip install -U ${{ matrix.config.backend }}
if [ "${{ join(matrix.config.additional_deps, ' ') }}" != "" ]; then
uv pip install ${{ join(matrix.config.additional_deps, ' ') }}
fi
uv pip install pytest-reportlog
#uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
uv pip uninstall transformers huggingface_hub && uv pip install transformers==4.57.1
- name: Environment
run: |
python utils/print_env.py
- name: ${{ matrix.config.backend }} quantization tests on GPU
env:
HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }}
# https://pytorch.org/docs/stable/notes/randomness.html#avoiding-nondeterministic-algorithms
CUBLAS_WORKSPACE_CONFIG: :16:8
BIG_GPU_MEMORY: 40
run: |
pytest -n 1 --max-worker-restart=0 --dist=loadfile \
--make-reports=tests_${{ matrix.config.backend }}_torch_cuda \
--report-log=tests_${{ matrix.config.backend }}_torch_cuda.log \
tests/quantization/${{ matrix.config.test_location }}
- name: Failure short reports
if: ${{ failure() }}
run: |
cat reports/tests_${{ matrix.config.backend }}_torch_cuda_stats.txt
cat reports/tests_${{ matrix.config.backend }}_torch_cuda_failures_short.txt
- name: Test suite reports artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v6
with:
name: torch_cuda_${{ matrix.config.backend }}_reports
path: reports
run_nightly_pipeline_level_quantization_tests:
name: Torch quantization nightly tests
strategy:
fail-fast: false
max-parallel: 2
runs-on:
group: aws-g6e-xlarge-plus
container:
image: diffusers/diffusers-pytorch-cuda
options: --shm-size "20gb" --ipc host --gpus all
steps:
- name: Checkout diffusers
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: NVIDIA-SMI
run: nvidia-smi
- name: Install dependencies
run: |
uv pip install -e ".[quality]"
uv pip install -U bitsandbytes optimum_quanto
#uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
uv pip uninstall transformers huggingface_hub && uv pip install transformers==4.57.1
uv pip install pytest-reportlog
- name: Environment
run: |
python utils/print_env.py
- name: Pipeline-level quantization tests on GPU
env:
HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }}
# https://pytorch.org/docs/stable/notes/randomness.html#avoiding-nondeterministic-algorithms
CUBLAS_WORKSPACE_CONFIG: :16:8
BIG_GPU_MEMORY: 40
run: |
pytest -n 1 --max-worker-restart=0 --dist=loadfile \
--make-reports=tests_pipeline_level_quant_torch_cuda \
--report-log=tests_pipeline_level_quant_torch_cuda.log \
tests/quantization/test_pipeline_level_quantization.py
- name: Failure short reports
if: ${{ failure() }}
run: |
cat reports/tests_pipeline_level_quant_torch_cuda_stats.txt
cat reports/tests_pipeline_level_quant_torch_cuda_failures_short.txt
- name: Test suite reports artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v6
with:
name: torch_cuda_pipeline_level_quant_reports
path: reports
generate_consolidated_report:
name: Generate Consolidated Test Report
needs: [
run_nightly_tests_for_torch_pipelines,
run_nightly_tests_for_other_torch_modules,
run_torch_compile_tests,
run_big_gpu_torch_tests,
run_nightly_quantization_tests,
run_nightly_pipeline_level_quantization_tests,
# run_nightly_onnx_tests,
torch_minimum_version_cuda_tests,
# run_flax_tpu_tests
]
if: always()
runs-on:
group: aws-general-8-plus
container:
image: diffusers/diffusers-pytorch-cpu
steps:
- name: Checkout diffusers
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: Create reports directory
run: mkdir -p combined_reports
- name: Download all test reports
uses: actions/download-artifact@v7
with:
path: artifacts
- name: Prepare reports
run: |
# Move all report files to a single directory for processing
find artifacts -name "*.txt" -exec cp {} combined_reports/ \;
- name: Install dependencies
run: |
pip install -e .[test]
pip install slack_sdk tabulate
- name: Generate consolidated report
run: |
python utils/consolidated_test_report.py \
--reports_dir combined_reports \
--output_file $CONSOLIDATED_REPORT_PATH \
--slack_channel_name diffusers-ci-nightly
- name: Show consolidated report
run: |
cat $CONSOLIDATED_REPORT_PATH >> $GITHUB_STEP_SUMMARY
- name: Upload consolidated report
uses: actions/upload-artifact@v6
with:
name: consolidated_test_report
path: ${{ env.CONSOLIDATED_REPORT_PATH }}
# M1 runner currently not well supported
# TODO: (Dhruv) add these back when we setup better testing for Apple Silicon
# run_nightly_tests_apple_m1:
# name: Nightly PyTorch MPS tests on MacOS
# runs-on: [ self-hosted, apple-m1 ]
# if: github.event_name == 'schedule'
#
# steps:
# - name: Checkout diffusers
# uses: actions/checkout@v6
# with:
# fetch-depth: 2
#
# - name: Clean checkout
# shell: arch -arch arm64 bash {0}
# run: |
# git clean -fxd
# - name: Setup miniconda
# uses: ./.github/actions/setup-miniconda
# with:
# python-version: 3.9
#
# - name: Install dependencies
# shell: arch -arch arm64 bash {0}
# run: |
# ${CONDA_RUN} pip install --upgrade pip uv
# ${CONDA_RUN} uv pip install -e ".[quality]"
# ${CONDA_RUN} uv pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu
# ${CONDA_RUN} uv pip install accelerate@git+https://github.com/huggingface/accelerate
# ${CONDA_RUN} uv pip install pytest-reportlog
# - name: Environment
# shell: arch -arch arm64 bash {0}
# run: |
# ${CONDA_RUN} python utils/print_env.py
# - name: Run nightly PyTorch tests on M1 (MPS)
# shell: arch -arch arm64 bash {0}
# env:
# HF_HOME: /System/Volumes/Data/mnt/cache
# HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }}
# run: |
# ${CONDA_RUN} pytest -n 1 --make-reports=tests_torch_mps \
# --report-log=tests_torch_mps.log \
# tests/
# - name: Failure short reports
# if: ${{ failure() }}
# run: cat reports/tests_torch_mps_failures_short.txt
#
# - name: Test suite reports artifacts
# if: ${{ always() }}
# uses: actions/upload-artifact@v6
# with:
# name: torch_mps_test_reports
# path: reports
#
# - name: Generate Report and Notify Channel
# if: always()
# run: |
# pip install slack_sdk tabulate
# python utils/log_reports.py >> $GITHUB_STEP_SUMMARY run_nightly_tests_apple_m1:
# name: Nightly PyTorch MPS tests on MacOS
# runs-on: [ self-hosted, apple-m1 ]
# if: github.event_name == 'schedule'
#
# steps:
# - name: Checkout diffusers
# uses: actions/checkout@v6
# with:
# fetch-depth: 2
#
# - name: Clean checkout
# shell: arch -arch arm64 bash {0}
# run: |
# git clean -fxd
# - name: Setup miniconda
# uses: ./.github/actions/setup-miniconda
# with:
# python-version: 3.9
#
# - name: Install dependencies
# shell: arch -arch arm64 bash {0}
# run: |
# ${CONDA_RUN} pip install --upgrade pip uv
# ${CONDA_RUN} uv pip install -e ".[quality]"
# ${CONDA_RUN} uv pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu
# ${CONDA_RUN} uv pip install accelerate@git+https://github.com/huggingface/accelerate
# ${CONDA_RUN} uv pip install pytest-reportlog
# - name: Environment
# shell: arch -arch arm64 bash {0}
# run: |
# ${CONDA_RUN} python utils/print_env.py
# - name: Run nightly PyTorch tests on M1 (MPS)
# shell: arch -arch arm64 bash {0}
# env:
# HF_HOME: /System/Volumes/Data/mnt/cache
# HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }}
# run: |
# ${CONDA_RUN} pytest -n 1 --make-reports=tests_torch_mps \
# --report-log=tests_torch_mps.log \
# tests/
# - name: Failure short reports
# if: ${{ failure() }}
# run: cat reports/tests_torch_mps_failures_short.txt
#
# - name: Test suite reports artifacts
# if: ${{ always() }}
# uses: actions/upload-artifact@v6
# with:
# name: torch_mps_test_reports
# path: reports
#
# - name: Generate Report and Notify Channel
# if: always()
# run: |
# pip install slack_sdk tabulate
# python utils/log_reports.py >> $GITHUB_STEP_SUMMARY
================================================
FILE: .github/workflows/notify_slack_about_release.yml
================================================
name: Notify Slack about a release
on:
workflow_dispatch:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: '3.10'
- name: Notify Slack about the release
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
run: pip install requests && python utils/notify_slack_about_release.py
================================================
FILE: .github/workflows/pr_dependency_test.yml
================================================
name: Run dependency tests
on:
pull_request:
branches:
- main
paths:
- "src/diffusers/**.py"
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
check_dependencies:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.10"
- name: Install dependencies
run: |
pip install -e .
pip install pytest
- name: Check for soft dependencies
run: |
pytest tests/others/test_dependencies.py
================================================
FILE: .github/workflows/pr_modular_tests.yml
================================================
name: Fast PR tests for Modular
on:
pull_request:
branches: [main]
paths:
- "src/diffusers/modular_pipelines/**.py"
- "src/diffusers/models/modeling_utils.py"
- "src/diffusers/models/model_loading_utils.py"
- "src/diffusers/pipelines/pipeline_utils.py"
- "src/diffusers/pipeline_loading_utils.py"
- "src/diffusers/loaders/lora_base.py"
- "src/diffusers/loaders/lora_pipeline.py"
- "src/diffusers/loaders/peft.py"
- "tests/modular_pipelines/**.py"
- ".github/**.yml"
- "utils/**.py"
- "setup.py"
push:
branches:
- ci-*
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
DIFFUSERS_IS_CI: yes
HF_XET_HIGH_PERFORMANCE: 1
OMP_NUM_THREADS: 4
MKL_NUM_THREADS: 4
PYTEST_TIMEOUT: 60
jobs:
check_code_quality:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.10"
- name: Install dependencies
run: |
pip install --upgrade pip
pip install .[quality]
- name: Check quality
run: make quality
- name: Check if failure
if: ${{ failure() }}
run: |
echo "Quality check failed. Please ensure the right dependency versions are installed with 'pip install -e .[quality]' and run 'make style && make quality'" >> $GITHUB_STEP_SUMMARY
check_repository_consistency:
needs: check_code_quality
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.10"
- name: Install dependencies
run: |
pip install --upgrade pip
pip install .[quality]
- name: Check repo consistency
run: |
python utils/check_copies.py
python utils/check_dummies.py
python utils/check_support_list.py
make deps_table_check_updated
- name: Check if failure
if: ${{ failure() }}
run: |
echo "Repo consistency check failed. Please ensure the right dependency versions are installed with 'pip install -e .[quality]' and run 'make fix-copies'" >> $GITHUB_STEP_SUMMARY
check_auto_docs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.10"
- name: Install dependencies
run: |
pip install --upgrade pip
pip install .[quality]
- name: Check auto docs
run: make modular-autodoctrings
- name: Check if failure
if: ${{ failure() }}
run: |
echo "Auto docstring checks failed. Please run `python utils/modular_auto_docstring.py --fix_and_overwrite`." >> $GITHUB_STEP_SUMMARY
run_fast_tests:
needs: [check_code_quality, check_repository_consistency, check_auto_docs]
name: Fast PyTorch Modular Pipeline CPU tests
runs-on:
group: aws-highmemory-32-plus
container:
image: diffusers/diffusers-pytorch-cpu
options: --shm-size "16gb" --ipc host -v /mnt/hf_cache:/mnt/cache/
defaults:
run:
shell: bash
steps:
- name: Checkout diffusers
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: Install dependencies
run: |
uv pip install -e ".[quality]"
#uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
uv pip uninstall transformers huggingface_hub && uv pip install transformers==4.57.1
uv pip uninstall accelerate && uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git --no-deps
- name: Environment
run: |
python utils/print_env.py
- name: Run fast PyTorch Pipeline CPU tests
run: |
pytest -n 8 --max-worker-restart=0 --dist=loadfile \
-k "not Flax and not Onnx" \
--make-reports=tests_torch_cpu_modular_pipelines \
tests/modular_pipelines
- name: Failure short reports
if: ${{ failure() }}
run: cat reports/tests_torch_cpu_modular_pipelines_failures_short.txt
- name: Test suite reports artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v6
with:
name: pr_pytorch_pipelines_torch_cpu_modular_pipelines_test_reports
path: reports
================================================
FILE: .github/workflows/pr_style_bot.yml
================================================
name: PR Style Bot
on:
issue_comment:
types: [created]
permissions:
contents: write
pull-requests: write
jobs:
style:
uses: huggingface/huggingface_hub/.github/workflows/style-bot-action.yml@main
with:
python_quality_dependencies: "[quality]"
secrets:
bot_token: ${{ secrets.HF_STYLE_BOT_ACTION }}
================================================
FILE: .github/workflows/pr_test_fetcher.yml
================================================
name: Fast tests for PRs - Test Fetcher
on: workflow_dispatch
env:
DIFFUSERS_IS_CI: yes
OMP_NUM_THREADS: 4
MKL_NUM_THREADS: 4
PYTEST_TIMEOUT: 60
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
setup_pr_tests:
name: Setup PR Tests
runs-on:
group: aws-general-8-plus
container:
image: diffusers/diffusers-pytorch-cpu
options: --shm-size "16gb" --ipc host -v /mnt/hf_cache:/mnt/cache/
defaults:
run:
shell: bash
outputs:
matrix: ${{ steps.set_matrix.outputs.matrix }}
test_map: ${{ steps.set_matrix.outputs.test_map }}
steps:
- name: Checkout diffusers
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Install dependencies
run: |
uv pip install -e ".[quality]"
- name: Environment
run: |
python utils/print_env.py
echo $(git --version)
- name: Fetch Tests
run: |
python utils/tests_fetcher.py | tee test_preparation.txt
- name: Report fetched tests
uses: actions/upload-artifact@v6
with:
name: test_fetched
path: test_preparation.txt
- id: set_matrix
name: Create Test Matrix
# The `keys` is used as GitHub actions matrix for jobs, i.e. `models`, `pipelines`, etc.
# The `test_map` is used to get the actual identified test files under each key.
# If no test to run (so no `test_map.json` file), create a dummy map (empty matrix will fail)
run: |
if [ -f test_map.json ]; then
keys=$(python3 -c 'import json; fp = open("test_map.json"); test_map = json.load(fp); fp.close(); d = list(test_map.keys()); print(json.dumps(d))')
test_map=$(python3 -c 'import json; fp = open("test_map.json"); test_map = json.load(fp); fp.close(); print(json.dumps(test_map))')
else
keys=$(python3 -c 'keys = ["dummy"]; print(keys)')
test_map=$(python3 -c 'test_map = {"dummy": []}; print(test_map)')
fi
echo $keys
echo $test_map
echo "matrix=$keys" >> $GITHUB_OUTPUT
echo "test_map=$test_map" >> $GITHUB_OUTPUT
run_pr_tests:
name: Run PR Tests
needs: setup_pr_tests
if: contains(fromJson(needs.setup_pr_tests.outputs.matrix), 'dummy') != true
strategy:
fail-fast: false
max-parallel: 2
matrix:
modules: ${{ fromJson(needs.setup_pr_tests.outputs.matrix) }}
runs-on:
group: aws-general-8-plus
container:
image: diffusers/diffusers-pytorch-cpu
options: --shm-size "16gb" --ipc host -v /mnt/hf_cache:/mnt/cache/
defaults:
run:
shell: bash
steps:
- name: Checkout diffusers
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: Install dependencies
run: |
uv pip install -e ".[quality]"
uv pip install accelerate
- name: Environment
run: |
python utils/print_env.py
- name: Run all selected tests on CPU
run: |
pytest -n 2 --dist=loadfile -v --make-reports=${{ matrix.modules }}_tests_cpu ${{ fromJson(needs.setup_pr_tests.outputs.test_map)[matrix.modules] }}
- name: Failure short reports
if: ${{ failure() }}
continue-on-error: true
run: |
cat reports/${{ matrix.modules }}_tests_cpu_stats.txt
cat reports/${{ matrix.modules }}_tests_cpu_failures_short.txt
- name: Test suite reports artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v6
with:
name: ${{ matrix.modules }}_test_reports
path: reports
run_staging_tests:
strategy:
fail-fast: false
matrix:
config:
- name: Hub tests for models, schedulers, and pipelines
framework: hub_tests_pytorch
runner: aws-general-8-plus
image: diffusers/diffusers-pytorch-cpu
report: torch_hub
name: ${{ matrix.config.name }}
runs-on:
group: ${{ matrix.config.runner }}
container:
image: ${{ matrix.config.image }}
options: --shm-size "16gb" --ipc host -v /mnt/hf_cache:/mnt/cache/
defaults:
run:
shell: bash
steps:
- name: Checkout diffusers
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: Install dependencies
run: |
pip install -e [quality]
- name: Environment
run: |
python utils/print_env.py
- name: Run Hub tests for models, schedulers, and pipelines on a staging env
if: ${{ matrix.config.framework == 'hub_tests_pytorch' }}
run: |
HUGGINGFACE_CO_STAGING=true pytest \
-m "is_staging_test" \
--make-reports=tests_${{ matrix.config.report }} \
tests
- name: Failure short reports
if: ${{ failure() }}
run: cat reports/tests_${{ matrix.config.report }}_failures_short.txt
- name: Test suite reports artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v6
with:
name: pr_${{ matrix.config.report }}_test_reports
path: reports
================================================
FILE: .github/workflows/pr_tests.yml
================================================
name: Fast tests for PRs
on:
pull_request:
branches: [main]
paths:
- "src/diffusers/**.py"
- "benchmarks/**.py"
- "examples/**.py"
- "scripts/**.py"
- "tests/**.py"
- ".github/**.yml"
- "utils/**.py"
- "setup.py"
push:
branches:
- ci-*
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
DIFFUSERS_IS_CI: yes
HF_XET_HIGH_PERFORMANCE: 1
OMP_NUM_THREADS: 4
MKL_NUM_THREADS: 4
PYTEST_TIMEOUT: 60
jobs:
check_code_quality:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.10"
- name: Install dependencies
run: |
pip install --upgrade pip
pip install .[quality]
- name: Check quality
run: make quality
- name: Check if failure
if: ${{ failure() }}
run: |
echo "Quality check failed. Please ensure the right dependency versions are installed with 'pip install -e .[quality]' and run 'make style && make quality'" >> $GITHUB_STEP_SUMMARY
check_repository_consistency:
needs: check_code_quality
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.10"
- name: Install dependencies
run: |
pip install --upgrade pip
pip install .[quality]
- name: Check repo consistency
run: |
python utils/check_copies.py
python utils/check_dummies.py
python utils/check_support_list.py
make deps_table_check_updated
- name: Check if failure
if: ${{ failure() }}
run: |
echo "Repo consistency check failed. Please ensure the right dependency versions are installed with 'pip install -e .[quality]' and run 'make fix-copies'" >> $GITHUB_STEP_SUMMARY
run_fast_tests:
needs: [check_code_quality, check_repository_consistency]
strategy:
fail-fast: false
matrix:
config:
- name: Fast PyTorch Pipeline CPU tests
framework: pytorch_pipelines
runner: aws-highmemory-32-plus
image: diffusers/diffusers-pytorch-cpu
report: torch_cpu_pipelines
- name: Fast PyTorch Models & Schedulers CPU tests
framework: pytorch_models
runner: aws-general-8-plus
image: diffusers/diffusers-pytorch-cpu
report: torch_cpu_models_schedulers
- name: PyTorch Example CPU tests
framework: pytorch_examples
runner: aws-general-8-plus
image: diffusers/diffusers-pytorch-cpu
report: torch_example_cpu
name: ${{ matrix.config.name }}
runs-on:
group: ${{ matrix.config.runner }}
container:
image: ${{ matrix.config.image }}
options: --shm-size "16gb" --ipc host -v /mnt/hf_cache:/mnt/cache/
defaults:
run:
shell: bash
steps:
- name: Checkout diffusers
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: Install dependencies
run: |
uv pip install -e ".[quality]"
uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
uv pip uninstall accelerate && uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git --no-deps
- name: Environment
run: |
python utils/print_env.py
- name: Run fast PyTorch Pipeline CPU tests
if: ${{ matrix.config.framework == 'pytorch_pipelines' }}
run: |
pytest -n 8 --max-worker-restart=0 --dist=loadfile \
-k "not Flax and not Onnx" \
--make-reports=tests_${{ matrix.config.report }} \
tests/pipelines
- name: Run fast PyTorch Model Scheduler CPU tests
if: ${{ matrix.config.framework == 'pytorch_models' }}
run: |
pytest -n 4 --max-worker-restart=0 --dist=loadfile \
-k "not Flax and not Onnx and not Dependency" \
--make-reports=tests_${{ matrix.config.report }} \
tests/models tests/schedulers tests/others
- name: Run example PyTorch CPU tests
if: ${{ matrix.config.framework == 'pytorch_examples' }}
run: |
uv pip install ".[training]"
pytest -n 4 --max-worker-restart=0 --dist=loadfile \
--make-reports=tests_${{ matrix.config.report }} \
examples
- name: Failure short reports
if: ${{ failure() }}
run: cat reports/tests_${{ matrix.config.report }}_failures_short.txt
- name: Test suite reports artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v6
with:
name: pr_${{ matrix.config.framework }}_${{ matrix.config.report }}_test_reports
path: reports
run_staging_tests:
needs: [check_code_quality, check_repository_consistency]
strategy:
fail-fast: false
matrix:
config:
- name: Hub tests for models, schedulers, and pipelines
framework: hub_tests_pytorch
runner:
group: aws-general-8-plus
image: diffusers/diffusers-pytorch-cpu
report: torch_hub
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.runner }}
container:
image: ${{ matrix.config.image }}
options: --shm-size "16gb" --ipc host -v /mnt/hf_cache:/mnt/cache/
defaults:
run:
shell: bash
steps:
- name: Checkout diffusers
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: Install dependencies
run: |
uv pip install -e ".[quality]"
- name: Environment
run: |
python utils/print_env.py
- name: Run Hub tests for models, schedulers, and pipelines on a staging env
if: ${{ matrix.config.framework == 'hub_tests_pytorch' }}
run: |
HUGGINGFACE_CO_STAGING=true pytest \
-m "is_staging_test" \
--make-reports=tests_${{ matrix.config.report }} \
tests
- name: Failure short reports
if: ${{ failure() }}
run: cat reports/tests_${{ matrix.config.report }}_failures_short.txt
- name: Test suite reports artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v6
with:
name: pr_${{ matrix.config.report }}_test_reports
path: reports
run_lora_tests:
needs: [check_code_quality, check_repository_consistency]
name: LoRA tests with PEFT main
runs-on:
group: aws-general-8-plus
container:
image: diffusers/diffusers-pytorch-cpu
options: --shm-size "16gb" --ipc host -v /mnt/hf_cache:/mnt/cache/
defaults:
run:
shell: bash
steps:
- name: Checkout diffusers
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: Install dependencies
run: |
uv pip install -e ".[quality]"
# TODO (sayakpaul, DN6): revisit `--no-deps`
uv pip install -U peft@git+https://github.com/huggingface/peft.git --no-deps
uv pip install -U tokenizers
uv pip uninstall accelerate && uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git --no-deps
uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
- name: Environment
run: |
python utils/print_env.py
- name: Run fast PyTorch LoRA tests with PEFT
run: |
pytest -n 4 --max-worker-restart=0 --dist=loadfile \
\
--make-reports=tests_peft_main \
tests/lora/
pytest -n 4 --max-worker-restart=0 --dist=loadfile \
\
--make-reports=tests_models_lora_peft_main \
tests/models/ -k "lora"
- name: Failure short reports
if: ${{ failure() }}
run: |
cat reports/tests_peft_main_failures_short.txt
cat reports/tests_models_lora_peft_main_failures_short.txt
- name: Test suite reports artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v6
with:
name: pr_lora_test_reports
path: reports
================================================
FILE: .github/workflows/pr_tests_gpu.yml
================================================
name: Fast GPU Tests on PR
permissions:
contents: read
on:
pull_request:
branches: main
paths:
- "src/diffusers/models/modeling_utils.py"
- "src/diffusers/models/model_loading_utils.py"
- "src/diffusers/pipelines/pipeline_utils.py"
- "src/diffusers/pipeline_loading_utils.py"
- "src/diffusers/loaders/lora_base.py"
- "src/diffusers/loaders/lora_pipeline.py"
- "src/diffusers/loaders/peft.py"
- "tests/pipelines/test_pipelines_common.py"
- "tests/models/test_modeling_common.py"
- "examples/**/*.py"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
DIFFUSERS_IS_CI: yes
OMP_NUM_THREADS: 8
MKL_NUM_THREADS: 8
HF_XET_HIGH_PERFORMANCE: 1
PYTEST_TIMEOUT: 600
PIPELINE_USAGE_CUTOFF: 1000000000 # set high cutoff so that only always-test pipelines run
jobs:
check_code_quality:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.10"
- name: Install dependencies
run: |
pip install --upgrade pip
pip install .[quality]
- name: Check quality
run: make quality
- name: Check if failure
if: ${{ failure() }}
run: |
echo "Quality check failed. Please ensure the right dependency versions are installed with 'pip install -e .[quality]' and run 'make style && make quality'" >> $GITHUB_STEP_SUMMARY
check_repository_consistency:
needs: check_code_quality
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.10"
- name: Install dependencies
run: |
pip install --upgrade pip
pip install .[quality]
- name: Check repo consistency
run: |
python utils/check_copies.py
python utils/check_dummies.py
python utils/check_support_list.py
make deps_table_check_updated
- name: Check if failure
if: ${{ failure() }}
run: |
echo "Repo consistency check failed. Please ensure the right dependency versions are installed with 'pip install -e .[quality]' and run 'make fix-copies'" >> $GITHUB_STEP_SUMMARY
setup_torch_cuda_pipeline_matrix:
needs: [check_code_quality, check_repository_consistency]
name: Setup Torch Pipelines CUDA Slow Tests Matrix
runs-on:
group: aws-general-8-plus
container:
image: diffusers/diffusers-pytorch-cpu
outputs:
pipeline_test_matrix: ${{ steps.fetch_pipeline_matrix.outputs.pipeline_test_matrix }}
steps:
- name: Checkout diffusers
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: Install dependencies
run: |
uv pip install -e ".[quality]"
- name: Environment
run: |
python utils/print_env.py
- name: Fetch Pipeline Matrix
id: fetch_pipeline_matrix
run: |
matrix=$(python utils/fetch_torch_cuda_pipeline_test_matrix.py)
echo $matrix
echo "pipeline_test_matrix=$matrix" >> $GITHUB_OUTPUT
- name: Pipeline Tests Artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v6
with:
name: test-pipelines.json
path: reports
torch_pipelines_cuda_tests:
name: Torch Pipelines CUDA Tests
needs: setup_torch_cuda_pipeline_matrix
strategy:
fail-fast: false
max-parallel: 8
matrix:
module: ${{ fromJson(needs.setup_torch_cuda_pipeline_matrix.outputs.pipeline_test_matrix) }}
runs-on:
group: aws-g4dn-2xlarge
container:
image: diffusers/diffusers-pytorch-cuda
options: --shm-size "16gb" --ipc host --gpus all
steps:
- name: Checkout diffusers
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: NVIDIA-SMI
run: |
nvidia-smi
- name: Install dependencies
run: |
uv pip install -e ".[quality]"
uv pip uninstall accelerate && uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git
uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
- name: Environment
run: |
python utils/print_env.py
- name: Extract tests
id: extract_tests
run: |
pattern=$(python utils/extract_tests_from_mixin.py --type pipeline)
echo "$pattern" > /tmp/test_pattern.txt
echo "pattern_file=/tmp/test_pattern.txt" >> $GITHUB_OUTPUT
- name: PyTorch CUDA checkpoint tests on Ubuntu
env:
HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }}
# https://pytorch.org/docs/stable/notes/randomness.html#avoiding-nondeterministic-algorithms
CUBLAS_WORKSPACE_CONFIG: :16:8
run: |
if [ "${{ matrix.module }}" = "ip_adapters" ]; then
pytest -n 1 --max-worker-restart=0 --dist=loadfile \
-k "not Flax and not Onnx" \
--make-reports=tests_pipeline_${{ matrix.module }}_cuda \
tests/pipelines/${{ matrix.module }}
else
pattern=$(cat ${{ steps.extract_tests.outputs.pattern_file }})
pytest -n 1 --max-worker-restart=0 --dist=loadfile \
-k "not Flax and not Onnx and $pattern" \
--make-reports=tests_pipeline_${{ matrix.module }}_cuda \
tests/pipelines/${{ matrix.module }}
fi
- name: Failure short reports
if: ${{ failure() }}
run: |
cat reports/tests_pipeline_${{ matrix.module }}_cuda_stats.txt
cat reports/tests_pipeline_${{ matrix.module }}_cuda_failures_short.txt
- name: Test suite reports artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v6
with:
name: pipeline_${{ matrix.module }}_test_reports
path: reports
torch_cuda_tests:
name: Torch CUDA Tests
needs: [check_code_quality, check_repository_consistency]
runs-on:
group: aws-g4dn-2xlarge
container:
image: diffusers/diffusers-pytorch-cuda
options: --shm-size "16gb" --ipc host --gpus all
defaults:
run:
shell: bash
strategy:
fail-fast: false
max-parallel: 4
matrix:
module: [models, schedulers, lora, others]
steps:
- name: Checkout diffusers
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: Install dependencies
run: |
uv pip install -e ".[quality]"
uv pip install peft@git+https://github.com/huggingface/peft.git
uv pip uninstall accelerate && uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git
uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
- name: Environment
run: |
python utils/print_env.py
- name: Extract tests
id: extract_tests
run: |
pattern=$(python utils/extract_tests_from_mixin.py --type ${{ matrix.module }})
echo "$pattern" > /tmp/test_pattern.txt
echo "pattern_file=/tmp/test_pattern.txt" >> $GITHUB_OUTPUT
- name: Run PyTorch CUDA tests
env:
HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }}
# https://pytorch.org/docs/stable/notes/randomness.html#avoiding-nondeterministic-algorithms
CUBLAS_WORKSPACE_CONFIG: :16:8
run: |
pattern=$(cat ${{ steps.extract_tests.outputs.pattern_file }})
if [ -z "$pattern" ]; then
pytest -n 1 --max-worker-restart=0 --dist=loadfile -k "not Flax and not Onnx" tests/${{ matrix.module }} \
--make-reports=tests_torch_cuda_${{ matrix.module }}
else
pytest -n 1 --max-worker-restart=0 --dist=loadfile -k "not Flax and not Onnx and $pattern" tests/${{ matrix.module }} \
--make-reports=tests_torch_cuda_${{ matrix.module }}
fi
- name: Failure short reports
if: ${{ failure() }}
run: |
cat reports/tests_torch_cuda_${{ matrix.module }}_stats.txt
cat reports/tests_torch_cuda_${{ matrix.module }}_failures_short.txt
- name: Test suite reports artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v6
with:
name: torch_cuda_test_reports_${{ matrix.module }}
path: reports
run_examples_tests:
name: Examples PyTorch CUDA tests on Ubuntu
needs: [check_code_quality, check_repository_consistency]
runs-on:
group: aws-g4dn-2xlarge
container:
image: diffusers/diffusers-pytorch-cuda
options: --gpus all --shm-size "16gb" --ipc host
steps:
- name: Checkout diffusers
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: NVIDIA-SMI
run: |
nvidia-smi
- name: Install dependencies
run: |
uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
uv pip install -e ".[quality,training]"
- name: Environment
run: |
python utils/print_env.py
- name: Run example tests on GPU
env:
HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }}
run: |
uv pip install ".[training]"
pytest -n 1 --max-worker-restart=0 --dist=loadfile --make-reports=examples_torch_cuda examples/
- name: Failure short reports
if: ${{ failure() }}
run: |
cat reports/examples_torch_cuda_stats.txt
cat reports/examples_torch_cuda_failures_short.txt
- name: Test suite reports artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v6
with:
name: examples_test_reports
path: reports
================================================
FILE: .github/workflows/pr_torch_dependency_test.yml
================================================
name: Run Torch dependency tests
on:
pull_request:
branches:
- main
paths:
- "src/diffusers/**.py"
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
check_torch_dependencies:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.10"
- name: Install dependencies
run: |
pip install -e .
pip install torch torchvision torchaudio pytest
- name: Check for soft dependencies
run: |
pytest tests/others/test_dependencies.py
================================================
FILE: .github/workflows/push_tests.yml
================================================
name: Fast GPU Tests on main
on:
workflow_dispatch:
push:
branches:
- main
paths:
- "src/diffusers/**.py"
- "examples/**.py"
- "tests/**.py"
env:
DIFFUSERS_IS_CI: yes
OMP_NUM_THREADS: 8
MKL_NUM_THREADS: 8
HF_XET_HIGH_PERFORMANCE: 1
PYTEST_TIMEOUT: 600
PIPELINE_USAGE_CUTOFF: 50000
jobs:
setup_torch_cuda_pipeline_matrix:
name: Setup Torch Pipelines CUDA Slow Tests Matrix
runs-on:
group: aws-general-8-plus
container:
image: diffusers/diffusers-pytorch-cpu
outputs:
pipeline_test_matrix: ${{ steps.fetch_pipeline_matrix.outputs.pipeline_test_matrix }}
steps:
- name: Checkout diffusers
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: Install dependencies
run: |
uv pip install -e ".[quality]"
- name: Environment
run: |
python utils/print_env.py
- name: Fetch Pipeline Matrix
id: fetch_pipeline_matrix
run: |
matrix=$(python utils/fetch_torch_cuda_pipeline_test_matrix.py)
echo $matrix
echo "pipeline_test_matrix=$matrix" >> $GITHUB_OUTPUT
- name: Pipeline Tests Artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v6
with:
name: test-pipelines.json
path: reports
torch_pipelines_cuda_tests:
name: Torch Pipelines CUDA Tests
needs: setup_torch_cuda_pipeline_matrix
strategy:
fail-fast: false
max-parallel: 8
matrix:
module: ${{ fromJson(needs.setup_torch_cuda_pipeline_matrix.outputs.pipeline_test_matrix) }}
runs-on:
group: aws-g4dn-2xlarge
container:
image: diffusers/diffusers-pytorch-cuda
options: --shm-size "16gb" --ipc host --gpus all
steps:
- name: Checkout diffusers
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: NVIDIA-SMI
run: |
nvidia-smi
- name: Install dependencies
run: |
uv pip install -e ".[quality]"
uv pip uninstall accelerate && uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git
uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
- name: Environment
run: |
python utils/print_env.py
- name: PyTorch CUDA checkpoint tests on Ubuntu
env:
HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }}
# https://pytorch.org/docs/stable/notes/randomness.html#avoiding-nondeterministic-algorithms
CUBLAS_WORKSPACE_CONFIG: :16:8
run: |
pytest -n 1 --max-worker-restart=0 --dist=loadfile \
-k "not Flax and not Onnx" \
--make-reports=tests_pipeline_${{ matrix.module }}_cuda \
tests/pipelines/${{ matrix.module }}
- name: Failure short reports
if: ${{ failure() }}
run: |
cat reports/tests_pipeline_${{ matrix.module }}_cuda_stats.txt
cat reports/tests_pipeline_${{ matrix.module }}_cuda_failures_short.txt
- name: Test suite reports artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v6
with:
name: pipeline_${{ matrix.module }}_test_reports
path: reports
torch_cuda_tests:
name: Torch CUDA Tests
runs-on:
group: aws-g4dn-2xlarge
container:
image: diffusers/diffusers-pytorch-cuda
options: --shm-size "16gb" --ipc host --gpus all
defaults:
run:
shell: bash
strategy:
fail-fast: false
max-parallel: 2
matrix:
module: [models, schedulers, lora, others, single_file]
steps:
- name: Checkout diffusers
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: Install dependencies
run: |
uv pip install -e ".[quality]"
uv pip install peft@git+https://github.com/huggingface/peft.git
uv pip uninstall accelerate && uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git
uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
- name: Environment
run: |
python utils/print_env.py
- name: Run PyTorch CUDA tests
env:
HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }}
# https://pytorch.org/docs/stable/notes/randomness.html#avoiding-nondeterministic-algorithms
CUBLAS_WORKSPACE_CONFIG: :16:8
run: |
pytest -n 1 --max-worker-restart=0 --dist=loadfile \
-k "not Flax and not Onnx" \
--make-reports=tests_torch_cuda_${{ matrix.module }} \
tests/${{ matrix.module }}
- name: Failure short reports
if: ${{ failure() }}
run: |
cat reports/tests_torch_cuda_${{ matrix.module }}_stats.txt
cat reports/tests_torch_cuda_${{ matrix.module }}_failures_short.txt
- name: Test suite reports artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v6
with:
name: torch_cuda_test_reports_${{ matrix.module }}
path: reports
run_torch_compile_tests:
name: PyTorch Compile CUDA tests
runs-on:
group: aws-g4dn-2xlarge
container:
image: diffusers/diffusers-pytorch-cuda
options: --gpus all --shm-size "16gb" --ipc host
steps:
- name: Checkout diffusers
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: NVIDIA-SMI
run: |
nvidia-smi
- name: Install dependencies
run: |
uv pip install -e ".[quality,training]"
uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
- name: Environment
run: |
python utils/print_env.py
- name: Run example tests on GPU
env:
HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }}
RUN_COMPILE: yes
run: |
pytest -n 1 --max-worker-restart=0 --dist=loadfile -k "compile" --make-reports=tests_torch_compile_cuda tests/
- name: Failure short reports
if: ${{ failure() }}
run: cat reports/tests_torch_compile_cuda_failures_short.txt
- name: Test suite reports artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v6
with:
name: torch_compile_test_reports
path: reports
run_xformers_tests:
name: PyTorch xformers CUDA tests
runs-on:
group: aws-g4dn-2xlarge
container:
image: diffusers/diffusers-pytorch-xformers-cuda
options: --gpus all --shm-size "16gb" --ipc host
steps:
- name: Checkout diffusers
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: NVIDIA-SMI
run: |
nvidia-smi
- name: Install dependencies
run: |
uv pip install -e ".[quality,training]"
- name: Environment
run: |
python utils/print_env.py
- name: Run example tests on GPU
env:
HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }}
run: |
pytest -n 1 --max-worker-restart=0 --dist=loadfile -k "xformers" --make-reports=tests_torch_xformers_cuda tests/
- name: Failure short reports
if: ${{ failure() }}
run: cat reports/tests_torch_xformers_cuda_failures_short.txt
- name: Test suite reports artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v6
with:
name: torch_xformers_test_reports
path: reports
run_examples_tests:
name: Examples PyTorch CUDA tests on Ubuntu
runs-on:
group: aws-g4dn-2xlarge
container:
image: diffusers/diffusers-pytorch-cuda
options: --gpus all --shm-size "16gb" --ipc host
steps:
- name: Checkout diffusers
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: NVIDIA-SMI
run: |
nvidia-smi
- name: Install dependencies
run: |
uv pip install -e ".[quality,training]"
- name: Environment
run: |
python utils/print_env.py
- name: Run example tests on GPU
env:
HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }}
run: |
uv pip install ".[training]"
pytest -n 1 --max-worker-restart=0 --dist=loadfile --make-reports=examples_torch_cuda examples/
- name: Failure short reports
if: ${{ failure() }}
run: |
cat reports/examples_torch_cuda_stats.txt
cat reports/examples_torch_cuda_failures_short.txt
- name: Test suite reports artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v6
with:
name: examples_test_reports
path: reports
================================================
FILE: .github/workflows/push_tests_fast.yml
================================================
name: Fast tests on main
on:
push:
branches:
- main
paths:
- "src/diffusers/**.py"
- "examples/**.py"
- "tests/**.py"
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
DIFFUSERS_IS_CI: yes
HF_HOME: /mnt/cache
OMP_NUM_THREADS: 8
MKL_NUM_THREADS: 8
HF_XET_HIGH_PERFORMANCE: 1
PYTEST_TIMEOUT: 600
RUN_SLOW: no
jobs:
run_fast_tests:
strategy:
fail-fast: false
matrix:
config:
- name: Fast PyTorch CPU tests on Ubuntu
framework: pytorch
runner: aws-general-8-plus
image: diffusers/diffusers-pytorch-cpu
report: torch_cpu
- name: PyTorch Example CPU tests on Ubuntu
framework: pytorch_examples
runner: aws-general-8-plus
image: diffusers/diffusers-pytorch-cpu
report: torch_example_cpu
name: ${{ matrix.config.name }}
runs-on:
group: ${{ matrix.config.runner }}
container:
image: ${{ matrix.config.image }}
options: --shm-size "16gb" --ipc host -v /mnt/hf_cache:/mnt/cache/
defaults:
run:
shell: bash
steps:
- name: Checkout diffusers
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: Install dependencies
run: |
uv pip install -e ".[quality]"
- name: Environment
run: |
python utils/print_env.py
- name: Run fast PyTorch CPU tests
if: ${{ matrix.config.framework == 'pytorch' }}
run: |
pytest -n 4 --max-worker-restart=0 --dist=loadfile \
-k "not Flax and not Onnx" \
--make-reports=tests_${{ matrix.config.report }} \
tests/
- name: Run example PyTorch CPU tests
if: ${{ matrix.config.framework == 'pytorch_examples' }}
run: |
uv pip install ".[training]"
pytest -n 4 --max-worker-restart=0 --dist=loadfile \
--make-reports=tests_${{ matrix.config.report }} \
examples
- name: Failure short reports
if: ${{ failure() }}
run: cat reports/tests_${{ matrix.config.report }}_failures_short.txt
- name: Test suite reports artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v6
with:
name: pr_${{ matrix.config.report }}_test_reports
path: reports
================================================
FILE: .github/workflows/push_tests_mps.yml
================================================
name: Fast mps tests on main
on:
workflow_dispatch:
env:
DIFFUSERS_IS_CI: yes
HF_HOME: /mnt/cache
OMP_NUM_THREADS: 8
MKL_NUM_THREADS: 8
HF_XET_HIGH_PERFORMANCE: 1
PYTEST_TIMEOUT: 600
RUN_SLOW: no
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
run_fast_tests_apple_m1:
name: Fast PyTorch MPS tests on MacOS
runs-on: macos-13-xlarge
steps:
- name: Checkout diffusers
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: Clean checkout
shell: arch -arch arm64 bash {0}
run: |
git clean -fxd
- name: Setup miniconda
uses: ./.github/actions/setup-miniconda
with:
python-version: 3.9
- name: Install dependencies
shell: arch -arch arm64 bash {0}
run: |
${CONDA_RUN} python -m pip install --upgrade pip uv
${CONDA_RUN} python -m uv pip install -e ".[quality]"
${CONDA_RUN} python -m uv pip install torch torchvision torchaudio
${CONDA_RUN} python -m uv pip install accelerate@git+https://github.com/huggingface/accelerate.git
${CONDA_RUN} python -m uv pip install transformers --upgrade
- name: Environment
shell: arch -arch arm64 bash {0}
run: |
${CONDA_RUN} python utils/print_env.py
- name: Run fast PyTorch tests on M1 (MPS)
shell: arch -arch arm64 bash {0}
env:
HF_HOME: /System/Volumes/Data/mnt/cache
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
${CONDA_RUN} python -m pytest -n 0 --make-reports=tests_torch_mps tests/
- name: Failure short reports
if: ${{ failure() }}
run: cat reports/tests_torch_mps_failures_short.txt
- name: Test suite reports artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v6
with:
name: pr_torch_mps_test_reports
path: reports
================================================
FILE: .github/workflows/pypi_publish.yaml
================================================
# Adapted from https://blog.deepjyoti30.dev/pypi-release-github-action
name: PyPI release
on:
workflow_dispatch:
push:
tags:
- "*"
jobs:
find-and-checkout-latest-branch:
runs-on: ubuntu-22.04
outputs:
latest_branch: ${{ steps.set_latest_branch.outputs.latest_branch }}
steps:
- name: Checkout Repo
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.10'
- name: Fetch latest branch
id: fetch_latest_branch
run: |
pip install -U requests packaging
LATEST_BRANCH=$(python utils/fetch_latest_release_branch.py)
echo "Latest branch: $LATEST_BRANCH"
echo "latest_branch=$LATEST_BRANCH" >> $GITHUB_ENV
- name: Set latest branch output
id: set_latest_branch
run: echo "::set-output name=latest_branch::${{ env.latest_branch }}"
release:
needs: find-and-checkout-latest-branch
runs-on: ubuntu-22.04
steps:
- name: Checkout Repo
uses: actions/checkout@v6
with:
ref: ${{ needs.find-and-checkout-latest-branch.outputs.latest_branch }}
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -U setuptools wheel twine
pip install -U torch --index-url https://download.pytorch.org/whl/cpu
- name: Build the dist files
run: python setup.py bdist_wheel && python setup.py sdist
- name: Publish to the test PyPI
env:
TWINE_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }}
run: twine upload dist/* -r pypitest --repository-url=https://test.pypi.org/legacy/
- name: Test installing diffusers and importing
run: |
pip install diffusers && pip uninstall diffusers -y
pip install -i https://test.pypi.org/simple/ diffusers
pip install -U transformers
python utils/print_env.py
python -c "from diffusers import __version__; print(__version__)"
python -c "from diffusers import DiffusionPipeline; pipe = DiffusionPipeline.from_pretrained('fusing/unet-ldm-dummy-update'); pipe()"
python -c "from diffusers import DiffusionPipeline; pipe = DiffusionPipeline.from_pretrained('hf-internal-testing/tiny-stable-diffusion-pipe', safety_checker=None); pipe('ah suh du')"
python -c "from diffusers import *"
- name: Publish to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: twine upload dist/* -r pypi
================================================
FILE: .github/workflows/release_tests_fast.yml
================================================
# Duplicate workflow to push_tests.yml that is meant to run on release/patch branches as a final check
# Creating a duplicate workflow here is simpler than adding complex path/branch parsing logic to push_tests.yml
# Needs to be updated if push_tests.yml updated
name: (Release) Fast GPU Tests on main
on:
workflow_dispatch:
push:
branches:
- "v*.*.*-release"
- "v*.*.*-patch"
env:
DIFFUSERS_IS_CI: yes
OMP_NUM_THREADS: 8
MKL_NUM_THREADS: 8
PYTEST_TIMEOUT: 600
PIPELINE_USAGE_CUTOFF: 50000
jobs:
setup_torch_cuda_pipeline_matrix:
name: Setup Torch Pipelines CUDA Slow Tests Matrix
runs-on:
group: aws-general-8-plus
container:
image: diffusers/diffusers-pytorch-cpu
outputs:
pipeline_test_matrix: ${{ steps.fetch_pipeline_matrix.outputs.pipeline_test_matrix }}
steps:
- name: Checkout diffusers
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: Install dependencies
run: |
uv pip install -e ".[quality]"
uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
- name: Environment
run: |
python utils/print_env.py
- name: Fetch Pipeline Matrix
id: fetch_pipeline_matrix
run: |
matrix=$(python utils/fetch_torch_cuda_pipeline_test_matrix.py)
echo $matrix
echo "pipeline_test_matrix=$matrix" >> $GITHUB_OUTPUT
- name: Pipeline Tests Artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v6
with:
name: test-pipelines.json
path: reports
torch_pipelines_cuda_tests:
name: Torch Pipelines CUDA Tests
needs: setup_torch_cuda_pipeline_matrix
strategy:
fail-fast: false
max-parallel: 8
matrix:
module: ${{ fromJson(needs.setup_torch_cuda_pipeline_matrix.outputs.pipeline_test_matrix) }}
runs-on:
group: aws-g4dn-2xlarge
container:
image: diffusers/diffusers-pytorch-cuda
options: --shm-size "16gb" --ipc host --gpus all
steps:
- name: Checkout diffusers
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: NVIDIA-SMI
run: |
nvidia-smi
- name: Install dependencies
run: |
uv pip install -e ".[quality]"
uv pip uninstall accelerate && uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git
uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
- name: Environment
run: |
python utils/print_env.py
- name: Slow PyTorch CUDA checkpoint tests on Ubuntu
env:
HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }}
# https://pytorch.org/docs/stable/notes/randomness.html#avoiding-nondeterministic-algorithms
CUBLAS_WORKSPACE_CONFIG: :16:8
run: |
pytest -n 1 --max-worker-restart=0 --dist=loadfile \
-k "not Flax and not Onnx" \
--make-reports=tests_pipeline_${{ matrix.module }}_cuda \
tests/pipelines/${{ matrix.module }}
- name: Failure short reports
if: ${{ failure() }}
run: |
cat reports/tests_pipeline_${{ matrix.module }}_cuda_stats.txt
cat reports/tests_pipeline_${{ matrix.module }}_cuda_failures_short.txt
- name: Test suite reports artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v6
with:
name: pipeline_${{ matrix.module }}_test_reports
path: reports
torch_cuda_tests:
name: Torch CUDA Tests
runs-on:
group: aws-g4dn-2xlarge
container:
image: diffusers/diffusers-pytorch-cuda
options: --shm-size "16gb" --ipc host --gpus all
defaults:
run:
shell: bash
strategy:
fail-fast: false
max-parallel: 2
matrix:
module: [models, schedulers, lora, others, single_file]
steps:
- name: Checkout diffusers
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: Install dependencies
run: |
uv pip install -e ".[quality]"
uv pip install peft@git+https://github.com/huggingface/peft.git
uv pip uninstall accelerate && uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git
uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
- name: Environment
run: |
python utils/print_env.py
- name: Run PyTorch CUDA tests
env:
HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }}
# https://pytorch.org/docs/stable/notes/randomness.html#avoiding-nondeterministic-algorithms
CUBLAS_WORKSPACE_CONFIG: :16:8
run: |
pytest -n 1 --max-worker-restart=0 --dist=loadfile \
-k "not Flax and not Onnx" \
--make-reports=tests_torch_${{ matrix.module }}_cuda \
tests/${{ matrix.module }}
- name: Failure short reports
if: ${{ failure() }}
run: |
cat reports/tests_torch_${{ matrix.module }}_cuda_stats.txt
cat reports/tests_torch_${{ matrix.module }}_cuda_failures_short.txt
- name: Test suite reports artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v6
with:
name: torch_cuda_${{ matrix.module }}_test_reports
path: reports
torch_minimum_version_cuda_tests:
name: Torch Minimum Version CUDA Tests
runs-on:
group: aws-g4dn-2xlarge
container:
image: diffusers/diffusers-pytorch-minimum-cuda
options: --shm-size "16gb" --ipc host --gpus all
defaults:
run:
shell: bash
steps:
- name: Checkout diffusers
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: Install dependencies
run: |
uv pip install -e ".[quality]"
uv pip install peft@git+https://github.com/huggingface/peft.git
uv pip uninstall accelerate && uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git
uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
- name: Environment
run: |
python utils/print_env.py
- name: Run PyTorch CUDA tests
env:
HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }}
# https://pytorch.org/docs/stable/notes/randomness.html#avoiding-nondeterministic-algorithms
CUBLAS_WORKSPACE_CONFIG: :16:8
run: |
pytest -n 1 --max-worker-restart=0 --dist=loadfile \
-k "not Flax and not Onnx" \
--make-reports=tests_torch_minimum_cuda \
tests/models/test_modeling_common.py \
tests/pipelines/test_pipelines_common.py \
tests/pipelines/test_pipeline_utils.py \
tests/pipelines/test_pipelines.py \
tests/pipelines/test_pipelines_auto.py \
tests/schedulers/test_schedulers.py \
tests/others
- name: Failure short reports
if: ${{ failure() }}
run: |
cat reports/tests_torch_minimum_version_cuda_stats.txt
cat reports/tests_torch_minimum_version_cuda_failures_short.txt
- name: Test suite reports artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v6
with:
name: torch_minimum_version_cuda_test_reports
path: reports
run_torch_compile_tests:
name: PyTorch Compile CUDA tests
runs-on:
group: aws-g4dn-2xlarge
container:
image: diffusers/diffusers-pytorch-cuda
options: --gpus all --shm-size "16gb" --ipc host
steps:
- name: Checkout diffusers
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: NVIDIA-SMI
run: |
nvidia-smi
- name: Install dependencies
run: |
uv pip install -e ".[quality,training]"
uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
- name: Environment
run: |
python utils/print_env.py
- name: Run torch compile tests on GPU
env:
HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }}
RUN_COMPILE: yes
run: |
pytest -n 1 --max-worker-restart=0 --dist=loadfile -k "compile" --make-reports=tests_torch_compile_cuda tests/
- name: Failure short reports
if: ${{ failure() }}
run: cat reports/tests_torch_compile_cuda_failures_short.txt
- name: Test suite reports artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v6
with:
name: torch_compile_test_reports
path: reports
run_xformers_tests:
name: PyTorch xformers CUDA tests
runs-on:
group: aws-g4dn-2xlarge
container:
image: diffusers/diffusers-pytorch-xformers-cuda
options: --gpus all --shm-size "16gb" --ipc host
steps:
- name: Checkout diffusers
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: NVIDIA-SMI
run: |
nvidia-smi
- name: Install dependencies
run: |
uv pip install -e ".[quality,training]"
uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
- name: Environment
run: |
python utils/print_env.py
- name: Run example tests on GPU
env:
HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }}
run: |
pytest -n 1 --max-worker-restart=0 --dist=loadfile -k "xformers" --make-reports=tests_torch_xformers_cuda tests/
- name: Failure short reports
if: ${{ failure() }}
run: cat reports/tests_torch_xformers_cuda_failures_short.txt
- name: Test suite reports artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v6
with:
name: torch_xformers_test_reports
path: reports
run_examples_tests:
name: Examples PyTorch CUDA tests on Ubuntu
runs-on:
group: aws-g4dn-2xlarge
container:
image: diffusers/diffusers-pytorch-cuda
options: --gpus all --shm-size "16gb" --ipc host
steps:
- name: Checkout diffusers
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: NVIDIA-SMI
run: |
nvidia-smi
- name: Install dependencies
run: |
uv pip install -e ".[quality,training]"
uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
- name: Environment
run: |
python utils/print_env.py
- name: Run example tests on GPU
env:
HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }}
run: |
uv pip install ".[training]"
pytest -n 1 --max-worker-restart=0 --dist=loadfile --make-reports=examples_torch_cuda examples/
- name: Failure short reports
if: ${{ failure() }}
run: |
cat reports/examples_torch_cuda_stats.txt
cat reports/examples_torch_cuda_failures_short.txt
- name: Test suite reports artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v6
with:
name: examples_test_reports
path: reports
================================================
FILE: .github/workflows/run_tests_from_a_pr.yml
================================================
name: Check running SLOW tests from a PR (only GPU)
on:
workflow_dispatch:
inputs:
docker_image:
default: 'diffusers/diffusers-pytorch-cuda'
description: 'Name of the Docker image'
required: true
pr_number:
description: 'PR number to test on'
required: true
test:
description: 'Tests to run (e.g.: `tests/models`).'
required: true
env:
DIFFUSERS_IS_CI: yes
IS_GITHUB_CI: "1"
HF_HOME: /mnt/cache
OMP_NUM_THREADS: 8
MKL_NUM_THREADS: 8
PYTEST_TIMEOUT: 600
RUN_SLOW: yes
jobs:
run_tests:
name: "Run a test on our runner from a PR"
runs-on:
group: aws-g4dn-2xlarge
container:
image: ${{ github.event.inputs.docker_image }}
options: --gpus all --privileged --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
steps:
- name: Validate test files input
id: validate_test_files
env:
PY_TEST: ${{ github.event.inputs.test }}
run: |
if [[ ! "$PY_TEST" =~ ^tests/ ]]; then
echo "Error: The input string must start with 'tests/'."
exit 1
fi
if [[ ! "$PY_TEST" =~ ^tests/(models|pipelines|lora) ]]; then
echo "Error: The input string must contain either 'models', 'pipelines', or 'lora' after 'tests/'."
exit 1
fi
if [[ "$PY_TEST" == *";"* ]]; then
echo "Error: The input string must not contain ';'."
exit 1
fi
echo "$PY_TEST"
shell: bash -e {0}
- name: Checkout PR branch
uses: actions/checkout@v6
with:
ref: refs/pull/${{ inputs.pr_number }}/head
- name: Install pytest
run: |
uv pip install -e ".[quality]"
uv pip install peft
- name: Run tests
env:
PY_TEST: ${{ github.event.inputs.test }}
run: |
pytest "$PY_TEST"
================================================
FILE: .github/workflows/ssh-pr-runner.yml
================================================
name: SSH into PR runners
on:
workflow_dispatch:
inputs:
docker_image:
description: 'Name of the Docker image'
required: true
env:
IS_GITHUB_CI: "1"
HF_HUB_READ_TOKEN: ${{ secrets.HF_HUB_READ_TOKEN }}
HF_HOME: /mnt/cache
DIFFUSERS_IS_CI: yes
OMP_NUM_THREADS: 8
MKL_NUM_THREADS: 8
RUN_SLOW: yes
jobs:
ssh_runner:
name: "SSH"
runs-on:
group: aws-highmemory-32-plus
container:
image: ${{ github.event.inputs.docker_image }}
options: --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface/diffusers:/mnt/cache/ --privileged
steps:
- name: Checkout diffusers
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: Tailscale # In order to be able to SSH when a test fails
uses: huggingface/tailscale-action@main
with:
authkey: ${{ secrets.TAILSCALE_SSH_AUTHKEY }}
slackChannel: ${{ secrets.SLACK_CIFEEDBACK_CHANNEL }}
slackToken: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
waitForSSH: true
================================================
FILE: .github/workflows/ssh-runner.yml
================================================
name: SSH into GPU runners
on:
workflow_dispatch:
inputs:
runner_type:
description: 'Type of runner to test (aws-g6-4xlarge-plus: a10, aws-g4dn-2xlarge: t4, aws-g6e-xlarge-plus: L40)'
type: choice
required: true
options:
- aws-g6-4xlarge-plus
- aws-g4dn-2xlarge
- aws-g6e-xlarge-plus
docker_image:
description: 'Name of the Docker image'
required: true
env:
IS_GITHUB_CI: "1"
HF_HUB_READ_TOKEN: ${{ secrets.HF_HUB_READ_TOKEN }}
HF_HOME: /mnt/cache
DIFFUSERS_IS_CI: yes
OMP_NUM_THREADS: 8
MKL_NUM_THREADS: 8
RUN_SLOW: yes
jobs:
ssh_runner:
name: "SSH"
runs-on:
group: "${{ github.event.inputs.runner_type }}"
container:
image: ${{ github.event.inputs.docker_image }}
options: --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface/diffusers:/mnt/cache/ --gpus all --privileged
steps:
- name: Checkout diffusers
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: NVIDIA-SMI
run: |
nvidia-smi
- name: Tailscale # In order to be able to SSH when a test fails
uses: huggingface/tailscale-action@main
with:
authkey: ${{ secrets.TAILSCALE_SSH_AUTHKEY }}
slackChannel: ${{ secrets.SLACK_CIFEEDBACK_CHANNEL }}
slackToken: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
waitForSSH: true
================================================
FILE: .github/workflows/stale.yml
================================================
name: Stale Bot
on:
schedule:
- cron: "0 15 * * *"
jobs:
close_stale_issues:
name: Close Stale Issues
if: github.repository == 'huggingface/diffusers'
runs-on: ubuntu-22.04
permissions:
issues: write
pull-requests: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v6
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: 3.10
- name: Install requirements
run: |
pip install PyGithub
- name: Close stale issues
run: |
python utils/stale.py
================================================
FILE: .github/workflows/trufflehog.yml
================================================
on:
push:
name: Secret Leaks
jobs:
trufflehog:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Secret Scanning
uses: trufflesecurity/trufflehog@main
with:
extra_args: --results=verified,unknown
================================================
FILE: .github/workflows/typos.yml
================================================
name: Check typos
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
- name: typos-action
uses: crate-ci/typos@v1.42.1
================================================
FILE: .github/workflows/update_metadata.yml
================================================
name: Update Diffusers metadata
on:
workflow_dispatch:
push:
branches:
- main
- update_diffusers_metadata*
jobs:
update_metadata:
runs-on: ubuntu-22.04
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v6
- name: Setup environment
run: |
pip install --upgrade pip
pip install datasets pandas
pip install .[torch]
- name: Update metadata
env:
HF_TOKEN: ${{ secrets.SAYAK_HF_TOKEN }}
run: |
python utils/update_metadata.py --commit_sha ${{ github.sha }}
================================================
FILE: .github/workflows/upload_pr_documentation.yml
================================================
name: Upload PR Documentation
on:
workflow_run:
workflows: ["Build PR Documentation"]
types:
- completed
jobs:
build:
uses: huggingface/doc-builder/.github/workflows/upload_pr_documentation.yml@main
with:
package_name: diffusers
secrets:
hf_token: ${{ secrets.HF_DOC_BUILD_PUSH }}
comment_bot_token: ${{ secrets.COMMENT_BOT_TOKEN }}
================================================
FILE: .gitignore
================================================
# Initially taken from GitHub's Python gitignore file
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# tests and logs
tests/fixtures/cached_*_text.txt
logs/
lightning_logs/
lang_code_data/
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a Python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# vscode
.vs
.vscode
# Cursor
.cursor
# Pycharm
.idea
# TF code
tensorflow_code
# Models
proc_data
# examples
runs
/runs_old
/wandb
/examples/runs
/examples/**/*.args
/examples/rag/sweep
# data
/data
serialization_dir
# emacs
*.*~
debug.env
# vim
.*.swp
# ctags
tags
# pre-commit
.pre-commit*
# .lock
*.lock
# DS_Store (MacOS)
.DS_Store
# RL pipelines may produce mp4 outputs
*.mp4
# dependencies
/transformers
# ruff
.ruff_cache
# wandb
wandb
# AI agent generated symlinks
/AGENTS.md
/CLAUDE.md
/.agents/skills
/.claude/skills
================================================
FILE: CITATION.cff
================================================
cff-version: 1.2.0
title: 'Diffusers: State-of-the-art diffusion models'
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- given-names: Patrick
family-names: von Platen
- given-names: Suraj
family-names: Patil
- given-names: Anton
family-names: Lozhkov
- given-names: Pedro
family-names: Cuenca
- given-names: Nathan
family-names: Lambert
- given-names: Kashif
family-names: Rasul
- given-names: Mishig
family-names: Davaadorj
- given-names: Dhruv
family-names: Nair
- given-names: Sayak
family-names: Paul
- given-names: Steven
family-names: Liu
- given-names: William
family-names: Berman
- given-names: Yiyi
family-names: Xu
- given-names: Thomas
family-names: Wolf
repository-code: 'https://github.com/huggingface/diffusers'
abstract: >-
Diffusers provides pretrained diffusion models across
multiple modalities, such as vision and audio, and serves
as a modular toolbox for inference and training of
diffusion models.
keywords:
- deep-learning
- pytorch
- image-generation
- hacktoberfest
- diffusion
- text2image
- image2image
- score-based-generative-modeling
- stable-diffusion
- stable-diffusion-diffusers
license: Apache-2.0
version: 0.12.1
================================================
FILE: CODE_OF_CONDUCT.md
================================================
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, caste, color, religion, or sexual identity
and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall Diffusers community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Spamming issues or PRs with links to projects unrelated to this library
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
feedback@huggingface.co.
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series
of actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within
the community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.1, available at
https://www.contributor-covenant.org/version/2/1/code_of_conduct.html.
Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
================================================
FILE: LICENSE
================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, Any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
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.
================================================
FILE: MANIFEST.in
================================================
include LICENSE
include src/diffusers/utils/model_card_template.md
================================================
FILE: Makefile
================================================
.PHONY: deps_table_update modified_only_fixup extra_style_checks quality style fixup fix-copies test test-examples codex claude clean-ai
# make sure to test the local checkout in scripts and not the pre-installed one (don't use quotes!)
export PYTHONPATH = src
check_dirs := examples scripts src tests utils benchmarks
modified_only_fixup:
$(eval modified_py_files := $(shell python utils/get_modified_files.py $(check_dirs)))
@if test -n "$(modified_py_files)"; then \
echo "Checking/fixing $(modified_py_files)"; \
ruff check $(modified_py_files) --fix; \
ruff format $(modified_py_files);\
else \
echo "No library .py files were modified"; \
fi
# Update src/diffusers/dependency_versions_table.py
deps_table_update:
@python setup.py deps_table_update
deps_table_check_updated:
@md5sum src/diffusers/dependency_versions_table.py > md5sum.saved
@python setup.py deps_table_update
@md5sum -c --quiet md5sum.saved || (printf "\nError: the version dependency table is outdated.\nPlease run 'make fixup' or 'make style' and commit the changes.\n\n" && exit 1)
@rm md5sum.saved
# autogenerating code
autogenerate_code: deps_table_update
# Check that the repo is in a good state
repo-consistency:
python utils/check_dummies.py
python utils/check_repo.py
python utils/check_inits.py
# this target runs checks on all files
quality:
ruff check $(check_dirs) setup.py
ruff format --check $(check_dirs) setup.py
doc-builder style src/diffusers docs/source --max_len 119 --check_only
python utils/check_doc_toc.py
# Format source code automatically and check is there are any problems left that need manual fixing
extra_style_checks:
python utils/custom_init_isort.py
python utils/check_doc_toc.py --fix_and_overwrite
# this target runs checks on all files and potentially modifies some of them
style:
ruff check $(check_dirs) setup.py --fix
ruff format $(check_dirs) setup.py
doc-builder style src/diffusers docs/source --max_len 119
${MAKE} autogenerate_code
${MAKE} extra_style_checks
# Super fast fix and check target that only works on relevant modified files since the branch was made
fixup: modified_only_fixup extra_style_checks autogenerate_code repo-consistency
# Make marked copies of snippets of codes conform to the original
fix-copies:
python utils/check_copies.py --fix_and_overwrite
python utils/check_dummies.py --fix_and_overwrite
# Auto docstrings in modular blocks
modular-autodoctrings:
python utils/modular_auto_docstring.py
# Run tests for the library
test:
python -m pytest -n auto --dist=loadfile -s -v ./tests/
# Run tests for examples
test-examples:
python -m pytest -n auto --dist=loadfile -s -v ./examples/
# Release stuff
pre-release:
python utils/release.py
pre-patch:
python utils/release.py --patch
post-release:
python utils/release.py --post_release
post-patch:
python utils/release.py --post_release --patch
# AI agent symlinks
codex:
ln -snf .ai/AGENTS.md AGENTS.md
mkdir -p .agents
rm -rf .agents/skills
ln -snf ../.ai/skills .agents/skills
claude:
ln -snf .ai/AGENTS.md CLAUDE.md
mkdir -p .claude
rm -rf .claude/skills
ln -snf ../.ai/skills .claude/skills
clean-ai:
rm -f AGENTS.md CLAUDE.md
rm -rf .agents/skills .claude/skills
================================================
FILE: PHILOSOPHY.md
================================================
<!--Copyright 2025 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.
-->
# Philosophy
🧨 Diffusers provides **state-of-the-art** pretrained diffusion models across multiple modalities.
Its purpose is to serve as a **modular toolbox** for both inference and training.
We aim to build a library that stands the test of time and therefore take API design very seriously.
In a nutshell, Diffusers is built to be a natural extension of PyTorch. Therefore, most of our design choices are based on [PyTorch's Design Principles](https://pytorch.org/docs/stable/community/design.html#pytorch-design-philosophy). Let's go over the most important ones:
## Usability over Performance
- While Diffusers has many built-in performance-enhancing features (see [Memory and Speed](https://huggingface.co/docs/diffusers/optimization/fp16)), models are always loaded with the highest precision and lowest optimization. Therefore, by default diffusion pipelines are always instantiated on CPU with float32 precision if not otherwise defined by the user. This ensures usability across different platforms and accelerators and means that no complex installations are required to run the library.
- Diffusers aims to be a **light-weight** package and therefore has very few required dependencies, but many soft dependencies that can improve performance (such as `accelerate`, `safetensors`, `onnx`, etc...). We strive to keep the library as lightweight as possible so that it can be added without much concern as a dependency on other packages.
- Diffusers prefers simple, self-explainable code over condensed, magic code. This means that short-hand code syntaxes such as lambda functions, and advanced PyTorch operators are often not desired.
## Simple over easy
As PyTorch states, **explicit is better than implicit** and **simple is better than complex**. This design philosophy is reflected in multiple parts of the library:
- We follow PyTorch's API with methods like [`DiffusionPipeline.to`](https://huggingface.co/docs/diffusers/main/en/api/diffusion_pipeline#diffusers.DiffusionPipeline.to) to let the user handle device management.
- Raising concise error messages is preferred to silently correct erroneous input. Diffusers aims at teaching the user, rather than making the library as easy to use as possible.
- Complex model vs. scheduler logic is exposed instead of magically handled inside. Schedulers/Samplers are separated from diffusion models with minimal dependencies on each other. This forces the user to write the unrolled denoising loop. However, the separation allows for easier debugging and gives the user more control over adapting the denoising process or switching out diffusion models or schedulers.
- Separately trained components of the diffusion pipeline, *e.g.* the text encoder, the UNet, and the variational autoencoder, each has their own model class. This forces the user to handle the interaction between the different model components, and the serialization format separates the model components into different files. However, this allows for easier debugging and customization. DreamBooth or Textual Inversion training
is very simple thanks to Diffusers' ability to separate single components of the diffusion pipeline.
## Tweakable, contributor-friendly over abstraction
For large parts of the library, Diffusers adopts an important design principle of the [Transformers library](https://github.com/huggingface/transformers), which is to prefer copy-pasted code over hasty abstractions. This design principle is very opinionated and stands in stark contrast to popular design principles such as [Don't repeat yourself (DRY)](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself).
In short, just like Transformers does for modeling files, Diffusers prefers to keep an extremely low level of abstraction and very self-contained code for pipelines and schedulers.
Functions, long code blocks, and even classes can be copied across multiple files which at first can look like a bad, sloppy design choice that makes the library unmaintainable.
**However**, this design has proven to be extremely successful for Transformers and makes a lot of sense for community-driven, open-source machine learning libraries because:
- Machine Learning is an extremely fast-moving field in which paradigms, model architectures, and algorithms are changing rapidly, which therefore makes it very difficult to define long-lasting code abstractions.
- Machine Learning practitioners like to be able to quickly tweak existing code for ideation and research and therefore prefer self-contained code over one that contains many abstractions.
- Open-source libraries rely on community contributions and therefore must build a library that is easy to contribute to. The more abstract the code, the more dependencies, the harder to read, and the harder to contribute to. Contributors simply stop contributing to very abstract libraries out of fear of breaking vital functionality. If contributing to a library cannot break other fundamental code, not only is it more inviting for potential new contributors, but it is also easier to review and contribute to multiple parts in parallel.
At Hugging Face, we call this design the **single-file policy** which means that almost all of the code of a certain class should be written in a single, self-contained file. To read more about the philosophy, you can have a look
at [this blog post](https://huggingface.co/blog/transformers-design-philosophy).
In Diffusers, we follow this philosophy for both pipelines and schedulers, but only partly for diffusion models. The reason we don't follow this design fully for diffusion models is because almost all diffusion pipelines, such
as [DDPM](https://huggingface.co/docs/diffusers/api/pipelines/ddpm), [Stable Diffusion](https://huggingface.co/docs/diffusers/api/pipelines/stable_diffusion/overview#stable-diffusion-pipelines), [unCLIP (DALL·E 2)](https://huggingface.co/docs/diffusers/api/pipelines/unclip) and [Imagen](https://imagen.research.google/) all rely on the same diffusion model, the [UNet](https://huggingface.co/docs/diffusers/api/models/unet2d-cond).
Great, now you should have generally understood why 🧨 Diffusers is designed the way it is 🤗.
We try to apply these design principles consistently across the library. Nevertheless, there are some minor exceptions to the philosophy or some unlucky design choices. If you have feedback regarding the design, we would ❤️ to hear it [directly on GitHub](https://github.com/huggingface/diffusers/issues/new?assignees=&labels=&template=feedback.md&title=).
## Design Philosophy in Details
Now, let's look a bit into the nitty-gritty details of the design philosophy. Diffusers essentially consists of three major classes: [pipelines](https://github.com/huggingface/diffusers/tree/main/src/diffusers/pipelines), [models](https://github.com/huggingface/diffusers/tree/main/src/diffusers/models), and [schedulers](https://github.com/huggingface/diffusers/tree/main/src/diffusers/schedulers).
Let's walk through more detailed design decisions for each class.
### Pipelines
Pipelines are designed to be easy to use (therefore do not follow [*Simple over easy*](#simple-over-easy) 100%), are not feature complete, and should loosely be seen as examples of how to use [models](#models) and [schedulers](#schedulers) for inference.
The following design principles are followed:
- Pipelines follow the single-file policy. All pipelines can be found in individual directories under src/diffusers/pipelines. One pipeline folder corresponds to one diffusion paper/project/release. Multiple pipeline files can be gathered in one pipeline folder, as it’s done for [`src/diffusers/pipelines/stable-diffusion`](https://github.com/huggingface/diffusers/tree/main/src/diffusers/pipelines/stable_diffusion). If pipelines share similar functionality, one can make use of the [# Copied from mechanism](https://github.com/huggingface/diffusers/blob/125d783076e5bd9785beb05367a2d2566843a271/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py#L251).
- Pipelines all inherit from [`DiffusionPipeline`].
- Every pipeline consists of different model and scheduler components, that are documented in the [`model_index.json` file](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5/blob/main/model_index.json), are accessible under the same name as attributes of the pipeline and can be shared between pipelines with [`DiffusionPipeline.components`](https://huggingface.co/docs/diffusers/main/en/api/diffusion_pipeline#diffusers.DiffusionPipeline.components) function.
- Every pipeline should be loadable via the [`DiffusionPipeline.from_pretrained`](https://huggingface.co/docs/diffusers/main/en/api/diffusion_pipeline#diffusers.DiffusionPipeline.from_pretrained) function.
- Pipelines should be used **only** for inference.
- Pipelines should be very readable, self-explanatory, and easy to tweak.
- Pipelines should be designed to build on top of each other and be easy to integrate into higher-level APIs.
- Pipelines are **not** intended to be feature-complete user interfaces. For feature-complete user interfaces one should rather have a look at [InvokeAI](https://github.com/invoke-ai/InvokeAI), [Diffuzers](https://github.com/abhishekkrthakur/diffuzers), and [lama-cleaner](https://github.com/Sanster/lama-cleaner).
- Every pipeline should have one and only one way to run it via a `__call__` method. The naming of the `__call__` arguments should be shared across all pipelines.
- Pipelines should be name
gitextract_5vldy3zt/
├── .ai/
│ ├── AGENTS.md
│ └── skills/
│ ├── model-integration/
│ │ ├── SKILL.md
│ │ └── modular-conversion.md
│ └── parity-testing/
│ ├── SKILL.md
│ ├── checkpoint-mechanism.md
│ └── pitfalls.md
├── .github/
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug-report.yml
│ │ ├── config.yml
│ │ ├── feature_request.md
│ │ ├── feedback.md
│ │ ├── new-model-addition.yml
│ │ ├── remote-vae-pilot-feedback.yml
│ │ └── translate.md
│ ├── PULL_REQUEST_TEMPLATE.md
│ ├── actions/
│ │ └── setup-miniconda/
│ │ └── action.yml
│ └── workflows/
│ ├── benchmark.yml
│ ├── build_docker_images.yml
│ ├── build_documentation.yml
│ ├── build_pr_documentation.yml
│ ├── codeql.yml
│ ├── mirror_community_pipeline.yml
│ ├── nightly_tests.yml
│ ├── notify_slack_about_release.yml
│ ├── pr_dependency_test.yml
│ ├── pr_modular_tests.yml
│ ├── pr_style_bot.yml
│ ├── pr_test_fetcher.yml
│ ├── pr_tests.yml
│ ├── pr_tests_gpu.yml
│ ├── pr_torch_dependency_test.yml
│ ├── push_tests.yml
│ ├── push_tests_fast.yml
│ ├── push_tests_mps.yml
│ ├── pypi_publish.yaml
│ ├── release_tests_fast.yml
│ ├── run_tests_from_a_pr.yml
│ ├── ssh-pr-runner.yml
│ ├── ssh-runner.yml
│ ├── stale.yml
│ ├── trufflehog.yml
│ ├── typos.yml
│ ├── update_metadata.yml
│ └── upload_pr_documentation.yml
├── .gitignore
├── CITATION.cff
├── CODE_OF_CONDUCT.md
├── LICENSE
├── MANIFEST.in
├── Makefile
├── PHILOSOPHY.md
├── README.md
├── _typos.toml
├── benchmarks/
│ ├── README.md
│ ├── __init__.py
│ ├── benchmarking_flux.py
│ ├── benchmarking_ltx.py
│ ├── benchmarking_sdxl.py
│ ├── benchmarking_utils.py
│ ├── benchmarking_wan.py
│ ├── push_results.py
│ ├── requirements.txt
│ └── run_all.py
├── docker/
│ ├── diffusers-doc-builder/
│ │ └── Dockerfile
│ ├── diffusers-onnxruntime-cpu/
│ │ └── Dockerfile
│ ├── diffusers-onnxruntime-cuda/
│ │ └── Dockerfile
│ ├── diffusers-pytorch-cpu/
│ │ └── Dockerfile
│ ├── diffusers-pytorch-cuda/
│ │ └── Dockerfile
│ ├── diffusers-pytorch-minimum-cuda/
│ │ └── Dockerfile
│ └── diffusers-pytorch-xformers-cuda/
│ └── Dockerfile
├── docs/
│ ├── README.md
│ ├── TRANSLATING.md
│ └── source/
│ ├── _config.py
│ ├── en/
│ │ ├── _toctree.yml
│ │ ├── advanced_inference/
│ │ │ └── outpaint.md
│ │ ├── api/
│ │ │ ├── activations.md
│ │ │ ├── attnprocessor.md
│ │ │ ├── cache.md
│ │ │ ├── configuration.md
│ │ │ ├── image_processor.md
│ │ │ ├── internal_classes_overview.md
│ │ │ ├── loaders/
│ │ │ │ ├── ip_adapter.md
│ │ │ │ ├── lora.md
│ │ │ │ ├── peft.md
│ │ │ │ ├── single_file.md
│ │ │ │ ├── textual_inversion.md
│ │ │ │ ├── transformer_sd3.md
│ │ │ │ └── unet.md
│ │ │ ├── logging.md
│ │ │ ├── models/
│ │ │ │ ├── allegro_transformer3d.md
│ │ │ │ ├── asymmetricautoencoderkl.md
│ │ │ │ ├── aura_flow_transformer2d.md
│ │ │ │ ├── auto_model.md
│ │ │ │ ├── autoencoder_dc.md
│ │ │ │ ├── autoencoder_kl_hunyuan_video.md
│ │ │ │ ├── autoencoder_kl_hunyuan_video15.md
│ │ │ │ ├── autoencoder_kl_hunyuanimage.md
│ │ │ │ ├── autoencoder_kl_hunyuanimage_refiner.md
│ │ │ │ ├── autoencoder_kl_wan.md
│ │ │ │ ├── autoencoder_oobleck.md
│ │ │ │ ├── autoencoder_rae.md
│ │ │ │ ├── autoencoder_tiny.md
│ │ │ │ ├── autoencoderkl.md
│ │ │ │ ├── autoencoderkl_allegro.md
│ │ │ │ ├── autoencoderkl_audio_ltx_2.md
│ │ │ │ ├── autoencoderkl_cogvideox.md
│ │ │ │ ├── autoencoderkl_cosmos.md
│ │ │ │ ├── autoencoderkl_ltx_2.md
│ │ │ │ ├── autoencoderkl_ltx_video.md
│ │ │ │ ├── autoencoderkl_magvit.md
│ │ │ │ ├── autoencoderkl_mochi.md
│ │ │ │ ├── autoencoderkl_qwenimage.md
│ │ │ │ ├── bria_transformer.md
│ │ │ │ ├── chroma_transformer.md
│ │ │ │ ├── chronoedit_transformer_3d.md
│ │ │ │ ├── cogvideox_transformer3d.md
│ │ │ │ ├── cogview3plus_transformer2d.md
│ │ │ │ ├── cogview4_transformer2d.md
│ │ │ │ ├── consisid_transformer3d.md
│ │ │ │ ├── consistency_decoder_vae.md
│ │ │ │ ├── controlnet.md
│ │ │ │ ├── controlnet_flux.md
│ │ │ │ ├── controlnet_hunyuandit.md
│ │ │ │ ├── controlnet_sana.md
│ │ │ │ ├── controlnet_sd3.md
│ │ │ │ ├── controlnet_sparsectrl.md
│ │ │ │ ├── controlnet_union.md
│ │ │ │ ├── cosmos_transformer3d.md
│ │ │ │ ├── dit_transformer2d.md
│ │ │ │ ├── easyanimate_transformer3d.md
│ │ │ │ ├── flux2_transformer.md
│ │ │ │ ├── flux_transformer.md
│ │ │ │ ├── glm_image_transformer2d.md
│ │ │ │ ├── helios_transformer3d.md
│ │ │ │ ├── hidream_image_transformer.md
│ │ │ │ ├── hunyuan_transformer2d.md
│ │ │ │ ├── hunyuan_video15_transformer_3d.md
│ │ │ │ ├── hunyuan_video_transformer_3d.md
│ │ │ │ ├── hunyuanimage_transformer_2d.md
│ │ │ │ ├── latte_transformer3d.md
│ │ │ │ ├── longcat_image_transformer2d.md
│ │ │ │ ├── ltx2_video_transformer3d.md
│ │ │ │ ├── ltx_video_transformer3d.md
│ │ │ │ ├── lumina2_transformer2d.md
│ │ │ │ ├── lumina_nextdit2d.md
│ │ │ │ ├── mochi_transformer3d.md
│ │ │ │ ├── omnigen_transformer.md
│ │ │ │ ├── overview.md
│ │ │ │ ├── ovisimage_transformer2d.md
│ │ │ │ ├── pixart_transformer2d.md
│ │ │ │ ├── prior_transformer.md
│ │ │ │ ├── qwenimage_transformer2d.md
│ │ │ │ ├── sana_transformer2d.md
│ │ │ │ ├── sana_video_transformer3d.md
│ │ │ │ ├── sd3_transformer2d.md
│ │ │ │ ├── skyreels_v2_transformer_3d.md
│ │ │ │ ├── stable_audio_transformer.md
│ │ │ │ ├── stable_cascade_unet.md
│ │ │ │ ├── transformer2d.md
│ │ │ │ ├── transformer_bria_fibo.md
│ │ │ │ ├── transformer_temporal.md
│ │ │ │ ├── unet-motion.md
│ │ │ │ ├── unet.md
│ │ │ │ ├── unet2d-cond.md
│ │ │ │ ├── unet2d.md
│ │ │ │ ├── unet3d-cond.md
│ │ │ │ ├── uvit2d.md
│ │ │ │ ├── vq.md
│ │ │ │ ├── wan_animate_transformer_3d.md
│ │ │ │ ├── wan_transformer_3d.md
│ │ │ │ └── z_image_transformer2d.md
│ │ │ ├── modular_diffusers/
│ │ │ │ ├── guiders.md
│ │ │ │ ├── pipeline.md
│ │ │ │ ├── pipeline_blocks.md
│ │ │ │ ├── pipeline_components.md
│ │ │ │ └── pipeline_states.md
│ │ │ ├── normalization.md
│ │ │ ├── outputs.md
│ │ │ ├── parallel.md
│ │ │ ├── pipelines/
│ │ │ │ ├── allegro.md
│ │ │ │ ├── amused.md
│ │ │ │ ├── animatediff.md
│ │ │ │ ├── attend_and_excite.md
│ │ │ │ ├── audioldm.md
│ │ │ │ ├── audioldm2.md
│ │ │ │ ├── aura_flow.md
│ │ │ │ ├── auto_pipeline.md
│ │ │ │ ├── blip_diffusion.md
│ │ │ │ ├── bria_3_2.md
│ │ │ │ ├── bria_fibo.md
│ │ │ │ ├── bria_fibo_edit.md
│ │ │ │ ├── chroma.md
│ │ │ │ ├── chronoedit.md
│ │ │ │ ├── cogvideox.md
│ │ │ │ ├── cogview3.md
│ │ │ │ ├── cogview4.md
│ │ │ │ ├── consisid.md
│ │ │ │ ├── consistency_models.md
│ │ │ │ ├── control_flux_inpaint.md
│ │ │ │ ├── controlnet.md
│ │ │ │ ├── controlnet_flux.md
│ │ │ │ ├── controlnet_hunyuandit.md
│ │ │ │ ├── controlnet_sana.md
│ │ │ │ ├── controlnet_sd3.md
│ │ │ │ ├── controlnet_sdxl.md
│ │ │ │ ├── controlnet_union.md
│ │ │ │ ├── controlnetxs.md
│ │ │ │ ├── controlnetxs_sdxl.md
│ │ │ │ ├── cosmos.md
│ │ │ │ ├── dance_diffusion.md
│ │ │ │ ├── ddim.md
│ │ │ │ ├── ddpm.md
│ │ │ │ ├── deepfloyd_if.md
│ │ │ │ ├── diffedit.md
│ │ │ │ ├── dit.md
│ │ │ │ ├── easyanimate.md
│ │ │ │ ├── flux.md
│ │ │ │ ├── flux2.md
│ │ │ │ ├── framepack.md
│ │ │ │ ├── glm_image.md
│ │ │ │ ├── helios.md
│ │ │ │ ├── hidream.md
│ │ │ │ ├── hunyuan_video.md
│ │ │ │ ├── hunyuan_video15.md
│ │ │ │ ├── hunyuandit.md
│ │ │ │ ├── hunyuanimage21.md
│ │ │ │ ├── i2vgenxl.md
│ │ │ │ ├── kandinsky.md
│ │ │ │ ├── kandinsky3.md
│ │ │ │ ├── kandinsky5_image.md
│ │ │ │ ├── kandinsky5_video.md
│ │ │ │ ├── kandinsky_v22.md
│ │ │ │ ├── kolors.md
│ │ │ │ ├── latent_consistency_models.md
│ │ │ │ ├── latent_diffusion.md
│ │ │ │ ├── latte.md
│ │ │ │ ├── ledits_pp.md
│ │ │ │ ├── longcat_image.md
│ │ │ │ ├── ltx2.md
│ │ │ │ ├── ltx_video.md
│ │ │ │ ├── lumina.md
│ │ │ │ ├── lumina2.md
│ │ │ │ ├── marigold.md
│ │ │ │ ├── mochi.md
│ │ │ │ ├── musicldm.md
│ │ │ │ ├── omnigen.md
│ │ │ │ ├── overview.md
│ │ │ │ ├── ovis_image.md
│ │ │ │ ├── pag.md
│ │ │ │ ├── paint_by_example.md
│ │ │ │ ├── panorama.md
│ │ │ │ ├── pia.md
│ │ │ │ ├── pix2pix.md
│ │ │ │ ├── pixart.md
│ │ │ │ ├── pixart_sigma.md
│ │ │ │ ├── prx.md
│ │ │ │ ├── qwenimage.md
│ │ │ │ ├── sana.md
│ │ │ │ ├── sana_sprint.md
│ │ │ │ ├── sana_video.md
│ │ │ │ ├── self_attention_guidance.md
│ │ │ │ ├── semantic_stable_diffusion.md
│ │ │ │ ├── shap_e.md
│ │ │ │ ├── skyreels_v2.md
│ │ │ │ ├── stable_audio.md
│ │ │ │ ├── stable_cascade.md
│ │ │ │ ├── stable_diffusion/
│ │ │ │ │ ├── adapter.md
│ │ │ │ │ ├── depth2img.md
│ │ │ │ │ ├── gligen.md
│ │ │ │ │ ├── image_variation.md
│ │ │ │ │ ├── img2img.md
│ │ │ │ │ ├── inpaint.md
│ │ │ │ │ ├── latent_upscale.md
│ │ │ │ │ ├── ldm3d_diffusion.md
│ │ │ │ │ ├── overview.md
│ │ │ │ │ ├── sdxl_turbo.md
│ │ │ │ │ ├── stable_diffusion_2.md
│ │ │ │ │ ├── stable_diffusion_3.md
│ │ │ │ │ ├── stable_diffusion_safe.md
│ │ │ │ │ ├── stable_diffusion_xl.md
│ │ │ │ │ ├── svd.md
│ │ │ │ │ ├── text2img.md
│ │ │ │ │ └── upscale.md
│ │ │ │ ├── stable_unclip.md
│ │ │ │ ├── text_to_video.md
│ │ │ │ ├── text_to_video_zero.md
│ │ │ │ ├── unclip.md
│ │ │ │ ├── unidiffuser.md
│ │ │ │ ├── value_guided_sampling.md
│ │ │ │ ├── visualcloze.md
│ │ │ │ ├── wan.md
│ │ │ │ ├── wuerstchen.md
│ │ │ │ └── z_image.md
│ │ │ ├── quantization.md
│ │ │ ├── schedulers/
│ │ │ │ ├── cm_stochastic_iterative.md
│ │ │ │ ├── consistency_decoder.md
│ │ │ │ ├── cosine_dpm.md
│ │ │ │ ├── ddim.md
│ │ │ │ ├── ddim_cogvideox.md
│ │ │ │ ├── ddim_inverse.md
│ │ │ │ ├── ddpm.md
│ │ │ │ ├── deis.md
│ │ │ │ ├── dpm_discrete.md
│ │ │ │ ├── dpm_discrete_ancestral.md
│ │ │ │ ├── dpm_sde.md
│ │ │ │ ├── edm_euler.md
│ │ │ │ ├── edm_multistep_dpm_solver.md
│ │ │ │ ├── euler.md
│ │ │ │ ├── euler_ancestral.md
│ │ │ │ ├── flow_match_euler_discrete.md
│ │ │ │ ├── flow_match_heun_discrete.md
│ │ │ │ ├── helios.md
│ │ │ │ ├── helios_dmd.md
│ │ │ │ ├── heun.md
│ │ │ │ ├── ipndm.md
│ │ │ │ ├── lcm.md
│ │ │ │ ├── lms_discrete.md
│ │ │ │ ├── multistep_dpm_solver.md
│ │ │ │ ├── multistep_dpm_solver_cogvideox.md
│ │ │ │ ├── multistep_dpm_solver_inverse.md
│ │ │ │ ├── overview.md
│ │ │ │ ├── pndm.md
│ │ │ │ ├── repaint.md
│ │ │ │ ├── score_sde_ve.md
│ │ │ │ ├── score_sde_vp.md
│ │ │ │ ├── singlestep_dpm_solver.md
│ │ │ │ ├── stochastic_karras_ve.md
│ │ │ │ ├── tcd.md
│ │ │ │ ├── unipc.md
│ │ │ │ └── vq_diffusion.md
│ │ │ ├── utilities.md
│ │ │ └── video_processor.md
│ │ ├── community_projects.md
│ │ ├── conceptual/
│ │ │ ├── contribution.md
│ │ │ ├── ethical_guidelines.md
│ │ │ ├── evaluation.md
│ │ │ └── philosophy.md
│ │ ├── hybrid_inference/
│ │ │ ├── api_reference.md
│ │ │ └── overview.md
│ │ ├── index.md
│ │ ├── installation.md
│ │ ├── modular_diffusers/
│ │ │ ├── auto_pipeline_blocks.md
│ │ │ ├── components_manager.md
│ │ │ ├── custom_blocks.md
│ │ │ ├── loop_sequential_pipeline_blocks.md
│ │ │ ├── mellon.md
│ │ │ ├── modular_diffusers_states.md
│ │ │ ├── modular_pipeline.md
│ │ │ ├── overview.md
│ │ │ ├── pipeline_block.md
│ │ │ ├── quickstart.md
│ │ │ └── sequential_pipeline_blocks.md
│ │ ├── optimization/
│ │ │ ├── attention_backends.md
│ │ │ ├── cache.md
│ │ │ ├── cache_dit.md
│ │ │ ├── coreml.md
│ │ │ ├── deepcache.md
│ │ │ ├── fp16.md
│ │ │ ├── habana.md
│ │ │ ├── memory.md
│ │ │ ├── mps.md
│ │ │ ├── neuron.md
│ │ │ ├── onnx.md
│ │ │ ├── open_vino.md
│ │ │ ├── para_attn.md
│ │ │ ├── pruna.md
│ │ │ ├── speed-memory-optims.md
│ │ │ ├── tgate.md
│ │ │ ├── tome.md
│ │ │ ├── xdit.md
│ │ │ └── xformers.md
│ │ ├── quantization/
│ │ │ ├── bitsandbytes.md
│ │ │ ├── gguf.md
│ │ │ ├── modelopt.md
│ │ │ ├── overview.md
│ │ │ ├── quanto.md
│ │ │ └── torchao.md
│ │ ├── quicktour.md
│ │ ├── stable_diffusion.md
│ │ ├── training/
│ │ │ ├── adapt_a_model.md
│ │ │ ├── cogvideox.md
│ │ │ ├── controlnet.md
│ │ │ ├── create_dataset.md
│ │ │ ├── custom_diffusion.md
│ │ │ ├── ddpo.md
│ │ │ ├── distributed_inference.md
│ │ │ ├── dreambooth.md
│ │ │ ├── instructpix2pix.md
│ │ │ ├── kandinsky.md
│ │ │ ├── lcm_distill.md
│ │ │ ├── lora.md
│ │ │ ├── overview.md
│ │ │ ├── sdxl.md
│ │ │ ├── t2i_adapters.md
│ │ │ ├── text2image.md
│ │ │ ├── text_inversion.md
│ │ │ ├── unconditional_training.md
│ │ │ └── wuerstchen.md
│ │ ├── tutorials/
│ │ │ ├── autopipeline.md
│ │ │ ├── basic_training.md
│ │ │ └── using_peft_for_inference.md
│ │ └── using-diffusers/
│ │ ├── automodel.md
│ │ ├── batched_inference.md
│ │ ├── callback.md
│ │ ├── conditional_image_generation.md
│ │ ├── consisid.md
│ │ ├── controlling_generation.md
│ │ ├── controlnet.md
│ │ ├── create_a_server.md
│ │ ├── custom_pipeline_overview.md
│ │ ├── depth2img.md
│ │ ├── diffedit.md
│ │ ├── dreambooth.md
│ │ ├── guiders.md
│ │ ├── helios.md
│ │ ├── image_quality.md
│ │ ├── img2img.md
│ │ ├── inference_with_lcm.md
│ │ ├── inference_with_tcd_lora.md
│ │ ├── inpaint.md
│ │ ├── ip_adapter.md
│ │ ├── kandinsky.md
│ │ ├── loading.md
│ │ ├── marigold_usage.md
│ │ ├── omnigen.md
│ │ ├── other-formats.md
│ │ ├── pag.md
│ │ ├── push_to_hub.md
│ │ ├── reusing_seeds.md
│ │ ├── schedulers.md
│ │ ├── sdxl.md
│ │ ├── sdxl_turbo.md
│ │ ├── shap-e.md
│ │ ├── svd.md
│ │ ├── t2i_adapter.md
│ │ ├── text-img2vid.md
│ │ ├── textual_inversion_inference.md
│ │ ├── unconditional_image_generation.md
│ │ ├── weighted_prompts.md
│ │ └── write_own_pipeline.md
│ ├── ja/
│ │ ├── _toctree.yml
│ │ ├── index.md
│ │ ├── installation.md
│ │ ├── quicktour.md
│ │ ├── stable_diffusion.md
│ │ └── tutorials/
│ │ ├── autopipeline.md
│ │ └── tutorial_overview.md
│ ├── ko/
│ │ ├── _toctree.yml
│ │ ├── api/
│ │ │ └── pipelines/
│ │ │ └── stable_diffusion/
│ │ │ └── stable_diffusion_xl.md
│ │ ├── conceptual/
│ │ │ ├── contribution.md
│ │ │ ├── ethical_guidelines.md
│ │ │ ├── evaluation.md
│ │ │ └── philosophy.md
│ │ ├── in_translation.md
│ │ ├── index.md
│ │ ├── installation.md
│ │ ├── optimization/
│ │ │ ├── coreml.md
│ │ │ ├── fp16.md
│ │ │ ├── habana.md
│ │ │ ├── mps.md
│ │ │ ├── onnx.md
│ │ │ ├── open_vino.md
│ │ │ ├── tome.md
│ │ │ ├── torch2.0.md
│ │ │ └── xformers.md
│ │ ├── quicktour.md
│ │ ├── stable_diffusion.md
│ │ ├── training/
│ │ │ ├── adapt_a_model.md
│ │ │ ├── controlnet.md
│ │ │ ├── create_dataset.md
│ │ │ ├── custom_diffusion.md
│ │ │ ├── distributed_inference.md
│ │ │ ├── dreambooth.md
│ │ │ ├── instructpix2pix.md
│ │ │ ├── lora.md
│ │ │ ├── overview.md
│ │ │ ├── text2image.md
│ │ │ ├── text_inversion.md
│ │ │ └── unconditional_training.md
│ │ ├── tutorials/
│ │ │ ├── basic_training.md
│ │ │ └── tutorial_overview.md
│ │ └── using-diffusers/
│ │ ├── conditional_image_generation.md
│ │ ├── controlling_generation.md
│ │ ├── custom_pipeline_overview.md
│ │ ├── depth2img.md
│ │ ├── diffedit.md
│ │ ├── img2img.md
│ │ ├── inpaint.md
│ │ ├── kandinsky.md
│ │ ├── loading.md
│ │ ├── loading_adapters.md
│ │ ├── other-formats.md
│ │ ├── push_to_hub.md
│ │ ├── schedulers.md
│ │ ├── sdxl_turbo.md
│ │ ├── shap-e.md
│ │ ├── stable_diffusion_jax_how_to.md
│ │ ├── svd.md
│ │ ├── textual_inversion_inference.md
│ │ ├── unconditional_image_generation.md
│ │ ├── weighted_prompts.md
│ │ └── write_own_pipeline.md
│ ├── pt/
│ │ ├── _toctree.yml
│ │ ├── index.md
│ │ ├── installation.md
│ │ ├── quicktour.md
│ │ └── stable_diffusion.md
│ └── zh/
│ ├── _toctree.yml
│ ├── community_projects.md
│ ├── conceptual/
│ │ ├── contribution.md
│ │ ├── ethical_guidelines.md
│ │ ├── evaluation.md
│ │ └── philosophy.md
│ ├── hybrid_inference/
│ │ ├── api_reference.md
│ │ ├── overview.md
│ │ └── vae_encode.md
│ ├── index.md
│ ├── installation.md
│ ├── modular_diffusers/
│ │ ├── auto_pipeline_blocks.md
│ │ ├── components_manager.md
│ │ ├── loop_sequential_pipeline_blocks.md
│ │ ├── modular_diffusers_states.md
│ │ ├── modular_pipeline.md
│ │ ├── overview.md
│ │ ├── pipeline_block.md
│ │ ├── quickstart.md
│ │ └── sequential_pipeline_blocks.md
│ ├── optimization/
│ │ ├── cache.md
│ │ ├── coreml.md
│ │ ├── deepcache.md
│ │ ├── fp16.md
│ │ ├── habana.md
│ │ ├── memory.md
│ │ ├── mps.md
│ │ ├── neuron.md
│ │ ├── onnx.md
│ │ ├── open_vino.md
│ │ ├── para_attn.md
│ │ ├── pruna.md
│ │ ├── speed-memory-optims.md
│ │ ├── tgate.md
│ │ ├── tome.md
│ │ ├── xdit.md
│ │ └── xformers.md
│ ├── quicktour.md
│ ├── stable_diffusion.md
│ ├── training/
│ │ ├── adapt_a_model.md
│ │ ├── controlnet.md
│ │ ├── distributed_inference.md
│ │ ├── dreambooth.md
│ │ ├── instructpix2pix.md
│ │ ├── kandinsky.md
│ │ ├── lora.md
│ │ ├── overview.md
│ │ ├── text2image.md
│ │ ├── text_inversion.md
│ │ └── wuerstchen.md
│ └── using-diffusers/
│ ├── consisid.md
│ ├── guiders.md
│ ├── helios.md
│ └── schedulers.md
├── examples/
│ ├── README.md
│ ├── advanced_diffusion_training/
│ │ ├── README.md
│ │ ├── README_flux.md
│ │ ├── requirements.txt
│ │ ├── requirements_flux.txt
│ │ ├── test_dreambooth_lora_flux_advanced.py
│ │ ├── train_dreambooth_lora_flux_advanced.py
│ │ ├── train_dreambooth_lora_sd15_advanced.py
│ │ └── train_dreambooth_lora_sdxl_advanced.py
│ ├── amused/
│ │ ├── README.md
│ │ └── train_amused.py
│ ├── cogvideo/
│ │ ├── README.md
│ │ ├── requirements.txt
│ │ ├── train_cogvideox_image_to_video_lora.py
│ │ └── train_cogvideox_lora.py
│ ├── cogview4-control/
│ │ ├── README.md
│ │ ├── requirements.txt
│ │ └── train_control_cogview4.py
│ ├── community/
│ │ ├── README.md
│ │ ├── README_community_scripts.md
│ │ ├── adaptive_mask_inpainting.py
│ │ ├── bit_diffusion.py
│ │ ├── checkpoint_merger.py
│ │ ├── clip_guided_images_mixing_stable_diffusion.py
│ │ ├── clip_guided_stable_diffusion.py
│ │ ├── clip_guided_stable_diffusion_img2img.py
│ │ ├── cogvideox_ddim_inversion.py
│ │ ├── composable_stable_diffusion.py
│ │ ├── ddim_noise_comparative_analysis.py
│ │ ├── dps_pipeline.py
│ │ ├── edict_pipeline.py
│ │ ├── fresco_v2v.py
│ │ ├── gluegen.py
│ │ ├── hd_painter.py
│ │ ├── iadb.py
│ │ ├── imagic_stable_diffusion.py
│ │ ├── img2img_inpainting.py
│ │ ├── instaflow_one_step.py
│ │ ├── interpolate_stable_diffusion.py
│ │ ├── ip_adapter_face_id.py
│ │ ├── kohya_hires_fix.py
│ │ ├── latent_consistency_img2img.py
│ │ ├── latent_consistency_interpolate.py
│ │ ├── latent_consistency_txt2img.py
│ │ ├── llm_grounded_diffusion.py
│ │ ├── lpw_stable_diffusion.py
│ │ ├── lpw_stable_diffusion_onnx.py
│ │ ├── lpw_stable_diffusion_xl.py
│ │ ├── magic_mix.py
│ │ ├── marigold_depth_estimation.py
│ │ ├── masked_stable_diffusion_img2img.py
│ │ ├── masked_stable_diffusion_xl_img2img.py
│ │ ├── matryoshka.py
│ │ ├── mixture_canvas.py
│ │ ├── mixture_tiling.py
│ │ ├── mixture_tiling_sdxl.py
│ │ ├── mod_controlnet_tile_sr_sdxl.py
│ │ ├── multilingual_stable_diffusion.py
│ │ ├── one_step_unet.py
│ │ ├── pipeline_animatediff_controlnet.py
│ │ ├── pipeline_animatediff_img2video.py
│ │ ├── pipeline_animatediff_ipex.py
│ │ ├── pipeline_controlnet_xl_kolors.py
│ │ ├── pipeline_controlnet_xl_kolors_img2img.py
│ │ ├── pipeline_controlnet_xl_kolors_inpaint.py
│ │ ├── pipeline_demofusion_sdxl.py
│ │ ├── pipeline_fabric.py
│ │ ├── pipeline_faithdiff_stable_diffusion_xl.py
│ │ ├── pipeline_flux_differential_img2img.py
│ │ ├── pipeline_flux_kontext_multiple_images.py
│ │ ├── pipeline_flux_rf_inversion.py
│ │ ├── pipeline_flux_semantic_guidance.py
│ │ ├── pipeline_flux_with_cfg.py
│ │ ├── pipeline_hunyuandit_differential_img2img.py
│ │ ├── pipeline_kolors_differential_img2img.py
│ │ ├── pipeline_kolors_inpainting.py
│ │ ├── pipeline_null_text_inversion.py
│ │ ├── pipeline_prompt2prompt.py
│ │ ├── pipeline_sdxl_style_aligned.py
│ │ ├── pipeline_stable_diffusion_3_differential_img2img.py
│ │ ├── pipeline_stable_diffusion_3_instruct_pix2pix.py
│ │ ├── pipeline_stable_diffusion_boxdiff.py
│ │ ├── pipeline_stable_diffusion_pag.py
│ │ ├── pipeline_stable_diffusion_upscale_ldm3d.py
│ │ ├── pipeline_stable_diffusion_xl_attentive_eraser.py
│ │ ├── pipeline_stable_diffusion_xl_controlnet_adapter.py
│ │ ├── pipeline_stable_diffusion_xl_controlnet_adapter_inpaint.py
│ │ ├── pipeline_stable_diffusion_xl_differential_img2img.py
│ │ ├── pipeline_stable_diffusion_xl_instandid_img2img.py
│ │ ├── pipeline_stable_diffusion_xl_instantid.py
│ │ ├── pipeline_stable_diffusion_xl_ipex.py
│ │ ├── pipeline_stable_diffusion_xl_t5.py
│ │ ├── pipeline_stg_cogvideox.py
│ │ ├── pipeline_stg_hunyuan_video.py
│ │ ├── pipeline_stg_ltx.py
│ │ ├── pipeline_stg_ltx_image2video.py
│ │ ├── pipeline_stg_mochi.py
│ │ ├── pipeline_stg_wan.py
│ │ ├── pipeline_z_image_differential_img2img.py
│ │ ├── pipeline_zero1to3.py
│ │ ├── pipline_flux_fill_controlnet_Inpaint.py
│ │ ├── regional_prompting_stable_diffusion.py
│ │ ├── rerender_a_video.py
│ │ ├── run_onnx_controlnet.py
│ │ ├── run_tensorrt_controlnet.py
│ │ ├── scheduling_ufogen.py
│ │ ├── sd_text2img_k_diffusion.py
│ │ ├── sde_drag.py
│ │ ├── seed_resize_stable_diffusion.py
│ │ ├── speech_to_image_diffusion.py
│ │ ├── stable_diffusion_comparison.py
│ │ ├── stable_diffusion_controlnet_img2img.py
│ │ ├── stable_diffusion_controlnet_inpaint.py
│ │ ├── stable_diffusion_controlnet_inpaint_img2img.py
│ │ ├── stable_diffusion_controlnet_reference.py
│ │ ├── stable_diffusion_ipex.py
│ │ ├── stable_diffusion_mega.py
│ │ ├── stable_diffusion_reference.py
│ │ ├── stable_diffusion_repaint.py
│ │ ├── stable_diffusion_tensorrt_img2img.py
│ │ ├── stable_diffusion_tensorrt_inpaint.py
│ │ ├── stable_diffusion_tensorrt_txt2img.py
│ │ ├── stable_diffusion_xl_controlnet_reference.py
│ │ ├── stable_diffusion_xl_reference.py
│ │ ├── stable_unclip.py
│ │ ├── text_inpainting.py
│ │ ├── tiled_upscaling.py
│ │ ├── unclip_image_interpolation.py
│ │ ├── unclip_text_interpolation.py
│ │ └── wildcard_stable_diffusion.py
│ ├── conftest.py
│ ├── consistency_distillation/
│ │ ├── README.md
│ │ ├── README_sdxl.md
│ │ ├── requirements.txt
│ │ ├── test_lcm_lora.py
│ │ ├── train_lcm_distill_lora_sd_wds.py
│ │ ├── train_lcm_distill_lora_sdxl.py
│ │ ├── train_lcm_distill_lora_sdxl_wds.py
│ │ ├── train_lcm_distill_sd_wds.py
│ │ └── train_lcm_distill_sdxl_wds.py
│ ├── controlnet/
│ │ ├── README.md
│ │ ├── README_flux.md
│ │ ├── README_sd3.md
│ │ ├── README_sdxl.md
│ │ ├── requirements.txt
│ │ ├── requirements_flax.txt
│ │ ├── requirements_flux.txt
│ │ ├── requirements_sd3.txt
│ │ ├── requirements_sdxl.txt
│ │ ├── test_controlnet.py
│ │ ├── train_controlnet.py
│ │ ├── train_controlnet_flax.py
│ │ ├── train_controlnet_flux.py
│ │ ├── train_controlnet_sd3.py
│ │ └── train_controlnet_sdxl.py
│ ├── custom_diffusion/
│ │ ├── README.md
│ │ ├── requirements.txt
│ │ ├── retrieve.py
│ │ ├── test_custom_diffusion.py
│ │ └── train_custom_diffusion.py
│ ├── dreambooth/
│ │ ├── README.md
│ │ ├── README_flux.md
│ │ ├── README_flux2.md
│ │ ├── README_hidream.md
│ │ ├── README_lumina2.md
│ │ ├── README_qwen.md
│ │ ├── README_sana.md
│ │ ├── README_sd3.md
│ │ ├── README_sdxl.md
│ │ ├── README_z_image.md
│ │ ├── convert_to_imagefolder.py
│ │ ├── requirements.txt
│ │ ├── requirements_flax.txt
│ │ ├── requirements_flux.txt
│ │ ├── requirements_hidream.txt
│ │ ├── requirements_sana.txt
│ │ ├── requirements_sd3.txt
│ │ ├── requirements_sdxl.txt
│ │ ├── test_dreambooth.py
│ │ ├── test_dreambooth_flux.py
│ │ ├── test_dreambooth_lora.py
│ │ ├── test_dreambooth_lora_edm.py
│ │ ├── test_dreambooth_lora_flux.py
│ │ ├── test_dreambooth_lora_flux2.py
│ │ ├── test_dreambooth_lora_flux2_klein.py
│ │ ├── test_dreambooth_lora_flux_kontext.py
│ │ ├── test_dreambooth_lora_hidream.py
│ │ ├── test_dreambooth_lora_lumina2.py
│ │ ├── test_dreambooth_lora_qwenimage.py
│ │ ├── test_dreambooth_lora_sana.py
│ │ ├── test_dreambooth_lora_sd3.py
│ │ ├── test_dreambooth_sd3.py
│ │ ├── train_dreambooth.py
│ │ ├── train_dreambooth_flax.py
│ │ ├── train_dreambooth_flux.py
│ │ ├── train_dreambooth_lora.py
│ │ ├── train_dreambooth_lora_flux.py
│ │ ├── train_dreambooth_lora_flux2.py
│ │ ├── train_dreambooth_lora_flux2_img2img.py
│ │ ├── train_dreambooth_lora_flux2_klein.py
│ │ ├── train_dreambooth_lora_flux2_klein_img2img.py
│ │ ├── train_dreambooth_lora_flux_kontext.py
│ │ ├── train_dreambooth_lora_hidream.py
│ │ ├── train_dreambooth_lora_lumina2.py
│ │ ├── train_dreambooth_lora_qwen_image.py
│ │ ├── train_dreambooth_lora_sana.py
│ │ ├── train_dreambooth_lora_sd3.py
│ │ ├── train_dreambooth_lora_sdxl.py
│ │ ├── train_dreambooth_lora_z_image.py
│ │ └── train_dreambooth_sd3.py
│ ├── flux-control/
│ │ ├── README.md
│ │ ├── requirements.txt
│ │ ├── train_control_flux.py
│ │ └── train_control_lora_flux.py
│ ├── inference/
│ │ ├── README.md
│ │ ├── image_to_image.py
│ │ └── inpainting.py
│ ├── instruct_pix2pix/
│ │ ├── README.md
│ │ ├── README_sdxl.md
│ │ ├── requirements.txt
│ │ ├── test_instruct_pix2pix.py
│ │ ├── train_instruct_pix2pix.py
│ │ └── train_instruct_pix2pix_sdxl.py
│ ├── kandinsky2_2/
│ │ └── text_to_image/
│ │ ├── README.md
│ │ ├── requirements.txt
│ │ ├── train_text_to_image_decoder.py
│ │ ├── train_text_to_image_lora_decoder.py
│ │ ├── train_text_to_image_lora_prior.py
│ │ └── train_text_to_image_prior.py
│ ├── model_search/
│ │ ├── README.md
│ │ ├── pipeline_easy.py
│ │ └── requirements.txt
│ ├── reinforcement_learning/
│ │ ├── README.md
│ │ ├── diffusion_policy.py
│ │ └── run_diffuser_locomotion.py
│ ├── research_projects/
│ │ ├── README.md
│ │ ├── anytext/
│ │ │ ├── README.md
│ │ │ ├── anytext.py
│ │ │ ├── anytext_controlnet.py
│ │ │ └── ocr_recog/
│ │ │ ├── RNN.py
│ │ │ ├── RecCTCHead.py
│ │ │ ├── RecModel.py
│ │ │ ├── RecMv1_enhance.py
│ │ │ ├── RecSVTR.py
│ │ │ ├── common.py
│ │ │ └── en_dict.txt
│ │ ├── autoencoder_rae/
│ │ │ ├── README.md
│ │ │ └── train_autoencoder_rae.py
│ │ ├── autoencoderkl/
│ │ │ ├── README.md
│ │ │ ├── requirements.txt
│ │ │ └── train_autoencoderkl.py
│ │ ├── colossalai/
│ │ │ ├── README.md
│ │ │ ├── inference.py
│ │ │ ├── requirement.txt
│ │ │ └── train_dreambooth_colossalai.py
│ │ ├── consistency_training/
│ │ │ ├── README.md
│ │ │ ├── requirements.txt
│ │ │ └── train_cm_ct_unconditional.py
│ │ ├── control_lora/
│ │ │ ├── README.md
│ │ │ └── control_lora.py
│ │ ├── controlnet/
│ │ │ └── train_controlnet_webdataset.py
│ │ ├── diffusion_dpo/
│ │ │ ├── README.md
│ │ │ ├── requirements.txt
│ │ │ ├── train_diffusion_dpo.py
│ │ │ └── train_diffusion_dpo_sdxl.py
│ │ ├── diffusion_orpo/
│ │ │ ├── README.md
│ │ │ ├── requirements.txt
│ │ │ ├── train_diffusion_orpo_sdxl_lora.py
│ │ │ └── train_diffusion_orpo_sdxl_lora_wds.py
│ │ ├── dreambooth_inpaint/
│ │ │ ├── README.md
│ │ │ ├── requirements.txt
│ │ │ ├── train_dreambooth_inpaint.py
│ │ │ └── train_dreambooth_inpaint_lora.py
│ │ ├── flux_lora_quantization/
│ │ │ ├── README.md
│ │ │ ├── accelerate.yaml
│ │ │ ├── compute_embeddings.py
│ │ │ ├── ds2.yaml
│ │ │ └── train_dreambooth_lora_flux_miniature.py
│ │ ├── geodiff/
│ │ │ ├── README.md
│ │ │ └── geodiff_molecule_conformation.ipynb
│ │ ├── gligen/
│ │ │ ├── README.md
│ │ │ ├── dataset.py
│ │ │ ├── demo.ipynb
│ │ │ ├── make_datasets.py
│ │ │ ├── requirements.txt
│ │ │ └── train_gligen_text.py
│ │ ├── instructpix2pix_lora/
│ │ │ ├── README.md
│ │ │ └── train_instruct_pix2pix_lora.py
│ │ ├── intel_opts/
│ │ │ ├── README.md
│ │ │ ├── inference_bf16.py
│ │ │ ├── textual_inversion/
│ │ │ │ ├── README.md
│ │ │ │ ├── requirements.txt
│ │ │ │ └── textual_inversion_bf16.py
│ │ │ └── textual_inversion_dfq/
│ │ │ ├── README.md
│ │ │ ├── requirements.txt
│ │ │ ├── text2images.py
│ │ │ └── textual_inversion.py
│ │ ├── ip_adapter/
│ │ │ ├── README.md
│ │ │ ├── requirements.txt
│ │ │ ├── tutorial_train_faceid.py
│ │ │ ├── tutorial_train_ip-adapter.py
│ │ │ ├── tutorial_train_plus.py
│ │ │ └── tutorial_train_sdxl.py
│ │ ├── lora/
│ │ │ ├── README.md
│ │ │ ├── requirements.txt
│ │ │ └── train_text_to_image_lora.py
│ │ ├── lpl/
│ │ │ ├── README.md
│ │ │ ├── lpl_loss.py
│ │ │ └── train_sdxl_lpl.py
│ │ ├── multi_subject_dreambooth/
│ │ │ ├── README.md
│ │ │ ├── requirements.txt
│ │ │ └── train_multi_subject_dreambooth.py
│ │ ├── multi_subject_dreambooth_inpainting/
│ │ │ ├── README.md
│ │ │ ├── requirements.txt
│ │ │ └── train_multi_subject_dreambooth_inpainting.py
│ │ ├── multi_token_textual_inversion/
│ │ │ ├── README.md
│ │ │ ├── multi_token_clip.py
│ │ │ ├── requirements.txt
│ │ │ ├── requirements_flax.txt
│ │ │ ├── textual_inversion.py
│ │ │ └── textual_inversion_flax.py
│ │ ├── onnxruntime/
│ │ │ ├── README.md
│ │ │ ├── text_to_image/
│ │ │ │ ├── README.md
│ │ │ │ ├── requirements.txt
│ │ │ │ └── train_text_to_image.py
│ │ │ ├── textual_inversion/
│ │ │ │ ├── README.md
│ │ │ │ ├── requirements.txt
│ │ │ │ └── textual_inversion.py
│ │ │ └── unconditional_image_generation/
│ │ │ ├── README.md
│ │ │ ├── requirements.txt
│ │ │ └── train_unconditional.py
│ │ ├── pixart/
│ │ │ ├── .gitignore
│ │ │ ├── controlnet_pixart_alpha.py
│ │ │ ├── pipeline_pixart_alpha_controlnet.py
│ │ │ ├── requirements.txt
│ │ │ ├── run_pixart_alpha_controlnet_pipeline.py
│ │ │ ├── train_controlnet_hf_diffusers.sh
│ │ │ └── train_pixart_controlnet_hf.py
│ │ ├── promptdiffusion/
│ │ │ ├── README.md
│ │ │ ├── convert_original_promptdiffusion_to_diffusers.py
│ │ │ ├── pipeline_prompt_diffusion.py
│ │ │ └── promptdiffusioncontrolnet.py
│ │ ├── pytorch_xla/
│ │ │ ├── inference/
│ │ │ │ └── flux/
│ │ │ │ ├── README.md
│ │ │ │ └── flux_inference.py
│ │ │ └── training/
│ │ │ └── text_to_image/
│ │ │ ├── README.md
│ │ │ ├── requirements.txt
│ │ │ └── train_text_to_image_xla.py
│ │ ├── rdm/
│ │ │ ├── README.md
│ │ │ ├── pipeline_rdm.py
│ │ │ └── retriever.py
│ │ ├── realfill/
│ │ │ ├── README.md
│ │ │ ├── infer.py
│ │ │ ├── requirements.txt
│ │ │ └── train_realfill.py
│ │ ├── sana/
│ │ │ ├── README.md
│ │ │ ├── train_sana_sprint_diffusers.py
│ │ │ └── train_sana_sprint_diffusers.sh
│ │ ├── scheduled_huber_loss_training/
│ │ │ ├── README.md
│ │ │ ├── dreambooth/
│ │ │ │ ├── train_dreambooth.py
│ │ │ │ ├── train_dreambooth_lora.py
│ │ │ │ └── train_dreambooth_lora_sdxl.py
│ │ │ └── text_to_image/
│ │ │ ├── train_text_to_image.py
│ │ │ ├── train_text_to_image_lora.py
│ │ │ ├── train_text_to_image_lora_sdxl.py
│ │ │ └── train_text_to_image_sdxl.py
│ │ ├── sd3_lora_colab/
│ │ │ ├── README.md
│ │ │ ├── compute_embeddings.py
│ │ │ ├── sd3_dreambooth_lora_16gb.ipynb
│ │ │ └── train_dreambooth_lora_sd3_miniature.py
│ │ ├── sdxl_flax/
│ │ │ ├── README.md
│ │ │ ├── sdxl_single.py
│ │ │ └── sdxl_single_aot.py
│ │ ├── vae/
│ │ │ ├── README.md
│ │ │ └── vae_roundtrip.py
│ │ └── wuerstchen/
│ │ └── text_to_image/
│ │ ├── README.md
│ │ ├── __init__.py
│ │ ├── modeling_efficient_net_encoder.py
│ │ ├── requirements.txt
│ │ ├── train_text_to_image_lora_prior.py
│ │ └── train_text_to_image_prior.py
│ ├── server/
│ │ ├── README.md
│ │ ├── requirements.in
│ │ ├── requirements.txt
│ │ └── server.py
│ ├── server-async/
│ │ ├── Pipelines.py
│ │ ├── README.md
│ │ ├── requirements.txt
│ │ ├── serverasync.py
│ │ ├── test.py
│ │ └── utils/
│ │ ├── __init__.py
│ │ ├── requestscopedpipeline.py
│ │ ├── scheduler.py
│ │ ├── utils.py
│ │ └── wrappers.py
│ ├── t2i_adapter/
│ │ ├── README.md
│ │ ├── README_sdxl.md
│ │ ├── requirements.txt
│ │ ├── test_t2i_adapter.py
│ │ └── train_t2i_adapter_sdxl.py
│ ├── test_examples_utils.py
│ ├── text_to_image/
│ │ ├── README.md
│ │ ├── README_sdxl.md
│ │ ├── requirements.txt
│ │ ├── requirements_flax.txt
│ │ ├── requirements_sdxl.txt
│ │ ├── test_text_to_image.py
│ │ ├── test_text_to_image_lora.py
│ │ ├── train_text_to_image.py
│ │ ├── train_text_to_image_flax.py
│ │ ├── train_text_to_image_lora.py
│ │ ├── train_text_to_image_lora_sdxl.py
│ │ └── train_text_to_image_sdxl.py
│ ├── textual_inversion/
│ │ ├── README.md
│ │ ├── README_sdxl.md
│ │ ├── requirements.txt
│ │ ├── requirements_flax.txt
│ │ ├── test_textual_inversion.py
│ │ ├── test_textual_inversion_sdxl.py
│ │ ├── textual_inversion.py
│ │ ├── textual_inversion_flax.py
│ │ └── textual_inversion_sdxl.py
│ ├── unconditional_image_generation/
│ │ ├── README.md
│ │ ├── requirements.txt
│ │ ├── test_unconditional.py
│ │ └── train_unconditional.py
│ └── vqgan/
│ ├── README.md
│ ├── discriminator.py
│ ├── requirements.txt
│ ├── test_vqgan.py
│ └── train_vqgan.py
├── pyproject.toml
├── scripts/
│ ├── __init__.py
│ ├── change_naming_configs_and_checkpoints.py
│ ├── conversion_ldm_uncond.py
│ ├── convert_amused.py
│ ├── convert_animatediff_motion_lora_to_diffusers.py
│ ├── convert_animatediff_motion_module_to_diffusers.py
│ ├── convert_animatediff_sparsectrl_to_diffusers.py
│ ├── convert_asymmetric_vqgan_to_diffusers.py
│ ├── convert_aura_flow_to_diffusers.py
│ ├── convert_blipdiffusion_to_diffusers.py
│ ├── convert_cogvideox_to_diffusers.py
│ ├── convert_cogview3_to_diffusers.py
│ ├── convert_cogview4_to_diffusers.py
│ ├── convert_cogview4_to_diffusers_megatron.py
│ ├── convert_consistency_decoder.py
│ ├── convert_consistency_to_diffusers.py
│ ├── convert_cosmos_to_diffusers.py
│ ├── convert_dance_diffusion_to_diffusers.py
│ ├── convert_dcae_to_diffusers.py
│ ├── convert_ddpm_original_checkpoint_to_diffusers.py
│ ├── convert_diffusers_sdxl_lora_to_webui.py
│ ├── convert_diffusers_to_original_sdxl.py
│ ├── convert_diffusers_to_original_stable_diffusion.py
│ ├── convert_dit_to_diffusers.py
│ ├── convert_flux2_to_diffusers.py
│ ├── convert_flux_to_diffusers.py
│ ├── convert_flux_xlabs_ipadapter_to_diffusers.py
│ ├── convert_gligen_to_diffusers.py
│ ├── convert_hunyuan_image_to_diffusers.py
│ ├── convert_hunyuan_video1_5_to_diffusers.py
│ ├── convert_hunyuan_video_to_diffusers.py
│ ├── convert_hunyuandit_controlnet_to_diffusers.py
│ ├── convert_hunyuandit_to_diffusers.py
│ ├── convert_i2vgen_to_diffusers.py
│ ├── convert_if.py
│ ├── convert_k_upscaler_to_diffusers.py
│ ├── convert_kakao_brain_unclip_to_diffusers.py
│ ├── convert_kandinsky3_unet.py
│ ├── convert_kandinsky_to_diffusers.py
│ ├── convert_ldm_original_checkpoint_to_diffusers.py
│ ├── convert_lora_safetensor_to_diffusers.py
│ ├── convert_ltx2_to_diffusers.py
│ ├── convert_ltx_to_diffusers.py
│ ├── convert_lumina_to_diffusers.py
│ ├── convert_mochi_to_diffusers.py
│ ├── convert_models_diffuser_to_diffusers.py
│ ├── convert_ms_text_to_video_to_diffusers.py
│ ├── convert_music_spectrogram_to_diffusers.py
│ ├── convert_ncsnpp_original_checkpoint_to_diffusers.py
│ ├── convert_omnigen_to_diffusers.py
│ ├── convert_original_audioldm2_to_diffusers.py
│ ├── convert_original_audioldm_to_diffusers.py
│ ├── convert_original_controlnet_to_diffusers.py
│ ├── convert_original_musicldm_to_diffusers.py
│ ├── convert_original_stable_diffusion_to_diffusers.py
│ ├── convert_original_t2i_adapter.py
│ ├── convert_ovis_image_to_diffusers.py
│ ├── convert_pixart_alpha_to_diffusers.py
│ ├── convert_pixart_sigma_to_diffusers.py
│ ├── convert_prx_to_diffusers.py
│ ├── convert_rae_to_diffusers.py
│ ├── convert_sana_controlnet_to_diffusers.py
│ ├── convert_sana_to_diffusers.py
│ ├── convert_sana_video_to_diffusers.py
│ ├── convert_sd3_controlnet_to_diffusers.py
│ ├── convert_sd3_to_diffusers.py
│ ├── convert_shap_e_to_diffusers.py
│ ├── convert_skyreelsv2_to_diffusers.py
│ ├── convert_stable_audio.py
│ ├── convert_stable_cascade.py
│ ├── convert_stable_cascade_lite.py
│ ├── convert_stable_diffusion_checkpoint_to_onnx.py
│ ├── convert_stable_diffusion_controlnet_to_onnx.py
│ ├── convert_stable_diffusion_controlnet_to_tensorrt.py
│ ├── convert_svd_to_diffusers.py
│ ├── convert_tiny_autoencoder_to_diffusers.py
│ ├── convert_unclip_txt2img_to_image_variation.py
│ ├── convert_unidiffuser_to_diffusers.py
│ ├── convert_vae_diff_to_onnx.py
│ ├── convert_vae_pt_to_diffusers.py
│ ├── convert_versatile_diffusion_to_diffusers.py
│ ├── convert_vq_diffusion_to_diffusers.py
│ ├── convert_wan_to_diffusers.py
│ ├── convert_wuerstchen.py
│ ├── convert_zero123_to_diffusers.py
│ ├── extract_lora_from_model.py
│ └── generate_logits.py
├── setup.py
├── src/
│ └── diffusers/
│ ├── __init__.py
│ ├── callbacks.py
│ ├── commands/
│ │ ├── __init__.py
│ │ ├── custom_blocks.py
│ │ ├── diffusers_cli.py
│ │ ├── env.py
│ │ └── fp16_safetensors.py
│ ├── configuration_utils.py
│ ├── dependency_versions_check.py
│ ├── dependency_versions_table.py
│ ├── experimental/
│ │ ├── README.md
│ │ ├── __init__.py
│ │ └── rl/
│ │ ├── __init__.py
│ │ └── value_guided_sampling.py
│ ├── guiders/
│ │ ├── __init__.py
│ │ ├── adaptive_projected_guidance.py
│ │ ├── adaptive_projected_guidance_mix.py
│ │ ├── auto_guidance.py
│ │ ├── classifier_free_guidance.py
│ │ ├── classifier_free_zero_star_guidance.py
│ │ ├── frequency_decoupled_guidance.py
│ │ ├── guider_utils.py
│ │ ├── magnitude_aware_guidance.py
│ │ ├── perturbed_attention_guidance.py
│ │ ├── skip_layer_guidance.py
│ │ ├── smoothed_energy_guidance.py
│ │ └── tangential_classifier_free_guidance.py
│ ├── hooks/
│ │ ├── __init__.py
│ │ ├── _common.py
│ │ ├── _helpers.py
│ │ ├── context_parallel.py
│ │ ├── faster_cache.py
│ │ ├── first_block_cache.py
│ │ ├── group_offloading.py
│ │ ├── hooks.py
│ │ ├── layer_skip.py
│ │ ├── layerwise_casting.py
│ │ ├── mag_cache.py
│ │ ├── pyramid_attention_broadcast.py
│ │ ├── smoothed_energy_guidance_utils.py
│ │ ├── taylorseer_cache.py
│ │ └── utils.py
│ ├── image_processor.py
│ ├── loaders/
│ │ ├── __init__.py
│ │ ├── ip_adapter.py
│ │ ├── lora_base.py
│ │ ├── lora_conversion_utils.py
│ │ ├── lora_pipeline.py
│ │ ├── peft.py
│ │ ├── single_file.py
│ │ ├── single_file_model.py
│ │ ├── single_file_utils.py
│ │ ├── textual_inversion.py
│ │ ├── transformer_flux.py
│ │ ├── transformer_sd3.py
│ │ ├── unet.py
│ │ ├── unet_loader_utils.py
│ │ └── utils.py
│ ├── models/
│ │ ├── README.md
│ │ ├── __init__.py
│ │ ├── _modeling_parallel.py
│ │ ├── activations.py
│ │ ├── adapter.py
│ │ ├── attention.py
│ │ ├── attention_dispatch.py
│ │ ├── attention_flax.py
│ │ ├── attention_processor.py
│ │ ├── auto_model.py
│ │ ├── autoencoders/
│ │ │ ├── __init__.py
│ │ │ ├── autoencoder_asym_kl.py
│ │ │ ├── autoencoder_dc.py
│ │ │ ├── autoencoder_kl.py
│ │ │ ├── autoencoder_kl_allegro.py
│ │ │ ├── autoencoder_kl_cogvideox.py
│ │ │ ├── autoencoder_kl_cosmos.py
│ │ │ ├── autoencoder_kl_flux2.py
│ │ │ ├── autoencoder_kl_hunyuan_video.py
│ │ │ ├── autoencoder_kl_hunyuanimage.py
│ │ │ ├── autoencoder_kl_hunyuanimage_refiner.py
│ │ │ ├── autoencoder_kl_hunyuanvideo15.py
│ │ │ ├── autoencoder_kl_ltx.py
│ │ │ ├── autoencoder_kl_ltx2.py
│ │ │ ├── autoencoder_kl_ltx2_audio.py
│ │ │ ├── autoencoder_kl_magvit.py
│ │ │ ├── autoencoder_kl_mochi.py
│ │ │ ├── autoencoder_kl_qwenimage.py
│ │ │ ├── autoencoder_kl_temporal_decoder.py
│ │ │ ├── autoencoder_kl_wan.py
│ │ │ ├── autoencoder_oobleck.py
│ │ │ ├── autoencoder_rae.py
│ │ │ ├── autoencoder_tiny.py
│ │ │ ├── autoencoder_vidtok.py
│ │ │ ├── consistency_decoder_vae.py
│ │ │ ├── vae.py
│ │ │ └── vq_model.py
│ │ ├── cache_utils.py
│ │ ├── controlnets/
│ │ │ ├── __init__.py
│ │ │ ├── controlnet.py
│ │ │ ├── controlnet_cosmos.py
│ │ │ ├── controlnet_flax.py
│ │ │ ├── controlnet_flux.py
│ │ │ ├── controlnet_hunyuan.py
│ │ │ ├── controlnet_qwenimage.py
│ │ │ ├── controlnet_sana.py
│ │ │ ├── controlnet_sd3.py
│ │ │ ├── controlnet_sparsectrl.py
│ │ │ ├── controlnet_union.py
│ │ │ ├── controlnet_xs.py
│ │ │ ├── controlnet_z_image.py
│ │ │ ├── multicontrolnet.py
│ │ │ └── multicontrolnet_union.py
│ │ ├── downsampling.py
│ │ ├── embeddings.py
│ │ ├── embeddings_flax.py
│ │ ├── lora.py
│ │ ├── model_loading_utils.py
│ │ ├── modeling_flax_pytorch_utils.py
│ │ ├── modeling_flax_utils.py
│ │ ├── modeling_outputs.py
│ │ ├── modeling_pytorch_flax_utils.py
│ │ ├── modeling_utils.py
│ │ ├── normalization.py
│ │ ├── resnet.py
│ │ ├── resnet_flax.py
│ │ ├── transformers/
│ │ │ ├── __init__.py
│ │ │ ├── auraflow_transformer_2d.py
│ │ │ ├── cogvideox_transformer_3d.py
│ │ │ ├── consisid_transformer_3d.py
│ │ │ ├── dit_transformer_2d.py
│ │ │ ├── dual_transformer_2d.py
│ │ │ ├── hunyuan_transformer_2d.py
│ │ │ ├── latte_transformer_3d.py
│ │ │ ├── lumina_nextdit2d.py
│ │ │ ├── pixart_transformer_2d.py
│ │ │ ├── prior_transformer.py
│ │ │ ├── sana_transformer.py
│ │ │ ├── stable_audio_transformer.py
│ │ │ ├── t5_film_transformer.py
│ │ │ ├── transformer_2d.py
│ │ │ ├── transformer_allegro.py
│ │ │ ├── transformer_bria.py
│ │ │ ├── transformer_bria_fibo.py
│ │ │ ├── transformer_chroma.py
│ │ │ ├── transformer_chronoedit.py
│ │ │ ├── transformer_cogview3plus.py
│ │ │ ├── transformer_cogview4.py
│ │ │ ├── transformer_cosmos.py
│ │ │ ├── transformer_easyanimate.py
│ │ │ ├── transformer_flux.py
│ │ │ ├── transformer_flux2.py
│ │ │ ├── transformer_glm_image.py
│ │ │ ├── transformer_helios.py
│ │ │ ├── transformer_hidream_image.py
│ │ │ ├── transformer_hunyuan_video.py
│ │ │ ├── transformer_hunyuan_video15.py
│ │ │ ├── transformer_hunyuan_video_framepack.py
│ │ │ ├── transformer_hunyuanimage.py
│ │ │ ├── transformer_kandinsky.py
│ │ │ ├── transformer_longcat_image.py
│ │ │ ├── transformer_ltx.py
│ │ │ ├── transformer_ltx2.py
│ │ │ ├── transformer_lumina2.py
│ │ │ ├── transformer_mochi.py
│ │ │ ├── transformer_omnigen.py
│ │ │ ├── transformer_ovis_image.py
│ │ │ ├── transformer_prx.py
│ │ │ ├── transformer_qwenimage.py
│ │ │ ├── transformer_sana_video.py
│ │ │ ├── transformer_sd3.py
│ │ │ ├── transformer_skyreels_v2.py
│ │ │ ├── transformer_temporal.py
│ │ │ ├── transformer_wan.py
│ │ │ ├── transformer_wan_animate.py
│ │ │ ├── transformer_wan_vace.py
│ │ │ └── transformer_z_image.py
│ │ ├── unets/
│ │ │ ├── __init__.py
│ │ │ ├── unet_1d.py
│ │ │ ├── unet_1d_blocks.py
│ │ │ ├── unet_2d.py
│ │ │ ├── unet_2d_blocks.py
│ │ │ ├── unet_2d_blocks_flax.py
│ │ │ ├── unet_2d_condition.py
│ │ │ ├── unet_2d_condition_flax.py
│ │ │ ├── unet_3d_blocks.py
│ │ │ ├── unet_3d_condition.py
│ │ │ ├── unet_i2vgen_xl.py
│ │ │ ├── unet_kandinsky3.py
│ │ │ ├── unet_motion_model.py
│ │ │ ├── unet_spatio_temporal_condition.py
│ │ │ ├── unet_stable_cascade.py
│ │ │ └── uvit_2d.py
│ │ ├── upsampling.py
│ │ ├── vae_flax.py
│ │ └── vq_model.py
│ ├── modular_pipelines/
│ │ ├── __init__.py
│ │ ├── components_manager.py
│ │ ├── flux/
│ │ │ ├── __init__.py
│ │ │ ├── before_denoise.py
│ │ │ ├── decoders.py
│ │ │ ├── denoise.py
│ │ │ ├── encoders.py
│ │ │ ├── inputs.py
│ │ │ ├── modular_blocks_flux.py
│ │ │ ├── modular_blocks_flux_kontext.py
│ │ │ └── modular_pipeline.py
│ │ ├── flux2/
│ │ │ ├── __init__.py
│ │ │ ├── before_denoise.py
│ │ │ ├── decoders.py
│ │ │ ├── denoise.py
│ │ │ ├── encoders.py
│ │ │ ├── inputs.py
│ │ │ ├── modular_blocks_flux2.py
│ │ │ ├── modular_blocks_flux2_klein.py
│ │ │ ├── modular_blocks_flux2_klein_base.py
│ │ │ └── modular_pipeline.py
│ │ ├── helios/
│ │ │ ├── __init__.py
│ │ │ ├── before_denoise.py
│ │ │ ├── decoders.py
│ │ │ ├── denoise.py
│ │ │ ├── encoders.py
│ │ │ ├── modular_blocks_helios.py
│ │ │ ├── modular_blocks_helios_pyramid.py
│ │ │ ├── modular_blocks_helios_pyramid_distilled.py
│ │ │ └── modular_pipeline.py
│ │ ├── mellon_node_utils.py
│ │ ├── modular_pipeline.py
│ │ ├── modular_pipeline_utils.py
│ │ ├── qwenimage/
│ │ │ ├── __init__.py
│ │ │ ├── before_denoise.py
│ │ │ ├── decoders.py
│ │ │ ├── denoise.py
│ │ │ ├── encoders.py
│ │ │ ├── inputs.py
│ │ │ ├── modular_blocks_qwenimage.py
│ │ │ ├── modular_blocks_qwenimage_edit.py
│ │ │ ├── modular_blocks_qwenimage_edit_plus.py
│ │ │ ├── modular_blocks_qwenimage_layered.py
│ │ │ ├── modular_pipeline.py
│ │ │ └── prompt_templates.py
│ │ ├── stable_diffusion_xl/
│ │ │ ├── __init__.py
│ │ │ ├── before_denoise.py
│ │ │ ├── decoders.py
│ │ │ ├── denoise.py
│ │ │ ├── encoders.py
│ │ │ ├── modular_blocks_stable_diffusion_xl.py
│ │ │ └── modular_pipeline.py
│ │ ├── wan/
│ │ │ ├── __init__.py
│ │ │ ├── before_denoise.py
│ │ │ ├── decoders.py
│ │ │ ├── denoise.py
│ │ │ ├── encoders.py
│ │ │ ├── modular_blocks_wan.py
│ │ │ ├── modular_blocks_wan22.py
│ │ │ ├── modular_blocks_wan22_i2v.py
│ │ │ ├── modular_blocks_wan_i2v.py
│ │ │ └── modular_pipeline.py
│ │ └── z_image/
│ │ ├── __init__.py
│ │ ├── before_denoise.py
│ │ ├── decoders.py
│ │ ├── denoise.py
│ │ ├── encoders.py
│ │ ├── modular_blocks_z_image.py
│ │ └── modular_pipeline.py
│ ├── optimization.py
│ ├── pipelines/
│ │ ├── README.md
│ │ ├── __init__.py
│ │ ├── allegro/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_allegro.py
│ │ │ └── pipeline_output.py
│ │ ├── amused/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_amused.py
│ │ │ ├── pipeline_amused_img2img.py
│ │ │ └── pipeline_amused_inpaint.py
│ │ ├── animatediff/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_animatediff.py
│ │ │ ├── pipeline_animatediff_controlnet.py
│ │ │ ├── pipeline_animatediff_sdxl.py
│ │ │ ├── pipeline_animatediff_sparsectrl.py
│ │ │ ├── pipeline_animatediff_video2video.py
│ │ │ ├── pipeline_animatediff_video2video_controlnet.py
│ │ │ └── pipeline_output.py
│ │ ├── audioldm/
│ │ │ ├── __init__.py
│ │ │ └── pipeline_audioldm.py
│ │ ├── audioldm2/
│ │ │ ├── __init__.py
│ │ │ ├── modeling_audioldm2.py
│ │ │ └── pipeline_audioldm2.py
│ │ ├── aura_flow/
│ │ │ ├── __init__.py
│ │ │ └── pipeline_aura_flow.py
│ │ ├── auto_pipeline.py
│ │ ├── blip_diffusion/
│ │ │ ├── __init__.py
│ │ │ ├── blip_image_processing.py
│ │ │ ├── modeling_blip2.py
│ │ │ ├── modeling_ctx_clip.py
│ │ │ └── pipeline_blip_diffusion.py
│ │ ├── bria/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_bria.py
│ │ │ └── pipeline_output.py
│ │ ├── bria_fibo/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_bria_fibo.py
│ │ │ ├── pipeline_bria_fibo_edit.py
│ │ │ └── pipeline_output.py
│ │ ├── chroma/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_chroma.py
│ │ │ ├── pipeline_chroma_img2img.py
│ │ │ ├── pipeline_chroma_inpainting.py
│ │ │ └── pipeline_output.py
│ │ ├── chronoedit/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_chronoedit.py
│ │ │ └── pipeline_output.py
│ │ ├── cogvideo/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_cogvideox.py
│ │ │ ├── pipeline_cogvideox_fun_control.py
│ │ │ ├── pipeline_cogvideox_image2video.py
│ │ │ ├── pipeline_cogvideox_video2video.py
│ │ │ └── pipeline_output.py
│ │ ├── cogview3/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_cogview3plus.py
│ │ │ └── pipeline_output.py
│ │ ├── cogview4/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_cogview4.py
│ │ │ ├── pipeline_cogview4_control.py
│ │ │ └── pipeline_output.py
│ │ ├── consisid/
│ │ │ ├── __init__.py
│ │ │ ├── consisid_utils.py
│ │ │ ├── pipeline_consisid.py
│ │ │ └── pipeline_output.py
│ │ ├── consistency_models/
│ │ │ ├── __init__.py
│ │ │ └── pipeline_consistency_models.py
│ │ ├── controlnet/
│ │ │ ├── __init__.py
│ │ │ ├── multicontrolnet.py
│ │ │ ├── pipeline_controlnet.py
│ │ │ ├── pipeline_controlnet_blip_diffusion.py
│ │ │ ├── pipeline_controlnet_img2img.py
│ │ │ ├── pipeline_controlnet_inpaint.py
│ │ │ ├── pipeline_controlnet_inpaint_sd_xl.py
│ │ │ ├── pipeline_controlnet_sd_xl.py
│ │ │ ├── pipeline_controlnet_sd_xl_img2img.py
│ │ │ ├── pipeline_controlnet_union_inpaint_sd_xl.py
│ │ │ ├── pipeline_controlnet_union_sd_xl.py
│ │ │ ├── pipeline_controlnet_union_sd_xl_img2img.py
│ │ │ └── pipeline_flax_controlnet.py
│ │ ├── controlnet_hunyuandit/
│ │ │ ├── __init__.py
│ │ │ └── pipeline_hunyuandit_controlnet.py
│ │ ├── controlnet_sd3/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_stable_diffusion_3_controlnet.py
│ │ │ └── pipeline_stable_diffusion_3_controlnet_inpainting.py
│ │ ├── controlnet_xs/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_controlnet_xs.py
│ │ │ └── pipeline_controlnet_xs_sd_xl.py
│ │ ├── cosmos/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_cosmos2_5_predict.py
│ │ │ ├── pipeline_cosmos2_5_transfer.py
│ │ │ ├── pipeline_cosmos2_text2image.py
│ │ │ ├── pipeline_cosmos2_video2world.py
│ │ │ ├── pipeline_cosmos_text2world.py
│ │ │ ├── pipeline_cosmos_video2world.py
│ │ │ └── pipeline_output.py
│ │ ├── dance_diffusion/
│ │ │ ├── __init__.py
│ │ │ └── pipeline_dance_diffusion.py
│ │ ├── ddim/
│ │ │ ├── __init__.py
│ │ │ └── pipeline_ddim.py
│ │ ├── ddpm/
│ │ │ ├── __init__.py
│ │ │ └── pipeline_ddpm.py
│ │ ├── deepfloyd_if/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_if.py
│ │ │ ├── pipeline_if_img2img.py
│ │ │ ├── pipeline_if_img2img_superresolution.py
│ │ │ ├── pipeline_if_inpainting.py
│ │ │ ├── pipeline_if_inpainting_superresolution.py
│ │ │ ├── pipeline_if_superresolution.py
│ │ │ ├── pipeline_output.py
│ │ │ ├── safety_checker.py
│ │ │ ├── timesteps.py
│ │ │ └── watermark.py
│ │ ├── deprecated/
│ │ │ ├── README.md
│ │ │ ├── __init__.py
│ │ │ ├── alt_diffusion/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── modeling_roberta_series.py
│ │ │ │ ├── pipeline_alt_diffusion.py
│ │ │ │ ├── pipeline_alt_diffusion_img2img.py
│ │ │ │ └── pipeline_output.py
│ │ │ ├── audio_diffusion/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── mel.py
│ │ │ │ └── pipeline_audio_diffusion.py
│ │ │ ├── latent_diffusion_uncond/
│ │ │ │ ├── __init__.py
│ │ │ │ └── pipeline_latent_diffusion_uncond.py
│ │ │ ├── pndm/
│ │ │ │ ├── __init__.py
│ │ │ │ └── pipeline_pndm.py
│ │ │ ├── repaint/
│ │ │ │ ├── __init__.py
│ │ │ │ └── pipeline_repaint.py
│ │ │ ├── score_sde_ve/
│ │ │ │ ├── __init__.py
│ │ │ │ └── pipeline_score_sde_ve.py
│ │ │ ├── spectrogram_diffusion/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── continuous_encoder.py
│ │ │ │ ├── midi_utils.py
│ │ │ │ ├── notes_encoder.py
│ │ │ │ └── pipeline_spectrogram_diffusion.py
│ │ │ ├── stable_diffusion_variants/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── pipeline_cycle_diffusion.py
│ │ │ │ ├── pipeline_onnx_stable_diffusion_inpaint_legacy.py
│ │ │ │ ├── pipeline_stable_diffusion_inpaint_legacy.py
│ │ │ │ ├── pipeline_stable_diffusion_model_editing.py
│ │ │ │ ├── pipeline_stable_diffusion_paradigms.py
│ │ │ │ └── pipeline_stable_diffusion_pix2pix_zero.py
│ │ │ ├── stochastic_karras_ve/
│ │ │ │ ├── __init__.py
│ │ │ │ └── pipeline_stochastic_karras_ve.py
│ │ │ ├── versatile_diffusion/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── modeling_text_unet.py
│ │ │ │ ├── pipeline_versatile_diffusion.py
│ │ │ │ ├── pipeline_versatile_diffusion_dual_guided.py
│ │ │ │ ├── pipeline_versatile_diffusion_image_variation.py
│ │ │ │ └── pipeline_versatile_diffusion_text_to_image.py
│ │ │ └── vq_diffusion/
│ │ │ ├── __init__.py
│ │ │ └── pipeline_vq_diffusion.py
│ │ ├── dit/
│ │ │ ├── __init__.py
│ │ │ └── pipeline_dit.py
│ │ ├── easyanimate/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_easyanimate.py
│ │ │ ├── pipeline_easyanimate_control.py
│ │ │ ├── pipeline_easyanimate_inpaint.py
│ │ │ └── pipeline_output.py
│ │ ├── flux/
│ │ │ ├── __init__.py
│ │ │ ├── modeling_flux.py
│ │ │ ├── pipeline_flux.py
│ │ │ ├── pipeline_flux_control.py
│ │ │ ├── pipeline_flux_control_img2img.py
│ │ │ ├── pipeline_flux_control_inpaint.py
│ │ │ ├── pipeline_flux_controlnet.py
│ │ │ ├── pipeline_flux_controlnet_image_to_image.py
│ │ │ ├── pipeline_flux_controlnet_inpainting.py
│ │ │ ├── pipeline_flux_fill.py
│ │ │ ├── pipeline_flux_img2img.py
│ │ │ ├── pipeline_flux_inpaint.py
│ │ │ ├── pipeline_flux_kontext.py
│ │ │ ├── pipeline_flux_kontext_inpaint.py
│ │ │ ├── pipeline_flux_prior_redux.py
│ │ │ └── pipeline_output.py
│ │ ├── flux2/
│ │ │ ├── __init__.py
│ │ │ ├── image_processor.py
│ │ │ ├── pipeline_flux2.py
│ │ │ ├── pipeline_flux2_klein.py
│ │ │ ├── pipeline_flux2_klein_kv.py
│ │ │ ├── pipeline_output.py
│ │ │ └── system_messages.py
│ │ ├── free_init_utils.py
│ │ ├── free_noise_utils.py
│ │ ├── glm_image/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_glm_image.py
│ │ │ └── pipeline_output.py
│ │ ├── helios/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_helios.py
│ │ │ ├── pipeline_helios_pyramid.py
│ │ │ └── pipeline_output.py
│ │ ├── hidream_image/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_hidream_image.py
│ │ │ └── pipeline_output.py
│ │ ├── hunyuan_image/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_hunyuanimage.py
│ │ │ ├── pipeline_hunyuanimage_refiner.py
│ │ │ └── pipeline_output.py
│ │ ├── hunyuan_video/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_hunyuan_skyreels_image2video.py
│ │ │ ├── pipeline_hunyuan_video.py
│ │ │ ├── pipeline_hunyuan_video_framepack.py
│ │ │ ├── pipeline_hunyuan_video_image2video.py
│ │ │ └── pipeline_output.py
│ │ ├── hunyuan_video1_5/
│ │ │ ├── __init__.py
│ │ │ ├── image_processor.py
│ │ │ ├── pipeline_hunyuan_video1_5.py
│ │ │ ├── pipeline_hunyuan_video1_5_image2video.py
│ │ │ └── pipeline_output.py
│ │ ├── hunyuandit/
│ │ │ ├── __init__.py
│ │ │ └── pipeline_hunyuandit.py
│ │ ├── i2vgen_xl/
│ │ │ ├── __init__.py
│ │ │ └── pipeline_i2vgen_xl.py
│ │ ├── kandinsky/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_kandinsky.py
│ │ │ ├── pipeline_kandinsky_combined.py
│ │ │ ├── pipeline_kandinsky_img2img.py
│ │ │ ├── pipeline_kandinsky_inpaint.py
│ │ │ ├── pipeline_kandinsky_prior.py
│ │ │ └── text_encoder.py
│ │ ├── kandinsky2_2/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_kandinsky2_2.py
│ │ │ ├── pipeline_kandinsky2_2_combined.py
│ │ │ ├── pipeline_kandinsky2_2_controlnet.py
│ │ │ ├── pipeline_kandinsky2_2_controlnet_img2img.py
│ │ │ ├── pipeline_kandinsky2_2_img2img.py
│ │ │ ├── pipeline_kandinsky2_2_inpainting.py
│ │ │ ├── pipeline_kandinsky2_2_prior.py
│ │ │ └── pipeline_kandinsky2_2_prior_emb2emb.py
│ │ ├── kandinsky3/
│ │ │ ├── __init__.py
│ │ │ ├── convert_kandinsky3_unet.py
│ │ │ ├── pipeline_kandinsky3.py
│ │ │ └── pipeline_kandinsky3_img2img.py
│ │ ├── kandinsky5/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_kandinsky.py
│ │ │ ├── pipeline_kandinsky_i2i.py
│ │ │ ├── pipeline_kandinsky_i2v.py
│ │ │ ├── pipeline_kandinsky_t2i.py
│ │ │ └── pipeline_output.py
│ │ ├── kolors/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_kolors.py
│ │ │ ├── pipeline_kolors_img2img.py
│ │ │ ├── pipeline_output.py
│ │ │ ├── text_encoder.py
│ │ │ └── tokenizer.py
│ │ ├── latent_consistency_models/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_latent_consistency_img2img.py
│ │ │ └── pipeline_latent_consistency_text2img.py
│ │ ├── latent_diffusion/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_latent_diffusion.py
│ │ │ └── pipeline_latent_diffusion_superresolution.py
│ │ ├── latte/
│ │ │ ├── __init__.py
│ │ │ └── pipeline_latte.py
│ │ ├── ledits_pp/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_leditspp_stable_diffusion.py
│ │ │ ├── pipeline_leditspp_stable_diffusion_xl.py
│ │ │ └── pipeline_output.py
│ │ ├── longcat_image/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_longcat_image.py
│ │ │ ├── pipeline_longcat_image_edit.py
│ │ │ ├── pipeline_output.py
│ │ │ └── system_messages.py
│ │ ├── ltx/
│ │ │ ├── __init__.py
│ │ │ ├── modeling_latent_upsampler.py
│ │ │ ├── pipeline_ltx.py
│ │ │ ├── pipeline_ltx_condition.py
│ │ │ ├── pipeline_ltx_i2v_long_multi_prompt.py
│ │ │ ├── pipeline_ltx_image2video.py
│ │ │ ├── pipeline_ltx_latent_upsample.py
│ │ │ └── pipeline_output.py
│ │ ├── ltx2/
│ │ │ ├── __init__.py
│ │ │ ├── connectors.py
│ │ │ ├── export_utils.py
│ │ │ ├── latent_upsampler.py
│ │ │ ├── pipeline_ltx2.py
│ │ │ ├── pipeline_ltx2_condition.py
│ │ │ ├── pipeline_ltx2_image2video.py
│ │ │ ├── pipeline_ltx2_latent_upsample.py
│ │ │ ├── pipeline_output.py
│ │ │ ├── utils.py
│ │ │ └── vocoder.py
│ │ ├── lucy/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_lucy_edit.py
│ │ │ └── pipeline_output.py
│ │ ├── lumina/
│ │ │ ├── __init__.py
│ │ │ └── pipeline_lumina.py
│ │ ├── lumina2/
│ │ │ ├── __init__.py
│ │ │ └── pipeline_lumina2.py
│ │ ├── marigold/
│ │ │ ├── __init__.py
│ │ │ ├── marigold_image_processing.py
│ │ │ ├── pipeline_marigold_depth.py
│ │ │ ├── pipeline_marigold_intrinsics.py
│ │ │ └── pipeline_marigold_normals.py
│ │ ├── mochi/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_mochi.py
│ │ │ └── pipeline_output.py
│ │ ├── musicldm/
│ │ │ ├── __init__.py
│ │ │ └── pipeline_musicldm.py
│ │ ├── omnigen/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_omnigen.py
│ │ │ └── processor_omnigen.py
│ │ ├── onnx_utils.py
│ │ ├── ovis_image/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_output.py
│ │ │ └── pipeline_ovis_image.py
│ │ ├── pag/
│ │ │ ├── __init__.py
│ │ │ ├── pag_utils.py
│ │ │ ├── pipeline_pag_controlnet_sd.py
│ │ │ ├── pipeline_pag_controlnet_sd_inpaint.py
│ │ │ ├── pipeline_pag_controlnet_sd_xl.py
│ │ │ ├── pipeline_pag_controlnet_sd_xl_img2img.py
│ │ │ ├── pipeline_pag_hunyuandit.py
│ │ │ ├── pipeline_pag_kolors.py
│ │ │ ├── pipeline_pag_pixart_sigma.py
│ │ │ ├── pipeline_pag_sana.py
│ │ │ ├── pipeline_pag_sd.py
│ │ │ ├── pipeline_pag_sd_3.py
│ │ │ ├── pipeline_pag_sd_3_img2img.py
│ │ │ ├── pipeline_pag_sd_animatediff.py
│ │ │ ├── pipeline_pag_sd_img2img.py
│ │ │ ├── pipeline_pag_sd_inpaint.py
│ │ │ ├── pipeline_pag_sd_xl.py
│ │ │ ├── pipeline_pag_sd_xl_img2img.py
│ │ │ └── pipeline_pag_sd_xl_inpaint.py
│ │ ├── paint_by_example/
│ │ │ ├── __init__.py
│ │ │ ├── image_encoder.py
│ │ │ └── pipeline_paint_by_example.py
│ │ ├── pia/
│ │ │ ├── __init__.py
│ │ │ └── pipeline_pia.py
│ │ ├── pipeline_flax_utils.py
│ │ ├── pipeline_loading_utils.py
│ │ ├── pipeline_utils.py
│ │ ├── pixart_alpha/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_pixart_alpha.py
│ │ │ └── pipeline_pixart_sigma.py
│ │ ├── prx/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_output.py
│ │ │ └── pipeline_prx.py
│ │ ├── qwenimage/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_output.py
│ │ │ ├── pipeline_qwenimage.py
│ │ │ ├── pipeline_qwenimage_controlnet.py
│ │ │ ├── pipeline_qwenimage_controlnet_inpaint.py
│ │ │ ├── pipeline_qwenimage_edit.py
│ │ │ ├── pipeline_qwenimage_edit_inpaint.py
│ │ │ ├── pipeline_qwenimage_edit_plus.py
│ │ │ ├── pipeline_qwenimage_img2img.py
│ │ │ ├── pipeline_qwenimage_inpaint.py
│ │ │ └── pipeline_qwenimage_layered.py
│ │ ├── sana/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_output.py
│ │ │ ├── pipeline_sana.py
│ │ │ ├── pipeline_sana_controlnet.py
│ │ │ ├── pipeline_sana_sprint.py
│ │ │ └── pipeline_sana_sprint_img2img.py
│ │ ├── sana_video/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_output.py
│ │ │ ├── pipeline_sana_video.py
│ │ │ └── pipeline_sana_video_i2v.py
│ │ ├── semantic_stable_diffusion/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_output.py
│ │ │ └── pipeline_semantic_stable_diffusion.py
│ │ ├── shap_e/
│ │ │ ├── __init__.py
│ │ │ ├── camera.py
│ │ │ ├── pipeline_shap_e.py
│ │ │ ├── pipeline_shap_e_img2img.py
│ │ │ └── renderer.py
│ │ ├── skyreels_v2/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_output.py
│ │ │ ├── pipeline_skyreels_v2.py
│ │ │ ├── pipeline_skyreels_v2_diffusion_forcing.py
│ │ │ ├── pipeline_skyreels_v2_diffusion_forcing_i2v.py
│ │ │ ├── pipeline_skyreels_v2_diffusion_forcing_v2v.py
│ │ │ └── pipeline_skyreels_v2_i2v.py
│ │ ├── stable_audio/
│ │ │ ├── __init__.py
│ │ │ ├── modeling_stable_audio.py
│ │ │ └── pipeline_stable_audio.py
│ │ ├── stable_cascade/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_stable_cascade.py
│ │ │ ├── pipeline_stable_cascade_combined.py
│ │ │ └── pipeline_stable_cascade_prior.py
│ │ ├── stable_diffusion/
│ │ │ ├── README.md
│ │ │ ├── __init__.py
│ │ │ ├── clip_image_project_model.py
│ │ │ ├── convert_from_ckpt.py
│ │ │ ├── pipeline_flax_stable_diffusion.py
│ │ │ ├── pipeline_flax_stable_diffusion_img2img.py
│ │ │ ├── pipeline_flax_stable_diffusion_inpaint.py
│ │ │ ├── pipeline_onnx_stable_diffusion.py
│ │ │ ├── pipeline_onnx_stable_diffusion_img2img.py
│ │ │ ├── pipeline_onnx_stable_diffusion_inpaint.py
│ │ │ ├── pipeline_onnx_stable_diffusion_upscale.py
│ │ │ ├── pipeline_output.py
│ │ │ ├── pipeline_stable_diffusion.py
│ │ │ ├── pipeline_stable_diffusion_depth2img.py
│ │ │ ├── pipeline_stable_diffusion_image_variation.py
│ │ │ ├── pipeline_stable_diffusion_img2img.py
│ │ │ ├── pipeline_stable_diffusion_inpaint.py
│ │ │ ├── pipeline_stable_diffusion_instruct_pix2pix.py
│ │ │ ├── pipeline_stable_diffusion_latent_upscale.py
│ │ │ ├── pipeline_stable_diffusion_upscale.py
│ │ │ ├── pipeline_stable_unclip.py
│ │ │ ├── pipeline_stable_unclip_img2img.py
│ │ │ ├── safety_checker.py
│ │ │ ├── safety_checker_flax.py
│ │ │ └── stable_unclip_image_normalizer.py
│ │ ├── stable_diffusion_3/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_output.py
│ │ │ ├── pipeline_stable_diffusion_3.py
│ │ │ ├── pipeline_stable_diffusion_3_img2img.py
│ │ │ └── pipeline_stable_diffusion_3_inpaint.py
│ │ ├── stable_diffusion_attend_and_excite/
│ │ │ ├── __init__.py
│ │ │ └── pipeline_stable_diffusion_attend_and_excite.py
│ │ ├── stable_diffusion_diffedit/
│ │ │ ├── __init__.py
│ │ │ └── pipeline_stable_diffusion_diffedit.py
│ │ ├── stable_diffusion_gligen/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_stable_diffusion_gligen.py
│ │ │ └── pipeline_stable_diffusion_gligen_text_image.py
│ │ ├── stable_diffusion_ldm3d/
│ │ │ ├── __init__.py
│ │ │ └── pipeline_stable_diffusion_ldm3d.py
│ │ ├── stable_diffusion_panorama/
│ │ │ ├── __init__.py
│ │ │ └── pipeline_stable_diffusion_panorama.py
│ │ ├── stable_diffusion_safe/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_output.py
│ │ │ ├── pipeline_stable_diffusion_safe.py
│ │ │ └── safety_checker.py
│ │ ├── stable_diffusion_sag/
│ │ │ ├── __init__.py
│ │ │ └── pipeline_stable_diffusion_sag.py
│ │ ├── stable_diffusion_xl/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_flax_stable_diffusion_xl.py
│ │ │ ├── pipeline_output.py
│ │ │ ├── pipeline_stable_diffusion_xl.py
│ │ │ ├── pipeline_stable_diffusion_xl_img2img.py
│ │ │ ├── pipeline_stable_diffusion_xl_inpaint.py
│ │ │ ├── pipeline_stable_diffusion_xl_instruct_pix2pix.py
│ │ │ └── watermark.py
│ │ ├── stable_video_diffusion/
│ │ │ ├── __init__.py
│ │ │ └── pipeline_stable_video_diffusion.py
│ │ ├── t2i_adapter/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_stable_diffusion_adapter.py
│ │ │ └── pipeline_stable_diffusion_xl_adapter.py
│ │ ├── text_to_video_synthesis/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_output.py
│ │ │ ├── pipeline_text_to_video_synth.py
│ │ │ ├── pipeline_text_to_video_synth_img2img.py
│ │ │ ├── pipeline_text_to_video_zero.py
│ │ │ └── pipeline_text_to_video_zero_sdxl.py
│ │ ├── transformers_loading_utils.py
│ │ ├── unclip/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_unclip.py
│ │ │ ├── pipeline_unclip_image_variation.py
│ │ │ └── text_proj.py
│ │ ├── unidiffuser/
│ │ │ ├── __init__.py
│ │ │ ├── modeling_text_decoder.py
│ │ │ ├── modeling_uvit.py
│ │ │ └── pipeline_unidiffuser.py
│ │ ├── visualcloze/
│ │ │ ├── __init__.py
│ │ │ ├── pipeline_visualcloze_combined.py
│ │ │ ├── pipeline_visualcloze_generation.py
│ │ │ └── visualcloze_utils.py
│ │ ├── wan/
│ │ │ ├── __init__.py
│ │ │ ├── image_processor.py
│ │ │ ├── pipeline_output.py
│ │ │ ├── pipeline_wan.py
│ │ │ ├── pipeline_wan_animate.py
│ │ │ ├── pipeline_wan_i2v.py
│ │ │ ├── pipeline_wan_vace.py
│ │ │ └── pipeline_wan_video2video.py
│ │ ├── wuerstchen/
│ │ │ ├── __init__.py
│ │ │ ├── modeling_paella_vq_model.py
│ │ │ ├── modeling_wuerstchen_common.py
│ │ │ ├── modeling_wuerstchen_diffnext.py
│ │ │ ├── modeling_wuerstchen_prior.py
│ │ │ ├── pipeline_wuerstchen.py
│ │ │ ├── pipeline_wuerstchen_combined.py
│ │ │ └── pipeline_wuerstchen_prior.py
│ │ └── z_image/
│ │ ├── __init__.py
│ │ ├── pipeline_output.py
│ │ ├── pipeline_z_image.py
│ │ ├── pipeline_z_image_controlnet.py
│ │ ├── pipeline_z_image_controlnet_inpaint.py
│ │ ├── pipeline_z_image_img2img.py
│ │ ├── pipeline_z_image_inpaint.py
│ │ └── pipeline_z_image_omni.py
│ ├── py.typed
│ ├── quantizers/
│ │ ├── __init__.py
│ │ ├── auto.py
│ │ ├── base.py
│ │ ├── bitsandbytes/
│ │ │ ├── __init__.py
│ │ │ ├── bnb_quantizer.py
│ │ │ └── utils.py
│ │ ├── gguf/
│ │ │ ├── __init__.py
│ │ │ ├── gguf_quantizer.py
│ │ │ └── utils.py
│ │ ├── modelopt/
│ │ │ ├── __init__.py
│ │ │ └── modelopt_quantizer.py
│ │ ├── pipe_quant_config.py
│ │ ├── quantization_config.py
│ │ ├── quanto/
│ │ │ ├── __init__.py
│ │ │ ├── quanto_quantizer.py
│ │ │ └── utils.py
│ │ └── torchao/
│ │ ├── __init__.py
│ │ └── torchao_quantizer.py
│ ├── schedulers/
│ │ ├── README.md
│ │ ├── __init__.py
│ │ ├── deprecated/
│ │ │ ├── __init__.py
│ │ │ ├── scheduling_karras_ve.py
│ │ │ └── scheduling_sde_vp.py
│ │ ├── scheduling_amused.py
│ │ ├── scheduling_consistency_decoder.py
│ │ ├── scheduling_consistency_models.py
│ │ ├── scheduling_cosine_dpmsolver_multistep.py
│ │ ├── scheduling_ddim.py
│ │ ├── scheduling_ddim_cogvideox.py
│ │ ├── scheduling_ddim_flax.py
│ │ ├── scheduling_ddim_inverse.py
│ │ ├── scheduling_ddim_parallel.py
│ │ ├── scheduling_ddpm.py
│ │ ├── scheduling_ddpm_flax.py
│ │ ├── scheduling_ddpm_parallel.py
│ │ ├── scheduling_ddpm_wuerstchen.py
│ │ ├── scheduling_deis_multistep.py
│ │ ├── scheduling_dpm_cogvideox.py
│ │ ├── scheduling_dpmsolver_multistep.py
│ │ ├── scheduling_dpmsolver_multistep_flax.py
│ │ ├── scheduling_dpmsolver_multistep_inverse.py
│ │ ├── scheduling_dpmsolver_sde.py
│ │ ├── scheduling_dpmsolver_singlestep.py
│ │ ├── scheduling_edm_dpmsolver_multistep.py
│ │ ├── scheduling_edm_euler.py
│ │ ├── scheduling_euler_ancestral_discrete.py
│ │ ├── scheduling_euler_discrete.py
│ │ ├── scheduling_euler_discrete_flax.py
│ │ ├── scheduling_flow_match_euler_discrete.py
│ │ ├── scheduling_flow_match_heun_discrete.py
│ │ ├── scheduling_flow_match_lcm.py
│ │ ├── scheduling_helios.py
│ │ ├── scheduling_helios_dmd.py
│ │ ├── scheduling_heun_discrete.py
│ │ ├── scheduling_ipndm.py
│ │ ├── scheduling_k_dpm_2_ancestral_discrete.py
│ │ ├── scheduling_k_dpm_2_discrete.py
│ │ ├── scheduling_karras_ve_flax.py
│ │ ├── scheduling_lcm.py
│ │ ├── scheduling_lms_discrete.py
│ │ ├── scheduling_lms_discrete_flax.py
│ │ ├── scheduling_ltx_euler_ancestral_rf.py
│ │ ├── scheduling_pndm.py
│ │ ├── scheduling_pndm_flax.py
│ │ ├── scheduling_repaint.py
│ │ ├── scheduling_sasolver.py
│ │ ├── scheduling_scm.py
│ │ ├── scheduling_sde_ve.py
│ │ ├── scheduling_sde_ve_flax.py
│ │ ├── scheduling_tcd.py
│ │ ├── scheduling_unclip.py
│ │ ├── scheduling_unipc_multistep.py
│ │ ├── scheduling_utils.py
│ │ ├── scheduling_utils_flax.py
│ │ └── scheduling_vq_diffusion.py
│ ├── training_utils.py
│ ├── utils/
│ │ ├── __init__.py
│ │ ├── accelerate_utils.py
│ │ ├── constants.py
│ │ ├── deprecation_utils.py
│ │ ├── distributed_utils.py
│ │ ├── doc_utils.py
│ │ ├── dummy_bitsandbytes_objects.py
│ │ ├── dummy_flax_and_transformers_objects.py
│ │ ├── dummy_flax_objects.py
│ │ ├── dummy_gguf_objects.py
│ │ ├── dummy_note_seq_objects.py
│ │ ├── dummy_nvidia_modelopt_objects.py
│ │ ├── dummy_onnx_objects.py
│ │ ├── dummy_optimum_quanto_objects.py
│ │ ├── dummy_pt_objects.py
│ │ ├── dummy_torch_and_librosa_objects.py
│ │ ├── dummy_torch_and_scipy_objects.py
│ │ ├── dummy_torch_and_torchsde_objects.py
│ │ ├── dummy_torch_and_transformers_and_onnx_objects.py
│ │ ├── dummy_torch_and_transformers_and_opencv_objects.py
│ │ ├── dummy_torch_and_transformers_and_sentencepiece_objects.py
│ │ ├── dummy_torch_and_transformers_objects.py
│ │ ├── dummy_torchao_objects.py
│ │ ├── dummy_transformers_and_torch_and_note_seq_objects.py
│ │ ├── dynamic_modules_utils.py
│ │ ├── export_utils.py
│ │ ├── hub_utils.py
│ │ ├── import_utils.py
│ │ ├── loading_utils.py
│ │ ├── logging.py
│ │ ├── model_card_template.md
│ │ ├── outputs.py
│ │ ├── peft_utils.py
│ │ ├── pil_utils.py
│ │ ├── remote_utils.py
│ │ ├── source_code_parsing_utils.py
│ │ ├── state_dict_utils.py
│ │ ├── testing_utils.py
│ │ ├── torch_utils.py
│ │ ├── typing_utils.py
│ │ └── versions.py
│ └── video_processor.py
├── tests/
│ ├── __init__.py
│ ├── conftest.py
│ ├── fixtures/
│ │ ├── custom_pipeline/
│ │ │ ├── pipeline.py
│ │ │ └── what_ever.py
│ │ └── elise_format0.mid
│ ├── hooks/
│ │ ├── __init__.py
│ │ ├── test_group_offloading.py
│ │ ├── test_hooks.py
│ │ └── test_mag_cache.py
│ ├── lora/
│ │ ├── __init__.py
│ │ ├── test_lora_layers_auraflow.py
│ │ ├── test_lora_layers_cogvideox.py
│ │ ├── test_lora_layers_cogview4.py
│ │ ├── test_lora_layers_flux.py
│ │ ├── test_lora_layers_flux2.py
│ │ ├── test_lora_layers_helios.py
│ │ ├── test_lora_layers_hunyuanvideo.py
│ │ ├── test_lora_layers_ltx2.py
│ │ ├── test_lora_layers_ltx_video.py
│ │ ├── test_lora_layers_lumina2.py
│ │ ├── test_lora_layers_mochi.py
│ │ ├── test_lora_layers_qwenimage.py
│ │ ├── test_lora_layers_sana.py
│ │ ├── test_lora_layers_sd.py
│ │ ├── test_lora_layers_sd3.py
│ │ ├── test_lora_layers_sdxl.py
│ │ ├── test_lora_layers_wan.py
│ │ ├── test_lora_layers_wanvace.py
│ │ ├── test_lora_layers_z_image.py
│ │ └── utils.py
│ ├── models/
│ │ ├── __init__.py
│ │ ├── autoencoders/
│ │ │ ├── __init__.py
│ │ │ ├── test_models_asymmetric_autoencoder_kl.py
│ │ │ ├── test_models_autoencoder_cosmos.py
│ │ │ ├── test_models_autoencoder_dc.py
│ │ │ ├── test_models_autoencoder_hunyuan_video.py
│ │ │ ├── test_models_autoencoder_kl.py
│ │ │ ├── test_models_autoencoder_kl_cogvideox.py
│ │ │ ├── test_models_autoencoder_kl_ltx2_audio.py
│ │ │ ├── test_models_autoencoder_kl_temporal_decoder.py
│ │ │ ├── test_models_autoencoder_ltx2_video.py
│ │ │ ├── test_models_autoencoder_ltx_video.py
│ │ │ ├── test_models_autoencoder_magvit.py
│ │ │ ├── test_models_autoencoder_mochi.py
│ │ │ ├── test_models_autoencoder_oobleck.py
│ │ │ ├── test_models_autoencoder_rae.py
│ │ │ ├── test_models_autoencoder_tiny.py
│ │ │ ├── test_models_autoencoder_vidtok.py
│ │ │ ├── test_models_autoencoder_wan.py
│ │ │ ├── test_models_consistency_decoder_vae.py
│ │ │ ├── test_models_vq.py
│ │ │ ├── testing_utils.py
│ │ │ └── vae.py
│ │ ├── controlnets/
│ │ │ ├── __init__.py
│ │ │ └── test_models_controlnet_cosmos.py
│ │ ├── test_activations.py
│ │ ├── test_attention_processor.py
│ │ ├── test_layers_utils.py
│ │ ├── test_modeling_common.py
│ │ ├── test_models_auto.py
│ │ ├── testing_utils/
│ │ │ ├── __init__.py
│ │ │ ├── attention.py
│ │ │ ├── cache.py
│ │ │ ├── common.py
│ │ │ ├── compile.py
│ │ │ ├── ip_adapter.py
│ │ │ ├── lora.py
│ │ │ ├── memory.py
│ │ │ ├── parallelism.py
│ │ │ ├── quantization.py
│ │ │ ├── single_file.py
│ │ │ └── training.py
│ │ ├── transformers/
│ │ │ ├── __init__.py
│ │ │ ├── test_models_dit_transformer2d.py
│ │ │ ├── test_models_pixart_transformer2d.py
│ │ │ ├── test_models_prior.py
│ │ │ ├── test_models_transformer_allegro.py
│ │ │ ├── test_models_transformer_aura_flow.py
│ │ │ ├── test_models_transformer_bria.py
│ │ │ ├── test_models_transformer_bria_fibo.py
│ │ │ ├── test_models_transformer_chroma.py
│ │ │ ├── test_models_transformer_cogvideox.py
│ │ │ ├── test_models_transformer_cogview3plus.py
│ │ │ ├── test_models_transformer_cogview4.py
│ │ │ ├── test_models_transformer_consisid.py
│ │ │ ├── test_models_transformer_cosmos.py
│ │ │ ├── test_models_transformer_easyanimate.py
│ │ │ ├── test_models_transformer_flux.py
│ │ │ ├── test_models_transformer_flux2.py
│ │ │ ├── test_models_transformer_helios.py
│ │ │ ├── test_models_transformer_hidream.py
│ │ │ ├── test_models_transformer_hunyuan_1_5.py
│ │ │ ├── test_models_transformer_hunyuan_dit.py
│ │ │ ├── test_models_transformer_hunyuan_video.py
│ │ │ ├── test_models_transformer_hunyuan_video_framepack.py
│ │ │ ├── test_models_transformer_latte.py
│ │ │ ├── test_models_transformer_ltx.py
│ │ │ ├── test_models_transformer_ltx2.py
│ │ │ ├── test_models_transformer_lumina.py
│ │ │ ├── test_models_transformer_lumina2.py
│ │ │ ├── test_models_transformer_mochi.py
│ │ │ ├── test_models_transformer_omnigen.py
│ │ │ ├── test_models_transformer_prx.py
│ │ │ ├── test_models_transformer_qwenimage.py
│ │ │ ├── test_models_transformer_sana.py
│ │ │ ├── test_models_transformer_sana_video.py
│ │ │ ├── test_models_transformer_sd3.py
│ │ │ ├── test_models_transformer_skyreels_v2.py
│ │ │ ├── test_models_transformer_temporal.py
│ │ │ ├── test_models_transformer_wan.py
│ │ │ ├── test_models_transformer_wan_animate.py
│ │ │ ├── test_models_transformer_wan_vace.py
│ │ │ └── test_models_transformer_z_image.py
│ │ └── unets/
│ │ ├── __init__.py
│ │ ├── test_models_unet_1d.py
│ │ ├── test_models_unet_2d.py
│ │ ├── test_models_unet_2d_condition.py
│ │ ├── test_models_unet_3d_condition.py
│ │ ├── test_models_unet_controlnetxs.py
│ │ ├── test_models_unet_motion.py
│ │ ├── test_models_unet_spatiotemporal.py
│ │ ├── test_unet_2d_blocks.py
│ │ └── test_unet_blocks_common.py
│ ├── modular_pipelines/
│ │ ├── __init__.py
│ │ ├── flux/
│ │ │ ├── __init__.py
│ │ │ └── test_modular_pipeline_flux.py
│ │ ├── flux2/
│ │ │ ├── __init__.py
│ │ │ ├── test_modular_pipeline_flux2.py
│ │ │ ├── test_modular_pipeline_flux2_klein.py
│ │ │ └── test_modular_pipeline_flux2_klein_base.py
│ │ ├── helios/
│ │ │ ├── __init__.py
│ │ │ └── test_modular_pipeline_helios.py
│ │ ├── qwen/
│ │ │ ├── __init__.py
│ │ │ └── test_modular_pipeline_qwenimage.py
│ │ ├── stable_diffusion_xl/
│ │ │ ├── __init__.py
│ │ │ └── test_modular_pipeline_stable_diffusion_xl.py
│ │ ├── test_modular_pipelines_common.py
│ │ ├── test_modular_pipelines_custom_blocks.py
│ │ ├── wan/
│ │ │ ├── __init__.py
│ │ │ └── test_modular_pipeline_wan.py
│ │ └── z_image/
│ │ ├── __init__.py
│ │ └── test_modular_pipeline_z_image.py
│ ├── others/
│ │ ├── __init__.py
│ │ ├── test_attention_backends.py
│ │ ├── test_check_copies.py
│ │ ├── test_check_dummies.py
│ │ ├── test_check_support_list.py
│ │ ├── test_config.py
│ │ ├── test_dependencies.py
│ │ ├── test_ema.py
│ │ ├── test_hub_utils.py
│ │ ├── test_image_processor.py
│ │ ├── test_outputs.py
│ │ ├── test_training.py
│ │ ├── test_utils.py
│ │ └── test_video_processor.py
│ ├── pipelines/
│ │ ├── __init__.py
│ │ ├── allegro/
│ │ │ ├── __init__.py
│ │ │ └── test_allegro.py
│ │ ├── animatediff/
│ │ │ ├── __init__.py
│ │ │ ├── test_animatediff.py
│ │ │ ├── test_animatediff_controlnet.py
│ │ │ ├── test_animatediff_sdxl.py
│ │ │ ├── test_animatediff_sparsectrl.py
│ │ │ ├── test_animatediff_video2video.py
│ │ │ └── test_animatediff_video2video_controlnet.py
│ │ ├── audioldm2/
│ │ │ ├── __init__.py
│ │ │ └── test_audioldm2.py
│ │ ├── aura_flow/
│ │ │ ├── __init__.py
│ │ │ └── test_pipeline_aura_flow.py
│ │ ├── bria/
│ │ │ ├── __init__.py
│ │ │ └── test_pipeline_bria.py
│ │ ├── bria_fibo/
│ │ │ ├── __init__.py
│ │ │ └── test_pipeline_bria_fibo.py
│ │ ├── bria_fibo_edit/
│ │ │ ├── __init__.py
│ │ │ └── test_pipeline_bria_fibo_edit.py
│ │ ├── chroma/
│ │ │ ├── __init__.py
│ │ │ ├── test_pipeline_chroma.py
│ │ │ └── test_pipeline_chroma_img2img.py
│ │ ├── chronoedit/
│ │ │ ├── __init__.py
│ │ │ └── test_chronoedit.py
│ │ ├── cogvideo/
│ │ │ ├── __init__.py
│ │ │ ├── test_cogvideox.py
│ │ │ ├── test_cogvideox_fun_control.py
│ │ │ ├── test_cogvideox_image2video.py
│ │ │ └── test_cogvideox_video2video.py
│ │ ├── cogview3/
│ │ │ ├── __init__.py
│ │ │ └── test_cogview3plus.py
│ │ ├── cogview4/
│ │ │ ├── __init__.py
│ │ │ └── test_cogview4.py
│ │ ├── consisid/
│ │ │ ├── __init__.py
│ │ │ └── test_consisid.py
│ │ ├── consistency_models/
│ │ │ ├── __init__.py
│ │ │ └── test_consistency_models.py
│ │ ├── controlnet/
│ │ │ ├── __init__.py
│ │ │ ├── test_controlnet.py
│ │ │ ├── test_controlnet_img2img.py
│ │ │ ├── test_controlnet_inpaint.py
│ │ │ ├── test_controlnet_inpaint_sdxl.py
│ │ │ ├── test_controlnet_sdxl.py
│ │ │ └── test_controlnet_sdxl_img2img.py
│ │ ├── controlnet_flux/
│ │ │ ├── __init__.py
│ │ │ ├── test_controlnet_flux.py
│ │ │ ├── test_controlnet_flux_img2img.py
│ │ │ └── test_controlnet_flux_inpaint.py
│ │ ├── controlnet_hunyuandit/
│ │ │ ├── __init__.py
│ │ │ └── test_controlnet_hunyuandit.py
│ │ ├── controlnet_sd3/
│ │ │ ├── __init__.py
│ │ │ ├── test_controlnet_inpaint_sd3.py
│ │ │ └── test_controlnet_sd3.py
│ │ ├── cosmos/
│ │ │ ├── __init__.py
│ │ │ ├── cosmos_guardrail.py
│ │ │ ├── test_cosmos.py
│ │ │ ├── test_cosmos2_5_predict.py
│ │ │ ├── test_cosmos2_5_transfer.py
│ │ │ ├── test_cosmos2_text2image.py
│ │ │ ├── test_cosmos2_video2world.py
│ │ │ └── test_cosmos_video2world.py
│ │ ├── ddim/
│ │ │ ├── __init__.py
│ │ │ └── test_ddim.py
│ │ ├── ddpm/
│ │ │ ├── __init__.py
│ │ │ └── test_ddpm.py
│ │ ├── deepfloyd_if/
│ │ │ ├── __init__.py
│ │ │ ├── test_if.py
│ │ │ ├── test_if_img2img.py
│ │ │ ├── test_if_img2img_superresolution.py
│ │ │ ├── test_if_inpainting.py
│ │ │ ├── test_if_inpainting_superresolution.py
│ │ │ └── test_if_superresolution.py
│ │ ├── dit/
│ │ │ ├── __init__.py
│ │ │ └── test_dit.py
│ │ ├── easyanimate/
│ │ │ ├── __init__.py
│ │ │ └── test_easyanimate.py
│ │ ├── flux/
│ │ │ ├── __init__.py
│ │ │ ├── test_pipeline_flux.py
│ │ │ ├── test_pipeline_flux_control.py
│ │ │ ├── test_pipeline_flux_control_img2img.py
│ │ │ ├── test_pipeline_flux_control_inpaint.py
│ │ │ ├── test_pipeline_flux_fill.py
│ │ │ ├── test_pipeline_flux_img2img.py
│ │ │ ├── test_pipeline_flux_inpaint.py
│ │ │ ├── test_pipeline_flux_kontext.py
│ │ │ ├── test_pipeline_flux_kontext_inpaint.py
│ │ │ └── test_pipeline_flux_redux.py
│ │ ├── flux2/
│ │ │ ├── __init__.py
│ │ │ ├── test_pipeline_flux2.py
│ │ │ ├── test_pipeline_flux2_klein.py
│ │ │ └── test_pipeline_flux2_klein_kv.py
│ │ ├── glm_image/
│ │ │ ├── __init__.py
│ │ │ └── test_glm_image.py
│ │ ├── helios/
│ │ │ ├── __init__.py
│ │ │ └── test_helios.py
│ │ ├── hidream_image/
│ │ │ ├── __init__.py
│ │ │ └── test_pipeline_hidream.py
│ │ ├── hunyuan_image_21/
│ │ │ ├── __init__.py
│ │ │ └── test_hunyuanimage.py
│ │ ├── hunyuan_video/
│ │ │ ├── __init__.py
│ │ │ ├── test_hunyuan_image2video.py
│ │ │ ├── test_hunyuan_skyreels_image2video.py
│ │ │ ├── test_hunyuan_video.py
│ │ │ └── test_hunyuan_video_framepack.py
│ │ ├── hunyuan_video1_5/
│ │ │ ├── __init__.py
│ │ │ └── test_hunyuan_1_5.py
│ │ ├── hunyuandit/
│ │ │ ├── __init__.py
│ │ │ └── test_hunyuan_dit.py
│ │ ├── ip_adapters/
│ │ │ ├── __init__.py
│ │ │ └── test_ip_adapter_stable_diffusion.py
│ │ ├── kandinsky/
│ │ │ ├── __init__.py
│ │ │ ├── test_kandinsky.py
│ │ │ ├── test_kandinsky_combined.py
│ │ │ ├── test_kandinsky_img2img.py
│ │ │ ├── test_kandinsky_inpaint.py
│ │ │ └── test_kandinsky_prior.py
│ │ ├── kandinsky2_2/
│ │ │ ├── __init__.py
│ │ │ ├── test_kandinsky.py
│ │ │ ├── test_kandinsky_combined.py
│ │ │ ├── test_kandinsky_controlnet.py
│ │ │ ├── test_kandinsky_controlnet_img2img.py
│ │ │ ├── test_kandinsky_img2img.py
│ │ │ ├── test_kandinsky_inpaint.py
│ │ │ ├── test_kandinsky_prior.py
│ │ │ └── test_kandinsky_prior_emb2emb.py
│ │ ├── kandinsky3/
│ │ │ ├── __init__.py
│ │ │ ├── test_kandinsky3.py
│ │ │ └── test_kandinsky3_img2img.py
│ │ ├── kandinsky5/
│ │ │ ├── __init__.py
│ │ │ ├── test_kandinsky5.py
│ │ │ ├── test_kandinsky5_i2i.py
│ │ │ ├── test_kandinsky5_i2v.py
│ │ │ └── test_kandinsky5_t2i.py
│ │ ├── kolors/
│ │ │ ├── __init__.py
│ │ │ ├── test_kolors.py
│ │ │ └── test_kolors_img2img.py
│ │ ├── latent_consistency_models/
│ │ │ ├── __init__.py
│ │ │ ├── test_latent_consistency_models.py
│ │ │ └── test_latent_consistency_models_img2img.py
│ │ ├── latent_diffusion/
│ │ │ ├── __init__.py
│ │ │ ├── test_latent_diffusion.py
│ │ │ └── test_latent_diffusion_superresolution.py
│ │ ├── latte/
│ │ │ ├── __init__.py
│ │ │ └── test_latte.py
│ │ ├── ledits_pp/
│ │ │ ├── __init__.py
│ │ │ ├── test_ledits_pp_stable_diffusion.py
│ │ │ └── test_ledits_pp_stable_diffusion_xl.py
│ │ ├── longcat_image/
│ │ │ └── __init__.py
│ │ ├── ltx/
│ │ │ ├── __init__.py
│ │ │ ├── test_ltx.py
│ │ │ ├── test_ltx_condition.py
│ │ │ ├── test_ltx_image2video.py
│ │ │ └── test_ltx_latent_upsample.py
│ │ ├── ltx2/
│ │ │ ├── __init__.py
│ │ │ ├── test_ltx2.py
│ │ │ └── test_ltx2_image2video.py
│ │ ├── lumina/
│ │ │ ├── __init__.py
│ │ │ └── test_lumina_nextdit.py
│ │ ├── lumina2/
│ │ │ ├── __init__.py
│ │ │ └── test_pipeline_lumina2.py
│ │ ├── marigold/
│ │ │ ├── __init__.py
│ │ │ ├── test_marigold_depth.py
│ │ │ ├── test_marigold_intrinsics.py
│ │ │ └── test_marigold_normals.py
│ │ ├── mochi/
│ │ │ ├── __init__.py
│ │ │ └── test_mochi.py
│ │ ├── omnigen/
│ │ │ ├── __init__.py
│ │ │ └── test_pipeline_omnigen.py
│ │ ├── ovis_image/
│ │ │ └── __init__.py
│ │ ├── pag/
│ │ │ ├── __init__.py
│ │ │ ├── test_pag_animatediff.py
│ │ │ ├── test_pag_controlnet_sd.py
│ │ │ ├── test_pag_controlnet_sd_inpaint.py
│ │ │ ├── test_pag_controlnet_sdxl.py
│ │ │ ├── test_pag_controlnet_sdxl_img2img.py
│ │ │ ├── test_pag_hunyuan_dit.py
│ │ │ ├── test_pag_kolors.py
│ │ │ ├── test_pag_pixart_sigma.py
│ │ │ ├── test_pag_sana.py
│ │ │ ├── test_pag_sd.py
│ │ │ ├── test_pag_sd3.py
│ │ │ ├── test_pag_sd3_img2img.py
│ │ │ ├── test_pag_sd_img2img.py
│ │ │ ├── test_pag_sd_inpaint.py
│ │ │ ├── test_pag_sdxl.py
│ │ │ ├── test_pag_sdxl_img2img.py
│ │ │ └── test_pag_sdxl_inpaint.py
│ │ ├── pipeline_params.py
│ │ ├── pixart_alpha/
│ │ │ ├── __init__.py
│ │ │ └── test_pixart.py
│ │ ├── pixart_sigma/
│ │ │ ├── __init__.py
│ │ │ └── test_pixart.py
│ │ ├── pndm/
│ │ │ ├── __init__.py
│ │ │ └── test_pndm.py
│ │ ├── prx/
│ │ │ ├── __init__.py
│ │ │ └── test_pipeline_prx.py
│ │ ├── qwenimage/
│ │ │ ├── __init__.py
│ │ │ ├── test_qwenimage.py
│ │ │ ├── test_qwenimage_controlnet.py
│ │ │ ├── test_qwenimage_edit.py
│ │ │ ├── test_qwenimage_edit_plus.py
│ │ │ ├── test_qwenimage_img2img.py
│ │ │ └── test_qwenimage_inpaint.py
│ │ ├── sana/
│ │ │ ├── __init__.py
│ │ │ ├── test_sana.py
│ │ │ ├── test_sana_controlnet.py
│ │ │ ├── test_sana_sprint.py
│ │ │ └── test_sana_sprint_img2img.py
│ │ ├── sana_video/
│ │ │ ├── __init__.py
│ │ │ ├── test_sana_video.py
│ │ │ └── test_sana_video_i2v.py
│ │ ├── shap_e/
│ │ │ ├── __init__.py
│ │ │ ├── test_shap_e.py
│ │ │ └── test_shap_e_img2img.py
│ │ ├── skyreels_v2/
│ │ │ ├── __init__.py
│ │ │ ├── test_skyreels_v2.py
│ │ │ ├── test_skyreels_v2_df.py
│ │ │ ├── test_skyreels_v2_df_image_to_video.py
│ │ │ ├── test_skyreels_v2_df_video_to_video.py
│ │ │ └── test_skyreels_v2_image_to_video.py
│ │ ├── stable_audio/
│ │ │ ├── __init__.py
│ │ │ └── test_stable_audio.py
│ │ ├── stable_cascade/
│ │ │ ├── __init__.py
│ │ │ ├── test_stable_cascade_combined.py
│ │ │ ├── test_stable_cascade_decoder.py
│ │ │ └── test_stable_cascade_prior.py
│ │ ├── stable_diffusion/
│ │ │ ├── __init__.py
│ │ │ ├── test_onnx_stable_diffusion.py
│ │ │ ├── test_onnx_stable_diffusion_img2img.py
│ │ │ ├── test_onnx_stable_diffusion_inpaint.py
│ │ │ ├── test_onnx_stable_diffusion_upscale.py
│ │ │ ├── test_stable_diffusion.py
│ │ │ ├── test_stable_diffusion_img2img.py
│ │ │ ├── test_stable_diffusion_inpaint.py
│ │ │ └── test_stable_diffusion_instruction_pix2pix.py
│ │ ├── stable_diffusion_2/
│ │ │ ├── __init__.py
│ │ │ ├── test_stable_diffusion.py
│ │ │ ├── test_stable_diffusion_depth.py
│ │ │ ├── test_stable_diffusion_inpaint.py
│ │ │ ├── test_stable_diffusion_latent_upscale.py
│ │ │ ├── test_stable_diffusion_upscale.py
│ │ │ └── test_stable_diffusion_v_pred.py
│ │ ├── stable_diffusion_3/
│ │ │ ├── __init__.py
│ │ │ ├── test_pipeline_stable_diffusion_3.py
│ │ │ ├── test_pipeline_stable_diffusion_3_img2img.py
│ │ │ └── test_pipeline_stable_diffusion_3_inpaint.py
│ │ ├── stable_diffusion_adapter/
│ │ │ ├── __init__.py
│ │ │ └── test_stable_diffusion_adapter.py
│ │ ├── stable_diffusion_image_variation/
│ │ │ ├── __init__.py
│ │ │ └── test_stable_diffusion_image_variation.py
│ │ ├── stable_diffusion_xl/
│ │ │ ├── __init__.py
│ │ │ ├── test_stable_diffusion_xl.py
│ │ │ ├── test_stable_diffusion_xl_adapter.py
│ │ │ ├── test_stable_diffusion_xl_img2img.py
│ │ │ ├── test_stable_diffusion_xl_inpaint.py
│ │ │ └── test_stable_diffusion_xl_instruction_pix2pix.py
│ │ ├── stable_unclip/
│ │ │ ├── __init__.py
│ │ │ ├── test_stable_unclip.py
│ │ │ └── test_stable_unclip_img2img.py
│ │ ├── stable_video_diffusion/
│ │ │ ├── __init__.py
│ │ │ └── test_stable_video_diffusion.py
│ │ ├── test_pipeline_utils.py
│ │ ├── test_pipelines.py
│ │ ├── test_pipelines_auto.py
│ │ ├── test_pipelines_combined.py
│ │ ├── test_pipelines_common.py
│ │ ├── test_pipelines_onnx_common.py
│ │ ├── visualcloze/
│ │ │ ├── __init__.py
│ │ │ ├── test_pipeline_visualcloze_combined.py
│ │ │ └── test_pipeline_visualcloze_generation.py
│ │ ├── wan/
│ │ │ ├── __init__.py
│ │ │ ├── test_wan.py
│ │ │ ├── test_wan_22.py
│ │ │ ├── test_wan_22_image_to_video.py
│ │ │ ├── test_wan_animate.py
│ │ │ ├── test_wan_image_to_video.py
│ │ │ ├── test_wan_vace.py
│ │ │ └── test_wan_video_to_video.py
│ │ └── z_image/
│ │ ├── __init__.py
│ │ ├── test_z_image.py
│ │ ├── test_z_image_img2img.py
│ │ └── test_z_image_inpaint.py
│ ├── quantization/
│ │ ├── __init__.py
│ │ ├── bnb/
│ │ │ ├── README.md
│ │ │ ├── __init__.py
│ │ │ ├── test_4bit.py
│ │ │ └── test_mixed_int8.py
│ │ ├── gguf/
│ │ │ ├── __init__.py
│ │ │ └── test_gguf.py
│ │ ├── modelopt/
│ │ │ ├── __init__.py
│ │ │ └── test_modelopt.py
│ │ ├── quanto/
│ │ │ ├── __init__.py
│ │ │ └── test_quanto.py
│ │ ├── test_pipeline_level_quantization.py
│ │ ├── test_torch_compile_utils.py
│ │ ├── torchao/
│ │ │ ├── README.md
│ │ │ ├── __init__.py
│ │ │ └── test_torchao.py
│ │ └── utils.py
│ ├── remote/
│ │ ├── __init__.py
│ │ ├── test_remote_decode.py
│ │ └── test_remote_encode.py
│ ├── schedulers/
│ │ ├── __init__.py
│ │ ├── test_scheduler_consistency_model.py
│ │ ├── test_scheduler_ddim.py
│ │ ├── test_scheduler_ddim_inverse.py
│ │ ├── test_scheduler_ddim_parallel.py
│ │ ├── test_scheduler_ddpm.py
│ │ ├── test_scheduler_ddpm_parallel.py
│ │ ├── test_scheduler_deis.py
│ │ ├── test_scheduler_dpm_multi.py
│ │ ├── test_scheduler_dpm_multi_inverse.py
│ │ ├── test_scheduler_dpm_sde.py
│ │ ├── test_scheduler_dpm_single.py
│ │ ├── test_scheduler_edm_dpmsolver_multistep.py
│ │ ├── test_scheduler_edm_euler.py
│ │ ├── test_scheduler_euler.py
│ │ ├── test_scheduler_euler_ancestral.py
│ │ ├── test_scheduler_heun.py
│ │ ├── test_scheduler_ipndm.py
│ │ ├── test_scheduler_kdpm2_ancestral.py
│ │ ├── test_scheduler_kdpm2_discrete.py
│ │ ├── test_scheduler_lcm.py
│ │ ├── test_scheduler_lms.py
│ │ ├── test_scheduler_pndm.py
│ │ ├── test_scheduler_sasolver.py
│ │ ├── test_scheduler_score_sde_ve.py
│ │ ├── test_scheduler_tcd.py
│ │ ├── test_scheduler_unclip.py
│ │ ├── test_scheduler_unipc.py
│ │ ├── test_scheduler_vq_diffusion.py
│ │ └── test_schedulers.py
│ ├── single_file/
│ │ ├── __init__.py
│ │ ├── single_file_testing_utils.py
│ │ ├── test_lumina2_transformer.py
│ │ ├── test_model_autoencoder_dc_single_file.py
│ │ ├── test_model_controlnet_single_file.py
│ │ ├── test_model_flux_transformer_single_file.py
│ │ ├── test_model_motion_adapter_single_file.py
│ │ ├── test_model_sd_cascade_unet_single_file.py
│ │ ├── test_model_vae_single_file.py
│ │ ├── test_model_wan_autoencoder_single_file.py
│ │ ├── test_model_wan_transformer3d_single_file.py
│ │ ├── test_sana_transformer.py
│ │ ├── test_stable_diffusion_controlnet_img2img_single_file.py
│ │ ├── test_stable_diffusion_controlnet_inpaint_single_file.py
│ │ ├── test_stable_diffusion_controlnet_single_file.py
│ │ ├── test_stable_diffusion_img2img_single_file.py
│ │ ├── test_stable_diffusion_inpaint_single_file.py
│ │ ├── test_stable_diffusion_single_file.py
│ │ ├── test_stable_diffusion_upscale_single_file.py
│ │ ├── test_stable_diffusion_xl_adapter_single_file.py
│ │ ├── test_stable_diffusion_xl_controlnet_single_file.py
│ │ ├── test_stable_diffusion_xl_img2img_single_file.py
│ │ ├── test_stable_diffusion_xl_instruct_pix2pix.py
│ │ └── test_stable_diffusion_xl_single_file.py
│ └── testing_utils.py
└── utils/
├── check_config_docstrings.py
├── check_copies.py
├── check_doc_toc.py
├── check_dummies.py
├── check_inits.py
├── check_repo.py
├── check_support_list.py
├── check_table.py
├── consolidated_test_report.py
├── custom_init_isort.py
├── extract_tests_from_mixin.py
├── fetch_latest_release_branch.py
├── fetch_torch_cuda_pipeline_test_matrix.py
├── generate_model_tests.py
├── get_modified_files.py
├── log_reports.py
├── modular_auto_docstring.py
├── notify_benchmarking_status.py
├── notify_community_pipelines_mirror.py
├── notify_slack_about_release.py
├── overwrite_expected_slice.py
├── print_env.py
├── release.py
├── stale.py
├── tests_fetcher.py
└── update_metadata.py
Showing preview only (343K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (4166 symbols across 293 files)
FILE: benchmarks/benchmarking_flux.py
function get_input_dict (line 14) | def get_input_dict(**device_dtype_kwargs):
FILE: benchmarks/benchmarking_ltx.py
function get_input_dict (line 14) | def get_input_dict(**device_dtype_kwargs):
FILE: benchmarks/benchmarking_sdxl.py
function get_input_dict (line 14) | def get_input_dict(**device_dtype_kwargs):
FILE: benchmarks/benchmarking_utils.py
function benchmark_fn (line 25) | def benchmark_fn(f, *args, **kwargs):
function flush (line 34) | def flush():
function calculate_flops (line 42) | def calculate_flops(model, input_dict):
function calculate_params (line 71) | def calculate_params(model):
function model_init_fn (line 77) | def model_init_fn(model_cls, group_offload_kwargs=None, layerwise_upcast...
class BenchmarkScenario (line 91) | class BenchmarkScenario:
class BenchmarkMixin (line 101) | class BenchmarkMixin:
method pre_benchmark (line 102) | def pre_benchmark(self):
method post_benchmark (line 106) | def post_benchmark(self, model):
method run_benchmark (line 112) | def run_benchmark(self, scenario: BenchmarkScenario):
method run_bencmarks_and_collate (line 179) | def run_bencmarks_and_collate(self, scenarios: BenchmarkScenario | lis...
method _run_phase (line 212) | def _run_phase(
FILE: benchmarks/benchmarking_wan.py
function get_input_dict (line 14) | def get_input_dict(**device_dtype_kwargs):
FILE: benchmarks/push_results.py
function has_previous_benchmark (line 11) | def has_previous_benchmark() -> str:
function filter_float (line 22) | def filter_float(value):
function push_to_hf_dataset (line 28) | def push_to_hf_dataset():
FILE: benchmarks/run_all.py
class SubprocessCallException (line 17) | class SubprocessCallException(Exception):
function run_command (line 21) | def run_command(command: list[str], return_stdout=False):
function merge_csvs (line 30) | def merge_csvs(final_csv: str = "collated_results.csv"):
function run_scripts (line 57) | def run_scripts():
FILE: examples/advanced_diffusion_training/test_dreambooth_lora_flux_advanced.py
class DreamBoothLoRAFluxAdvanced (line 38) | class DreamBoothLoRAFluxAdvanced(ExamplesTestsAccelerate):
method test_dreambooth_lora_flux (line 44) | def test_dreambooth_lora_flux(self):
method test_dreambooth_lora_text_encoder_flux (line 76) | def test_dreambooth_lora_text_encoder_flux(self):
method test_dreambooth_lora_pivotal_tuning_flux_clip (line 109) | def test_dreambooth_lora_pivotal_tuning_flux_clip(self):
method test_dreambooth_lora_pivotal_tuning_flux_clip_t5 (line 151) | def test_dreambooth_lora_pivotal_tuning_flux_clip_t5(self):
method test_dreambooth_lora_latent_caching (line 194) | def test_dreambooth_lora_latent_caching(self):
method test_dreambooth_lora_flux_checkpointing_checkpoints_total_limit (line 227) | def test_dreambooth_lora_flux_checkpointing_checkpoints_total_limit(se...
method test_dreambooth_lora_flux_checkpointing_checkpoints_total_limit_removes_multiple_checkpoints (line 250) | def test_dreambooth_lora_flux_checkpointing_checkpoints_total_limit_re...
method test_dreambooth_lora_with_metadata (line 288) | def test_dreambooth_lora_with_metadata(self):
FILE: examples/advanced_diffusion_training/train_dreambooth_lora_flux_advanced.py
function save_model_card (line 102) | def save_model_card(
function load_text_encoders (line 223) | def load_text_encoders(class_one, class_two):
function log_validation (line 233) | def log_validation(
function import_model_class_from_model_name_or_path (line 286) | def import_model_class_from_model_name_or_path(
function parse_args (line 305) | def parse_args(input_args=None):
class TokenEmbeddingsHandler (line 867) | class TokenEmbeddingsHandler:
method __init__ (line 868) | def __init__(self, text_encoders, tokenizers):
method initialize_new_tokens (line 877) | def initialize_new_tokens(self, inserting_toks: List[str]):
method save_embeddings (line 936) | def save_embeddings(self, file_path: str):
method dtype (line 955) | def dtype(self):
method device (line 959) | def device(self):
method retract_embeddings (line 963) | def retract_embeddings(self):
class DreamBoothDataset (line 985) | class DreamBoothDataset(Dataset):
method __init__ (line 991) | def __init__(
method __len__ (line 1129) | def __len__(self):
method __getitem__ (line 1132) | def __getitem__(self, index):
function collate_fn (line 1163) | def collate_fn(examples, with_prior_preservation=False):
class PromptDataset (line 1180) | class PromptDataset(Dataset):
method __init__ (line 1183) | def __init__(self, prompt, num_samples):
method __len__ (line 1187) | def __len__(self):
method __getitem__ (line 1190) | def __getitem__(self, index):
function tokenize_prompt (line 1197) | def tokenize_prompt(tokenizer, prompt, max_sequence_length, add_special_...
function _encode_prompt_with_t5 (line 1212) | def _encode_prompt_with_t5(
function _encode_prompt_with_clip (line 1256) | def _encode_prompt_with_clip(
function encode_prompt (line 1300) | def encode_prompt(
function main (line 1339) | def main(args):
FILE: examples/advanced_diffusion_training/train_dreambooth_lora_sd15_advanced.py
function save_model_card (line 96) | def save_model_card(
function import_model_class_from_model_name_or_path (line 227) | def import_model_class_from_model_name_or_path(
function parse_args (line 247) | def parse_args(input_args=None):
class TokenEmbeddingsHandler (line 741) | class TokenEmbeddingsHandler:
method __init__ (line 742) | def __init__(self, text_encoders, tokenizers):
method initialize_new_tokens (line 750) | def initialize_new_tokens(self, inserting_toks: List[str]):
method save_embeddings (line 791) | def save_embeddings(self, file_path: str):
method dtype (line 811) | def dtype(self):
method device (line 815) | def device(self):
method retract_embeddings (line 819) | def retract_embeddings(self):
class DreamBoothDataset (line 840) | class DreamBoothDataset(Dataset):
method __init__ (line 846) | def __init__(
method __len__ (line 961) | def __len__(self):
method __getitem__ (line 964) | def __getitem__(self, index):
function collate_fn (line 999) | def collate_fn(examples, with_prior_preservation=False):
class PromptDataset (line 1016) | class PromptDataset(Dataset):
method __init__ (line 1019) | def __init__(self, prompt, num_samples):
method __len__ (line 1023) | def __len__(self):
method __getitem__ (line 1026) | def __getitem__(self, index):
function tokenize_prompt (line 1033) | def tokenize_prompt(tokenizer, prompt, add_special_tokens=False):
function encode_prompt (line 1047) | def encode_prompt(text_encoders, tokenizers, prompt, text_input_ids_list...
function main (line 1064) | def main(args):
FILE: examples/advanced_diffusion_training/train_dreambooth_lora_sdxl_advanced.py
function determine_scheduler_type (line 103) | def determine_scheduler_type(pretrained_model_name_or_path, revision):
function save_model_card (line 117) | def save_model_card(
function log_validation (line 255) | def log_validation(
function import_model_class_from_model_name_or_path (line 318) | def import_model_class_from_model_name_or_path(
function parse_args (line 338) | def parse_args(input_args=None):
function is_belong_to_blocks (line 873) | def is_belong_to_blocks(key, blocks):
function get_unet_lora_target_modules (line 883) | def get_unet_lora_target_modules(unet, use_blora, target_blocks=None):
class TokenEmbeddingsHandler (line 907) | class TokenEmbeddingsHandler:
method __init__ (line 908) | def __init__(self, text_encoders, tokenizers):
method initialize_new_tokens (line 916) | def initialize_new_tokens(self, inserting_toks: List[str]):
method save_embeddings (line 956) | def save_embeddings(self, file_path: str):
method dtype (line 976) | def dtype(self):
method device (line 980) | def device(self):
method retract_embeddings (line 984) | def retract_embeddings(self):
class DreamBoothDataset (line 1005) | class DreamBoothDataset(Dataset):
method __init__ (line 1011) | def __init__(
method __len__ (line 1186) | def __len__(self):
method __getitem__ (line 1189) | def __getitem__(self, index):
function collate_fn (line 1218) | def collate_fn(examples, with_prior_preservation=False):
class PromptDataset (line 1244) | class PromptDataset(Dataset):
method __init__ (line 1247) | def __init__(self, prompt, num_samples):
method __len__ (line 1251) | def __len__(self):
method __getitem__ (line 1254) | def __getitem__(self, index):
function tokenize_prompt (line 1261) | def tokenize_prompt(tokenizer, prompt, add_special_tokens=False):
function encode_prompt (line 1275) | def encode_prompt(text_encoders, tokenizers, prompt, text_input_ids_list...
function main (line 1306) | def main(args):
FILE: examples/amused/train_amused.py
function parse_args (line 54) | def parse_args():
class InstanceDataRootDataset (line 301) | class InstanceDataRootDataset(Dataset):
method __init__ (line 302) | def __init__(
method __len__ (line 312) | def __len__(self):
method __getitem__ (line 315) | def __getitem__(self, index):
class InstanceDataImageDataset (line 325) | class InstanceDataImageDataset(Dataset):
method __init__ (line 326) | def __init__(
method __len__ (line 335) | def __len__(self):
method __getitem__ (line 340) | def __getitem__(self, index):
class HuggingFaceDataset (line 344) | class HuggingFaceDataset(Dataset):
method __init__ (line 345) | def __init__(
method __len__ (line 361) | def __len__(self):
method __getitem__ (line 364) | def __getitem__(self, index):
function process_image (line 379) | def process_image(image, size):
function tokenize_prompt (line 402) | def tokenize_prompt(tokenizer, prompt):
function encode_prompt (line 412) | def encode_prompt(text_encoder, input_ids):
function main (line 419) | def main(args):
function save_checkpoint (line 946) | def save_checkpoint(args, accelerator, global_step):
FILE: examples/cogvideo/train_cogvideox_image_to_video_lora.py
function get_args (line 69) | def get_args():
class VideoDataset (line 432) | class VideoDataset(Dataset):
method __init__ (line 433) | def __init__(
method __len__ (line 480) | def __len__(self):
method __getitem__ (line 483) | def __getitem__(self, index):
method _load_dataset_from_hub (line 489) | def _load_dataset_from_hub(self):
method _load_dataset_from_local_path (line 533) | def _load_dataset_from_local_path(self):
method _preprocess_data (line 563) | def _preprocess_data(self):
function save_model_card (line 614) | def save_model_card(
function log_validation (line 698) | def log_validation(
function _get_t5_prompt_embeds (line 764) | def _get_t5_prompt_embeds(
function encode_prompt (line 802) | def encode_prompt(
function compute_prompt_embeddings (line 826) | def compute_prompt_embeddings(
function prepare_rotary_positional_embeddings (line 853) | def prepare_rotary_positional_embeddings(
function get_optimizer (line 881) | def get_optimizer(args, params_to_optimize, use_deepspeed: bool = False):
function main (line 961) | def main(args):
FILE: examples/cogvideo/train_cogvideox_lora.py
function get_args (line 60) | def get_args():
class VideoDataset (line 416) | class VideoDataset(Dataset):
method __init__ (line 417) | def __init__(
method __len__ (line 464) | def __len__(self):
method __getitem__ (line 467) | def __getitem__(self, index):
method _load_dataset_from_hub (line 473) | def _load_dataset_from_hub(self):
method _load_dataset_from_local_path (line 517) | def _load_dataset_from_local_path(self):
method _resize_for_rectangle_crop (line 547) | def _resize_for_rectangle_crop(self, arr):
method _preprocess_data (line 579) | def _preprocess_data(self):
function save_model_card (line 635) | def save_model_card(
function log_validation (line 715) | def log_validation(
function _get_t5_prompt_embeds (line 786) | def _get_t5_prompt_embeds(
function encode_prompt (line 824) | def encode_prompt(
function compute_prompt_embeddings (line 848) | def compute_prompt_embeddings(
function prepare_rotary_positional_embeddings (line 875) | def prepare_rotary_positional_embeddings(
function get_optimizer (line 903) | def get_optimizer(args, params_to_optimize, use_deepspeed: bool = False):
function main (line 983) | def main(args):
FILE: examples/cogview4-control/train_control_cogview4.py
function encode_images (line 70) | def encode_images(pixels: torch.Tensor, vae: torch.nn.Module, weight_dty...
function log_validation (line 76) | def log_validation(cogview4_transformer, args, accelerator, weight_dtype...
function save_model_card (line 181) | def save_model_card(repo_id: str, image_logs=None, base_model=str, repo_...
function parse_args (line 228) | def parse_args(input_args=None):
function get_train_dataset (line 603) | def get_train_dataset(args, accelerator):
function prepare_train_dataset (line 658) | def prepare_train_dataset(dataset, accelerator):
function collate_fn (line 696) | def collate_fn(examples):
function main (line 705) | def main(args):
FILE: examples/community/adaptive_mask_inpainting.py
function download_file (line 149) | def download_file(url, output_file, exist_ok: bool):
function generate_video_from_imgs (line 161) | def generate_video_from_imgs(images_save_directory, fps=15.0, delete_dir...
function prepare_mask_and_masked_image (line 205) | def prepare_mask_and_masked_image(image, mask, height, width, return_ima...
class AdaptiveMaskInpaintPipeline (line 322) | class AdaptiveMaskInpaintPipeline(
method __init__ (line 358) | def __init__(
method enable_model_cpu_offload (line 464) | def enable_model_cpu_offload(self, gpu_id=0):
method _encode_prompt (line 493) | def _encode_prompt(
method run_safety_checker (line 655) | def run_safety_checker(self, image, device, dtype):
method prepare_extra_step_kwargs (line 670) | def prepare_extra_step_kwargs(self, generator, eta):
method check_inputs (line 687) | def check_inputs(
method prepare_latents (line 738) | def prepare_latents(
method _encode_vae_image (line 791) | def _encode_vae_image(self, image: torch.Tensor, generator: torch.Gene...
method prepare_mask_latents (line 805) | def prepare_mask_latents(
method get_timesteps (line 847) | def get_timesteps(self, num_inference_steps, strength, device):
method __call__ (line 857) | def __call__(
method decode_to_npuint8_image (line 1251) | def decode_to_npuint8_image(self, latents):
method register_adaptive_mask_settings (line 1259) | def register_adaptive_mask_settings(self):
method register_adaptive_mask_model (line 1288) | def register_adaptive_mask_model(self):
method adapt_mask (line 1308) | def adapt_mask(self, init_image, pred_orig_image, default_mask_image, ...
function seg2bbox (line 1349) | def seg2bbox(seg_mask: np.ndarray):
function merge_bbox (line 1357) | def merge_bbox(bboxes: list):
class PointRendPredictor (line 1371) | class PointRendPredictor:
method __init__ (line 1372) | def __init__(
method merge_mask (line 1408) | def merge_mask(self, masks, scores=None):
method vis_seg_on_img (line 1415) | def vis_seg_on_img(self, image, mask):
method __call__ (line 1423) | def __call__(self, image):
class MaskDilateScheduler (line 1441) | class MaskDilateScheduler:
method __init__ (line 1442) | def __init__(self, max_dilate_num=15, num_inference_steps=50, schedule...
method __call__ (line 1448) | def __call__(self, i):
class ProvokeScheduler (line 1452) | class ProvokeScheduler:
method __init__ (line 1453) | def __init__(self, num_inference_steps=50, schedule=None, is_zero_inde...
method __call__ (line 1465) | def __call__(self, i):
FILE: examples/community/bit_diffusion.py
function decimal_to_bits (line 15) | def decimal_to_bits(x, bits=BITS):
function bits_to_decimal (line 31) | def bits_to_decimal(x, bits=BITS):
function ddim_bit_scheduler_step (line 45) | def ddim_bit_scheduler_step(
function ddpm_bit_scheduler_step (line 135) | def ddpm_bit_scheduler_step(
class BitDiffusion (line 213) | class BitDiffusion(DiffusionPipeline):
method __init__ (line 214) | def __init__(
method __call__ (line 229) | def __call__(
FILE: examples/community/checkpoint_merger.py
class CheckpointMergerPipeline (line 15) | class CheckpointMergerPipeline(DiffusionPipeline):
method __init__ (line 36) | def __init__(self):
method _compare_model_configs (line 40) | def _compare_model_configs(self, dict0, dict1):
method _remove_meta_keys (line 51) | def _remove_meta_keys(self, config_dict: Dict):
method merge (line 62) | def merge(self, pretrained_model_name_or_path_list: List[Union[str, os...
method weighted_sum (line 269) | def weighted_sum(theta0, theta1, theta2, alpha):
method sigmoid (line 274) | def sigmoid(theta0, theta1, theta2, alpha):
method inv_sigmoid (line 280) | def inv_sigmoid(theta0, theta1, theta2, alpha):
method add_difference (line 287) | def add_difference(theta0, theta1, theta2, alpha):
FILE: examples/community/clip_guided_images_mixing_stable_diffusion.py
function preprocess (line 26) | def preprocess(image, w, h):
function slerp (line 44) | def slerp(t, v0, v1, DOT_THRESHOLD=0.9995):
function spherical_dist_loss (line 69) | def spherical_dist_loss(x, y):
function set_requires_grad (line 75) | def set_requires_grad(model, value):
class CLIPGuidedImagesMixingStableDiffusion (line 80) | class CLIPGuidedImagesMixingStableDiffusion(DiffusionPipeline, StableDif...
method __init__ (line 81) | def __init__(
method freeze_vae (line 116) | def freeze_vae(self):
method unfreeze_vae (line 119) | def unfreeze_vae(self):
method freeze_unet (line 122) | def freeze_unet(self):
method unfreeze_unet (line 125) | def unfreeze_unet(self):
method get_timesteps (line 128) | def get_timesteps(self, num_inference_steps, strength, device):
method prepare_latents (line 137) | def prepare_latents(self, image, timestep, batch_size, dtype, device, ...
method get_image_description (line 163) | def get_image_description(self, image):
method get_clip_image_embeddings (line 170) | def get_clip_image_embeddings(self, image, batch_size):
method cond_fn (line 179) | def cond_fn(
method __call__ (line 234) | def __call__(
FILE: examples/community/clip_guided_stable_diffusion.py
class MakeCutouts (line 22) | class MakeCutouts(nn.Module):
method __init__ (line 23) | def __init__(self, cut_size, cut_power=1.0):
method forward (line 29) | def forward(self, pixel_values, num_cutouts):
function spherical_dist_loss (line 43) | def spherical_dist_loss(x, y):
function set_requires_grad (line 49) | def set_requires_grad(model, value):
class CLIPGuidedStableDiffusion (line 54) | class CLIPGuidedStableDiffusion(DiffusionPipeline, StableDiffusionMixin):
method __init__ (line 60) | def __init__(
method freeze_vae (line 92) | def freeze_vae(self):
method unfreeze_vae (line 95) | def unfreeze_vae(self):
method freeze_unet (line 98) | def freeze_unet(self):
method unfreeze_unet (line 101) | def unfreeze_unet(self):
method cond_fn (line 105) | def cond_fn(
method __call__ (line 169) | def __call__(
FILE: examples/community/clip_guided_stable_diffusion_img2img.py
function preprocess (line 78) | def preprocess(image, w, h):
class MakeCutouts (line 96) | class MakeCutouts(nn.Module):
method __init__ (line 97) | def __init__(self, cut_size, cut_power=1.0):
method forward (line 103) | def forward(self, pixel_values, num_cutouts):
function spherical_dist_loss (line 117) | def spherical_dist_loss(x, y):
function set_requires_grad (line 123) | def set_requires_grad(model, value):
class CLIPGuidedStableDiffusion (line 128) | class CLIPGuidedStableDiffusion(DiffusionPipeline, StableDiffusionMixin):
method __init__ (line 134) | def __init__(
method freeze_vae (line 166) | def freeze_vae(self):
method unfreeze_vae (line 169) | def unfreeze_vae(self):
method freeze_unet (line 172) | def freeze_unet(self):
method unfreeze_unet (line 175) | def unfreeze_unet(self):
method get_timesteps (line 178) | def get_timesteps(self, num_inference_steps, strength, device):
method prepare_latents (line 187) | def prepare_latents(self, image, timestep, batch_size, num_images_per_...
method cond_fn (line 240) | def cond_fn(
method __call__ (line 304) | def __call__(
FILE: examples/community/cogvideox_ddim_inversion.py
class DDIMInversionArguments (line 46) | class DDIMInversionArguments(TypedDict):
function get_args (line 65) | def get_args() -> DDIMInversionArguments:
class CogVideoXAttnProcessor2_0ForDDIMInversion (line 92) | class CogVideoXAttnProcessor2_0ForDDIMInversion(CogVideoXAttnProcessor2_0):
method __init__ (line 93) | def __init__(self):
method calculate_attention (line 96) | def calculate_attention(
method __call__ (line 169) | def __call__(
class OverrideAttnProcessors (line 243) | class OverrideAttnProcessors:
method __init__ (line 263) | def __init__(self, transformer: CogVideoXTransformer3DModel):
method __enter__ (line 267) | def __enter__(self):
method __exit__ (line 273) | def __exit__(self, _0, _1, _2):
function get_video_frames (line 279) | def get_video_frames(
class CogVideoXDDIMInversionOutput (line 340) | class CogVideoXDDIMInversionOutput:
method __init__ (line 344) | def __init__(self, inverse_latents: torch.FloatTensor, recon_latents: ...
class CogVideoXPipelineForDDIMInversion (line 349) | class CogVideoXPipelineForDDIMInversion(CogVideoXPipeline):
method __init__ (line 350) | def __init__(
method encode_video_frames (line 367) | def encode_video_frames(self, video_frames: torch.FloatTensor) -> torc...
method export_latents_to_video (line 389) | def export_latents_to_video(self, latents: torch.FloatTensor, video_pa...
method sample (line 406) | def sample(
method __call__ (line 561) | def __call__(
FILE: examples/community/composable_stable_diffusion.py
class ComposableStableDiffusionPipeline (line 42) | class ComposableStableDiffusionPipeline(DiffusionPipeline, StableDiffusi...
method __init__ (line 72) | def __init__(
method _encode_prompt (line 172) | def _encode_prompt(self, prompt, device, num_images_per_prompt, do_cla...
method run_safety_checker (line 277) | def run_safety_checker(self, image, device, dtype):
method decode_latents (line 287) | def decode_latents(self, latents):
method prepare_extra_step_kwargs (line 295) | def prepare_extra_step_kwargs(self, generator, eta):
method check_inputs (line 312) | def check_inputs(self, prompt, height, width, callback_steps):
method prepare_latents (line 327) | def prepare_latents(self, batch_size, num_channels_latents, height, wi...
method __call__ (line 350) | def __call__(
FILE: examples/community/ddim_noise_comparative_analysis.py
function preprocess (line 35) | def preprocess(image):
class DDIMNoiseComparativeAnalysisPipeline (line 46) | class DDIMNoiseComparativeAnalysisPipeline(DiffusionPipeline):
method __init__ (line 58) | def __init__(self, unet, scheduler):
method check_inputs (line 66) | def check_inputs(self, strength):
method get_timesteps (line 70) | def get_timesteps(self, num_inference_steps, strength, device):
method prepare_latents (line 79) | def prepare_latents(self, image, timestep, batch_size, dtype, device, ...
method __call__ (line 104) | def __call__(
FILE: examples/community/dps_pipeline.py
class DPSPipeline (line 27) | class DPSPipeline(DiffusionPipeline):
method __init__ (line 44) | def __init__(self, unet, scheduler):
method __call__ (line 49) | def __call__(
class SuperResolutionOperator (line 167) | class SuperResolutionOperator(nn.Module):
method __init__ (line 168) | def __init__(self, in_shape, scale_factor):
method forward (line 371) | def forward(self, data, **kwargs):
class GaussialBlurOperator (line 375) | class GaussialBlurOperator(nn.Module):
method __init__ (line 376) | def __init__(self, kernel_size, intensity):
method forward (line 421) | def forward(self, data, **kwargs):
method transpose (line 424) | def transpose(self, data, **kwargs):
method get_kernel (line 427) | def get_kernel(self):
function RMSELoss (line 431) | def RMSELoss(yhat, y):
FILE: examples/community/edict_pipeline.py
class EDICTPipeline (line 13) | class EDICTPipeline(DiffusionPipeline):
method __init__ (line 14) | def __init__(
method _encode_prompt (line 39) | def _encode_prompt(
method denoise_mixing_layer (line 71) | def denoise_mixing_layer(self, x: torch.Tensor, y: torch.Tensor):
method noise_mixing_layer (line 77) | def noise_mixing_layer(self, x: torch.Tensor, y: torch.Tensor):
method _get_alpha_and_beta (line 83) | def _get_alpha_and_beta(self, t: torch.Tensor):
method noise_step (line 91) | def noise_step(
method denoise_step (line 110) | def denoise_step(
method decode_latents (line 129) | def decode_latents(self, latents: torch.Tensor):
method prepare_latents (line 136) | def prepare_latents(
method __call__ (line 187) | def __call__(
FILE: examples/community/fresco_v2v.py
function clear_cache (line 52) | def clear_cache():
function coords_grid (line 57) | def coords_grid(b, h, w, homogeneous=False, device=None):
function bilinear_sample (line 76) | def bilinear_sample(img, sample_coords, mode="bilinear", padding_mode="z...
class Dilate (line 100) | class Dilate:
method __init__ (line 101) | def __init__(self, kernel_size=7, channels=1, device="cpu"):
method __call__ (line 110) | def __call__(self, x):
function flow_warp (line 115) | def flow_warp(feature, flow, mask=False, mode="bilinear", padding_mode="...
function forward_backward_consistency_check (line 124) | def forward_backward_consistency_check(fwd_flow, bwd_flow, alpha=0.01, b...
function numpy2tensor (line 146) | def numpy2tensor(img):
function calc_mean_std (line 153) | def calc_mean_std(feat, eps=1e-5, chunk=1):
function adaptive_instance_normalization (line 165) | def adaptive_instance_normalization(content_feat, style_feat, chunk=1):
function optimize_feature (line 175) | def optimize_feature(
function warp_tensor (line 263) | def warp_tensor(sample, flows, occs, saliency, unet_chunk_size):
function my_forward (line 300) | def my_forward(
function get_single_mapping_ind (line 642) | def get_single_mapping_ind(bwd_flow, bwd_occ, imgs, scale=1.0):
function get_mapping_ind (line 698) | def get_mapping_ind(bwd_flows, bwd_occs, imgs, scale=1.0):
function apply_FRESCO_opt (line 737) | def apply_FRESCO_opt(
function get_intraframe_paras (line 758) | def get_intraframe_paras(pipe, imgs, frescoProc, prompt_embeds, do_class...
function get_flow_and_interframe_paras (line 807) | def get_flow_and_interframe_paras(flow_model, imgs):
class AttentionControl (line 864) | class AttentionControl:
method __init__ (line 873) | def __init__(self):
method get_empty_store (line 887) | def get_empty_store():
method clear_store (line 892) | def clear_store(self):
method enable_store (line 900) | def enable_store(self):
method disable_store (line 903) | def disable_store(self):
method enable_intraattn (line 907) | def enable_intraattn(self):
method disable_intraattn (line 914) | def disable_intraattn(self):
method disable_cfattn (line 919) | def disable_cfattn(self):
method enable_cfattn (line 923) | def enable_cfattn(self, attn_mask=None):
method disable_interattn (line 937) | def disable_interattn(self):
method enable_interattn (line 941) | def enable_interattn(self, interattn_paras=None):
method disable_controller (line 955) | def disable_controller(self):
method enable_controller (line 960) | def enable_controller(self, interattn_paras=None, attn_mask=None):
method forward (line 965) | def forward(self, context):
method __call__ (line 977) | def __call__(self, context):
class FRESCOAttnProcessor2_0 (line 982) | class FRESCOAttnProcessor2_0:
method __init__ (line 1003) | def __init__(self, unet_chunk_size=2, controller=None):
method __call__ (line 1009) | def __call__(
function apply_FRESCO_attn (line 1194) | def apply_FRESCO_attn(pipe):
function retrieve_latents (line 1210) | def retrieve_latents(
function prepare_image (line 1223) | def prepare_image(image):
class FrescoV2VPipeline (line 1247) | class FrescoV2VPipeline(StableDiffusionControlNetImg2ImgPipeline):
method __init__ (line 1290) | def __init__(
method _encode_prompt (line 1384) | def _encode_prompt(
method encode_prompt (line 1417) | def encode_prompt(
method encode_image (line 1599) | def encode_image(self, image, device, num_images_per_prompt, output_hi...
method prepare_ip_adapter_image_embeds (line 1624) | def prepare_ip_adapter_image_embeds(
method run_safety_checker (line 1676) | def run_safety_checker(self, image, device, dtype):
method decode_latents (line 1691) | def decode_latents(self, latents):
method prepare_extra_step_kwargs (line 1703) | def prepare_extra_step_kwargs(self, generator, eta):
method check_inputs (line 1720) | def check_inputs(
method check_image (line 1878) | def check_image(self, image, prompt, prompt_embeds):
method prepare_control_image (line 1916) | def prepare_control_image(
method get_timesteps (line 1947) | def get_timesteps(self, num_inference_steps, strength, device):
method prepare_latents (line 1959) | def prepare_latents(
method guidance_scale (line 2025) | def guidance_scale(self):
method clip_skip (line 2029) | def clip_skip(self):
method do_classifier_free_guidance (line 2036) | def do_classifier_free_guidance(self):
method cross_attention_kwargs (line 2040) | def cross_attention_kwargs(self):
method num_timesteps (line 2044) | def num_timesteps(self):
method __call__ (line 2048) | def __call__(
FILE: examples/community/gluegen.py
class TranslatorBase (line 29) | class TranslatorBase(nn.Module):
method __init__ (line 30) | def __init__(self, num_tok, dim, dim_out, mult=2):
method forward (line 58) | def forward(self, x):
class TranslatorBaseNoLN (line 78) | class TranslatorBaseNoLN(nn.Module):
method __init__ (line 79) | def __init__(self, num_tok, dim, dim_out, mult=2):
method forward (line 101) | def forward(self, x):
class TranslatorNoLN (line 121) | class TranslatorNoLN(nn.Module):
method __init__ (line 122) | def __init__(self, num_tok, dim, dim_out, mult=2, depth=5):
method forward (line 130) | def forward(self, x):
function rescale_noise_cfg (line 139) | def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0):
function retrieve_timesteps (line 153) | def retrieve_timesteps(
class GlueGenStableDiffusionPipeline (line 197) | class GlueGenStableDiffusionPipeline(DiffusionPipeline, StableDiffusionM...
method __init__ (line 198) | def __init__(
method load_language_adapter (line 228) | def load_language_adapter(
method _adapt_language (line 245) | def _adapt_language(self, prompt_embeds: torch.Tensor):
method encode_prompt (line 250) | def encode_prompt(
method run_safety_checker (line 433) | def run_safety_checker(self, image, device, dtype):
method prepare_extra_step_kwargs (line 447) | def prepare_extra_step_kwargs(self, generator, eta):
method check_inputs (line 464) | def check_inputs(
method prepare_latents (line 502) | def prepare_latents(self, batch_size, num_channels_latents, height, wi...
method get_guidance_scale_embedding (line 525) | def get_guidance_scale_embedding(self, w, embedding_dim=512, dtype=tor...
method guidance_scale (line 554) | def guidance_scale(self):
method guidance_rescale (line 558) | def guidance_rescale(self):
method clip_skip (line 562) | def clip_skip(self):
method do_classifier_free_guidance (line 569) | def do_classifier_free_guidance(self):
method cross_attention_kwargs (line 573) | def cross_attention_kwargs(self):
method num_timesteps (line 577) | def num_timesteps(self):
method interrupt (line 581) | def interrupt(self):
method __call__ (line 585) | def __call__(
FILE: examples/community/hd_painter.py
class RASGAttnProcessor (line 20) | class RASGAttnProcessor:
method __init__ (line 21) | def __init__(self, mask, token_idx, scale_factor):
method __call__ (line 28) | def __call__(
class PAIntAAttnProcessor (line 100) | class PAIntAAttnProcessor:
method __init__ (line 101) | def __init__(self, transformer_block, mask, token_idx, do_classifier_f...
method __call__ (line 111) | def __call__(
class StableDiffusionHDPainterPipeline (line 401) | class StableDiffusionHDPainterPipeline(StableDiffusionInpaintPipeline):
method get_tokenized_prompt (line 402) | def get_tokenized_prompt(self, prompt):
method init_attn_processors (line 406) | def init_attn_processors(
method __call__ (line 452) | def __call__(
class GaussianSmoothing (line 896) | class GaussianSmoothing(nn.Module):
method __init__ (line 913) | def __init__(self, channels, kernel_size, sigma, dim=2):
method forward (line 947) | def forward(self, input):
function get_attention_scores (line 962) | def get_attention_scores(
FILE: examples/community/iadb.py
class IADBScheduler (line 11) | class IADBScheduler(SchedulerMixin, ConfigMixin):
method step (line 18) | def step(
method set_timesteps (line 51) | def set_timesteps(self, num_inference_steps: int):
method add_noise (line 54) | def add_noise(
method __len__ (line 62) | def __len__(self):
class IADBPipeline (line 66) | class IADBPipeline(DiffusionPipeline):
method __init__ (line 78) | def __init__(self, unet, scheduler):
method __call__ (line 84) | def __call__(
FILE: examples/community/imagic_stable_diffusion.py
function preprocess (line 51) | def preprocess(image):
class ImagicStableDiffusionPipeline (line 61) | class ImagicStableDiffusionPipeline(DiffusionPipeline, StableDiffusionMi...
method __init__ (line 89) | def __init__(
method train (line 110) | def train(
method __call__ (line 311) | def __call__(
FILE: examples/community/img2img_inpainting.py
function prepare_mask_and_masked_image (line 21) | def prepare_mask_and_masked_image(image, mask):
function check_size (line 38) | def check_size(image, height, width):
function overlay_inner_image (line 48) | def overlay_inner_image(image, inner_image, paste_offset: Tuple[int, ......
class ImageToImageInpaintingPipeline (line 58) | class ImageToImageInpaintingPipeline(DiffusionPipeline):
method __init__ (line 86) | def __init__(
method __call__ (line 133) | def __call__(
FILE: examples/community/instaflow_one_step.py
function rescale_noise_cfg (line 41) | def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0):
class InstaFlowPipeline (line 55) | class InstaFlowPipeline(
method __init__ (line 99) | def __init__(
method _encode_prompt (line 193) | def _encode_prompt(
method encode_prompt (line 223) | def encode_prompt(
method run_safety_checker (line 382) | def run_safety_checker(self, image, device, dtype):
method decode_latents (line 396) | def decode_latents(self, latents):
method merge_dW_to_unet (line 407) | def merge_dW_to_unet(pipe, dW_dict, alpha=1.0):
method prepare_extra_step_kwargs (line 414) | def prepare_extra_step_kwargs(self, generator, eta):
method check_inputs (line 431) | def check_inputs(
method prepare_latents (line 478) | def prepare_latents(self, batch_size, num_channels_latents, height, wi...
method __call__ (line 501) | def __call__(
FILE: examples/community/interpolate_stable_diffusion.py
function slerp (line 22) | def slerp(t, v0, v1, DOT_THRESHOLD=0.9995):
class StableDiffusionWalkPipeline (line 49) | class StableDiffusionWalkPipeline(DiffusionPipeline, StableDiffusionMixin):
method __init__ (line 77) | def __init__(
method __call__ (line 124) | def __call__(
method embed_text (line 377) | def embed_text(self, text):
method get_noise (line 390) | def get_noise(self, seed, dtype=torch.float32, height=512, width=512):
method walk (line 399) | def walk(
FILE: examples/community/ip_adapter_face_id.py
class IPAdapterFullImageProjection (line 60) | class IPAdapterFullImageProjection(nn.Module):
method __init__ (line 61) | def __init__(self, image_embed_dim=1024, cross_attention_dim=1024, mul...
method forward (line 70) | def forward(self, image_embeds: torch.Tensor):
function rescale_noise_cfg (line 76) | def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0):
function retrieve_timesteps (line 90) | def retrieve_timesteps(
class IPAdapterFaceIDStableDiffusionPipeline (line 134) | class IPAdapterFaceIDStableDiffusionPipeline(
method __init__ (line 180) | def __init__(
method load_ip_adapter_face_id (line 276) | def load_ip_adapter_face_id(self, pretrained_model_name_or_path_or_dic...
method convert_ip_adapter_image_proj_to_diffusers (line 310) | def convert_ip_adapter_image_proj_to_diffusers(self, state_dict):
method _load_ip_adapter_weights (line 334) | def _load_ip_adapter_weights(self, state_dict):
method set_ip_adapter_scale (line 446) | def set_ip_adapter_scale(self, scale):
method _encode_prompt (line 452) | def _encode_prompt(
method encode_prompt (line 484) | def encode_prompt(
method run_safety_checker (line 665) | def run_safety_checker(self, image, device, dtype):
method decode_latents (line 679) | def decode_latents(self, latents):
method prepare_extra_step_kwargs (line 690) | def prepare_extra_step_kwargs(self, generator, eta):
method check_inputs (line 707) | def check_inputs(
method prepare_latents (line 759) | def prepare_latents(self, batch_size, num_channels_latents, height, wi...
method get_guidance_scale_embedding (line 782) | def get_guidance_scale_embedding(self, w, embedding_dim=512, dtype=tor...
method guidance_scale (line 811) | def guidance_scale(self):
method guidance_rescale (line 815) | def guidance_rescale(self):
method clip_skip (line 819) | def clip_skip(self):
method do_classifier_free_guidance (line 826) | def do_classifier_free_guidance(self):
method cross_attention_kwargs (line 830) | def cross_attention_kwargs(self):
method num_timesteps (line 834) | def num_timesteps(self):
method interrupt (line 838) | def interrupt(self):
method __call__ (line 842) | def __call__(
FILE: examples/community/kohya_hires_fix.py
class UNet2DConditionModelHighResFix (line 35) | class UNet2DConditionModelHighResFix(UNet2DConditionModel):
method __init__ (line 49) | def __init__(self, high_res_fix: List[Dict] = [{"timestep": 600, "scal...
method _resize (line 55) | def _resize(cls, sample, target=None, scale_factor=1, mode="bicubic"):
method forward (line 68) | def forward(
method from_unet (line 361) | def from_unet(cls, unet: UNet2DConditionModel, high_res_fix: list):
class StableDiffusionHighResFixPipeline (line 390) | class StableDiffusionHighResFixPipeline(StableDiffusionPipeline):
method __init__ (line 430) | def __init__(
FILE: examples/community/latent_consistency_img2img.py
class LatentConsistencyModelImg2ImgPipeline (line 39) | class LatentConsistencyModelImg2ImgPipeline(DiffusionPipeline):
method __init__ (line 42) | def __init__(
method _encode_prompt (line 75) | def _encode_prompt(
method run_safety_checker (line 153) | def run_safety_checker(self, image, device, dtype):
method prepare_latents (line 167) | def prepare_latents(
method get_w_embedding (line 243) | def get_w_embedding(self, w, embedding_dim=512, dtype=torch.float32):
method get_timesteps (line 266) | def get_timesteps(self, num_inference_steps, strength, device):
method __call__ (line 276) | def __call__(
class LCMSchedulerOutput (line 394) | class LCMSchedulerOutput(BaseOutput):
function betas_for_alpha_bar (line 411) | def betas_for_alpha_bar(
function rescale_zero_terminal_snr (line 451) | def rescale_zero_terminal_snr(betas):
class LCMSchedulerWithTimestamp (line 484) | class LCMSchedulerWithTimestamp(SchedulerMixin, ConfigMixin):
method __init__ (line 539) | def __init__(
method scale_model_input (line 590) | def scale_model_input(self, sample: torch.Tensor, timestep: Optional[i...
method _get_variance (line 605) | def _get_variance(self, timestep, prev_timestep):
method _threshold_sample (line 616) | def _threshold_sample(self, sample: torch.Tensor) -> torch.Tensor:
method set_timesteps (line 649) | def set_timesteps(
method get_scalings_for_boundary_condition_discrete (line 678) | def get_scalings_for_boundary_condition_discrete(self, t):
method step (line 686) | def step(
method add_noise (line 778) | def add_noise(
method get_velocity (line 802) | def get_velocity(self, sample: torch.Tensor, noise: torch.Tensor, time...
method __len__ (line 820) | def __len__(self):
FILE: examples/community/latent_consistency_interpolate.py
function lerp (line 76) | def lerp(
function slerp (line 126) | def slerp(
class LatentConsistencyModelWalkPipeline (line 192) | class LatentConsistencyModelWalkPipeline(
method __init__ (line 238) | def __init__(
method encode_prompt (line 281) | def encode_prompt(
method run_safety_checker (line 463) | def run_safety_checker(self, image, device, dtype):
method prepare_latents (line 478) | def prepare_latents(self, batch_size, num_channels_latents, height, wi...
method get_guidance_scale_embedding (line 500) | def get_guidance_scale_embedding(self, w, embedding_dim=512, dtype=tor...
method prepare_extra_step_kwargs (line 529) | def prepare_extra_step_kwargs(self, generator, eta):
method check_inputs (line 547) | def check_inputs(
method interpolate_embedding (line 585) | def interpolate_embedding(
method interpolate_latent (line 616) | def interpolate_latent(
method guidance_scale (line 642) | def guidance_scale(self):
method cross_attention_kwargs (line 646) | def cross_attention_kwargs(self):
method clip_skip (line 650) | def clip_skip(self):
method num_timesteps (line 654) | def num_timesteps(self):
method __call__ (line 659) | def __call__(
FILE: examples/community/latent_consistency_txt2img.py
class LatentConsistencyModelPipeline (line 37) | class LatentConsistencyModelPipeline(DiffusionPipeline):
method __init__ (line 40) | def __init__(
method _encode_prompt (line 73) | def _encode_prompt(
method run_safety_checker (line 151) | def run_safety_checker(self, image, device, dtype):
method prepare_latents (line 165) | def prepare_latents(self, batch_size, num_channels_latents, height, wi...
method get_w_embedding (line 180) | def get_w_embedding(self, w, embedding_dim=512, dtype=torch.float32):
method __call__ (line 204) | def __call__(
class LCMSchedulerOutput (line 309) | class LCMSchedulerOutput(BaseOutput):
function betas_for_alpha_bar (line 326) | def betas_for_alpha_bar(
function rescale_zero_terminal_snr (line 366) | def rescale_zero_terminal_snr(betas):
class LCMScheduler (line 399) | class LCMScheduler(SchedulerMixin, ConfigMixin):
method __init__ (line 451) | def __init__(
method scale_model_input (line 502) | def scale_model_input(self, sample: torch.Tensor, timestep: Optional[i...
method _get_variance (line 517) | def _get_variance(self, timestep, prev_timestep):
method _threshold_sample (line 528) | def _threshold_sample(self, sample: torch.Tensor) -> torch.Tensor:
method set_timesteps (line 561) | def set_timesteps(self, num_inference_steps: int, lcm_origin_steps: in...
method get_scalings_for_boundary_condition_discrete (line 586) | def get_scalings_for_boundary_condition_discrete(self, t):
method step (line 594) | def step(
method add_noise (line 686) | def add_noise(
method get_velocity (line 710) | def get_velocity(self, sample: torch.Tensor, noise: torch.Tensor, time...
method __len__ (line 728) | def __len__(self):
FILE: examples/community/llm_grounded_diffusion.py
function convert_attn_keys (line 128) | def convert_attn_keys(key):
function scale_proportion (line 141) | def scale_proportion(obj_box, H, W):
class AttnProcessorWithHook (line 154) | class AttnProcessorWithHook(AttnProcessor2_0):
method __init__ (line 155) | def __init__(
method __call__ (line 172) | def __call__(
class LLMGroundedDiffusionPipeline (line 275) | class LLMGroundedDiffusionPipeline(
method __init__ (line 324) | def __init__(
method attn_hook (line 425) | def attn_hook(self, name, query, key, value, attention_probs):
method convert_box (line 430) | def convert_box(cls, box, height, width):
method _parse_response_with_negative (line 440) | def _parse_response_with_negative(cls, text):
method parse_llm_response (line 478) | def parse_llm_response(cls, response, canvas_height=512, canvas_width=...
method check_inputs (line 489) | def check_inputs(
method register_attn_hooks (line 547) | def register_attn_hooks(self, unet):
method enable_fuser (line 582) | def enable_fuser(self, enabled=True):
method enable_attn_hook (line 587) | def enable_attn_hook(self, enabled=True):
method get_token_map (line 592) | def get_token_map(self, prompt, padding="do_not_pad", verbose=False):
method get_phrase_indices (line 608) | def get_phrase_indices(
method add_ca_loss_per_attn_map_to_loss (line 657) | def add_ca_loss_per_attn_map_to_loss(
method compute_ca_loss (line 710) | def compute_ca_loss(
method __call__ (line 754) | def __call__(
method latent_lmd_guidance (line 1091) | def latent_lmd_guidance(
method _encode_prompt (line 1199) | def _encode_prompt(
method encode_prompt (line 1232) | def encode_prompt(
method encode_image (line 1416) | def encode_image(self, image, device, num_images_per_prompt):
method run_safety_checker (line 1430) | def run_safety_checker(self, image, device, dtype):
method decode_latents (line 1445) | def decode_latents(self, latents):
method prepare_extra_step_kwargs (line 1457) | def prepare_extra_step_kwargs(self, generator, eta):
method prepare_latents (line 1475) | def prepare_latents(
method get_guidance_scale_embedding (line 1508) | def get_guidance_scale_embedding(self, w, embedding_dim=512, dtype=tor...
method guidance_scale (line 1538) | def guidance_scale(self):
method guidance_rescale (line 1543) | def guidance_rescale(self):
method clip_skip (line 1548) | def clip_skip(self):
method do_classifier_free_guidance (line 1556) | def do_classifier_free_guidance(self):
method cross_attention_kwargs (line 1561) | def cross_attention_kwargs(self):
method num_timesteps (line 1566) | def num_timesteps(self):
FILE: examples/community/lpw_stable_diffusion.py
function parse_prompt_attention (line 55) | def parse_prompt_attention(text):
function get_prompts_with_weights (line 141) | def get_prompts_with_weights(pipe: DiffusionPipeline, prompt: List[str],...
function pad_tokens_and_weights (line 176) | def pad_tokens_and_weights(tokens, weights, max_length, bos, eos, pad, n...
function get_unweighted_text_embeddings (line 201) | def get_unweighted_text_embeddings(
function get_weighted_text_embeddings (line 258) | def get_weighted_text_embeddings(
function preprocess_image (line 406) | def preprocess_image(image, batch_size):
function preprocess_mask (line 416) | def preprocess_mask(mask, batch_size, scale_factor=8):
class StableDiffusionLongPromptWeightingPipeline (line 447) | class StableDiffusionLongPromptWeightingPipeline(
method __init__ (line 486) | def __init__(
method _encode_prompt (line 582) | def _encode_prompt(
method check_inputs (line 663) | def check_inputs(
method get_timesteps (line 714) | def get_timesteps(self, num_inference_steps, strength, device, is_text...
method run_safety_checker (line 726) | def run_safety_checker(self, image, device, dtype):
method decode_latents (line 736) | def decode_latents(self, latents):
method prepare_extra_step_kwargs (line 744) | def prepare_extra_step_kwargs(self, generator, eta):
method prepare_latents (line 761) | def prepare_latents(
method __call__ (line 814) | def __call__(
method text2img (line 1079) | def text2img(
method img2img (line 1198) | def img2img(
method inpaint (line 1310) | def inpaint(
FILE: examples/community/lpw_stable_diffusion_onnx.py
function parse_prompt_attention (line 78) | def parse_prompt_attention(text):
function get_prompts_with_weights (line 164) | def get_prompts_with_weights(pipe, prompt: List[str], max_length: int):
function pad_tokens_and_weights (line 199) | def pad_tokens_and_weights(tokens, weights, max_length, bos, eos, pad, n...
function get_unweighted_text_embeddings (line 224) | def get_unweighted_text_embeddings(
function get_weighted_text_embeddings (line 265) | def get_weighted_text_embeddings(
function preprocess_image (line 407) | def preprocess_image(image):
function preprocess_mask (line 416) | def preprocess_mask(mask, scale_factor=8):
class OnnxStableDiffusionLongPromptWeightingPipeline (line 428) | class OnnxStableDiffusionLongPromptWeightingPipeline(OnnxStableDiffusion...
method __init__ (line 439) | def __init__(
method __init__ (line 466) | def __init__(
method __init__additional__ (line 489) | def __init__additional__(self):
method _encode_prompt (line 493) | def _encode_prompt(
method check_inputs (line 544) | def check_inputs(self, prompt, height, width, strength, callback_steps):
method get_timesteps (line 562) | def get_timesteps(self, num_inference_steps, strength, is_text2img):
method run_safety_checker (line 575) | def run_safety_checker(self, image):
method decode_latents (line 593) | def decode_latents(self, latents):
method prepare_extra_step_kwargs (line 604) | def prepare_extra_step_kwargs(self, generator, eta):
method prepare_latents (line 621) | def prepare_latents(self, image, timestep, batch_size, height, width, ...
method __call__ (line 654) | def __call__(
method text2img (line 870) | def text2img(
method img2img (line 962) | def img2img(
method inpaint (line 1053) | def inpaint(
FILE: examples/community/lpw_stable_diffusion_xl.py
function parse_prompt_attention (line 54) | def parse_prompt_attention(text):
function get_prompts_tokens_with_weights (line 156) | def get_prompts_tokens_with_weights(clip_tokenizer: CLIPTokenizer, promp...
function group_tokens_and_weights (line 206) | def group_tokens_and_weights(token_ids: list, weights: list, pad_last_bl...
function get_weighted_text_embeddings_sdxl (line 258) | def get_weighted_text_embeddings_sdxl(
function rescale_noise_cfg (line 506) | def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0):
function retrieve_latents (line 521) | def retrieve_latents(
function retrieve_timesteps (line 535) | def retrieve_timesteps(
class SDXLLongPromptWeightingPipeline (line 579) | class SDXLLongPromptWeightingPipeline(
method __init__ (line 647) | def __init__(
method enable_model_cpu_offload (line 693) | def enable_model_cpu_offload(self, gpu_id=0):
method encode_prompt (line 724) | def encode_prompt(
method encode_image (line 919) | def encode_image(self, image, device, num_images_per_prompt, output_hi...
method prepare_extra_step_kwargs (line 944) | def prepare_extra_step_kwargs(self, generator, eta):
method check_inputs (line 961) | def check_inputs(
method get_timesteps (line 1044) | def get_timesteps(self, num_inference_steps, strength, device, denoisi...
method prepare_latents (line 1080) | def prepare_latents(
method _encode_vae_image (line 1236) | def _encode_vae_image(self, image: torch.Tensor, generator: torch.Gene...
method prepare_mask_latents (line 1259) | def prepare_mask_latents(
method _get_add_time_ids (line 1312) | def _get_add_time_ids(self, original_size, crops_coords_top_left, targ...
method upcast_vae (line 1329) | def upcast_vae(self):
method get_guidance_scale_embedding (line 1334) | def get_guidance_scale_embedding(self, w, embedding_dim=512, dtype=tor...
method guidance_scale (line 1363) | def guidance_scale(self):
method guidance_rescale (line 1367) | def guidance_rescale(self):
method clip_skip (line 1371) | def clip_skip(self):
method do_classifier_free_guidance (line 1378) | def do_classifier_free_guidance(self):
method cross_attention_kwargs (line 1382) | def cross_attention_kwargs(self):
method denoising_end (line 1386) | def denoising_end(self):
method denoising_start (line 1390) | def denoising_start(self):
method num_timesteps (line 1394) | def num_timesteps(self):
method __call__ (line 1399) | def __call__(
method text2img (line 1955) | def text2img(
method img2img (line 2028) | def img2img(
method inpaint (line 2105) | def inpaint(
method load_lora_weights (line 2187) | def load_lora_weights(self, pretrained_model_name_or_path_or_dict: Uni...
method save_lora_weights (line 2219) | def save_lora_weights(
method _remove_text_encoder_monkey_patch (line 2252) | def _remove_text_encoder_monkey_patch(self):
FILE: examples/community/magic_mix.py
class MagicMixPipeline (line 19) | class MagicMixPipeline(DiffusionPipeline):
method __init__ (line 20) | def __init__(
method encode (line 33) | def encode(self, img):
method decode (line 40) | def decode(self, latent):
method prep_text (line 50) | def prep_text(self, prompt):
method __call__ (line 73) | def __call__(
FILE: examples/community/marigold_depth_estimation.py
class MarigoldDepthOutput (line 49) | class MarigoldDepthOutput(BaseOutput):
function get_pil_resample_method (line 67) | def get_pil_resample_method(method_str: str) -> Resampling:
class MarigoldPipeline (line 80) | class MarigoldPipeline(DiffusionPipeline):
method __init__ (line 104) | def __init__(
method __call__ (line 125) | def __call__(
method _check_inference_step (line 283) | def _check_inference_step(self, n_step: int):
method _encode_empty_text (line 302) | def _encode_empty_text(self):
method single_infer (line 318) | def single_infer(
method encode_rgb (line 394) | def encode_rgb(self, rgb_in: torch.Tensor) -> torch.Tensor:
method decode_depth (line 413) | def decode_depth(self, depth_latent: torch.Tensor) -> torch.Tensor:
method resize_max_res (line 434) | def resize_max_res(img: Image.Image, max_edge_resolution: int, resampl...
method colorize_depth_maps (line 459) | def colorize_depth_maps(depth_map, min_depth, max_depth, cmap="Spectra...
method chw2hwc (line 498) | def chw2hwc(chw):
method _find_batch_size (line 507) | def _find_batch_size(ensemble_size: int, input_res: int, dtype: torch....
method ensemble_depths (line 565) | def ensemble_depths(
FILE: examples/community/masked_stable_diffusion_img2img.py
class MaskedStableDiffusionImg2ImgPipeline (line 11) | class MaskedStableDiffusionImg2ImgPipeline(StableDiffusionImg2ImgPipeline):
method __call__ (line 15) | def __call__(
method _make_latent_mask (line 239) | def _make_latent_mask(self, latents, mask):
FILE: examples/community/masked_stable_diffusion_xl_img2img.py
class MaskedStableDiffusionXLImg2ImgPipeline (line 34) | class MaskedStableDiffusionXLImg2ImgPipeline(StableDiffusionXLImg2ImgPip...
method __call__ (line 38) | def __call__(
method _make_latent_mask (line 523) | def _make_latent_mask(self, latents, mask):
method prepare_latents (line 548) | def prepare_latents(
method random_latents (line 640) | def random_latents(self, batch_size, num_channels_latents, height, wid...
method denormalize (line 657) | def denormalize(self, latents):
method latents_to_img (line 673) | def latents_to_img(self, latents):
method blur_mask (line 679) | def blur_mask(self, pil_mask, blur):
FILE: examples/community/matryoshka.py
function rescale_noise_cfg (line 125) | def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0):
function retrieve_timesteps (line 140) | def retrieve_timesteps(
function _chunked_feed_forward (line 200) | def _chunked_feed_forward(ff: nn.Module, hidden_states: torch.Tensor, ch...
class MatryoshkaDDIMSchedulerOutput (line 216) | class MatryoshkaDDIMSchedulerOutput(BaseOutput):
function betas_for_alpha_bar (line 234) | def betas_for_alpha_bar(
function rescale_zero_terminal_snr (line 279) | def rescale_zero_terminal_snr(betas):
class MatryoshkaDDIMScheduler (line 315) | class MatryoshkaDDIMScheduler(SchedulerMixin, ConfigMixin):
method __init__ (line 368) | def __init__(
method scale_model_input (line 425) | def scale_model_input(self, sample: torch.Tensor, timestep: Optional[i...
method _get_variance (line 442) | def _get_variance(self, timestep, prev_timestep):
method _threshold_sample (line 453) | def _threshold_sample(self, sample: torch.Tensor) -> torch.Tensor:
method set_timesteps (line 486) | def set_timesteps(self, num_inference_steps: int, device: Union[str, t...
method get_schedule_shifted (line 534) | def get_schedule_shifted(self, alpha_prod, scale_factor=None):
method step (line 542) | def step(
method add_noise (line 719) | def add_noise(
method get_velocity (line 746) | def get_velocity(self, sample: torch.Tensor, noise: torch.Tensor, time...
method __len__ (line 765) | def __len__(self):
class CrossAttnDownBlock2D (line 769) | class CrossAttnDownBlock2D(nn.Module):
method __init__ (line 770) | def __init__(
method forward (line 851) | def forward(
class UNetMidBlock2DCrossAttn (line 906) | class UNetMidBlock2DCrossAttn(nn.Module):
method __init__ (line 907) | def __init__(
method forward (line 1000) | def forward(
class CrossAttnUpBlock2D (line 1039) | class CrossAttnUpBlock2D(nn.Module):
method __init__ (line 1040) | def __init__(
method forward (line 1120) | def forward(
class MatryoshkaTransformer2DModelOutput (line 1190) | class MatryoshkaTransformer2DModelOutput(BaseOutput):
class MatryoshkaTransformer2DModel (line 1203) | class MatryoshkaTransformer2DModel(LegacyModelMixin, LegacyConfigMixin):
method __init__ (line 1208) | def __init__(
method forward (line 1236) | def forward(
class MatryoshkaTransformerBlock (line 1345) | class MatryoshkaTransformerBlock(nn.Module):
method __init__ (line 1352) | def __init__(
method set_chunk_feed_forward (line 1416) | def set_chunk_feed_forward(self, chunk_size: Optional[int], dim: int =...
method forward (line 1421) | def forward(
class MatryoshkaFusedAttnProcessor2_0 (line 1472) | class MatryoshkaFusedAttnProcessor2_0:
method __init__ (line 1482) | def __init__(self):
method __call__ (line 1488) | def __call__(
class MatryoshkaFeedForward (line 1571) | class MatryoshkaFeedForward(nn.Module):
method __init__ (line 1577) | def __init__(
method forward (line 1587) | def forward(self, x):
function get_down_block (line 1596) | def get_down_block(
function get_mid_block (line 1678) | def get_mid_block(
function get_up_block (line 1725) | def get_up_block(
class MatryoshkaCombinedTimestepTextEmbedding (line 1810) | class MatryoshkaCombinedTimestepTextEmbedding(nn.Module):
method __init__ (line 1811) | def __init__(self, addition_time_embed_dim, cross_attention_dim, time_...
method forward (line 1820) | def forward(self, emb, encoder_hidden_states, added_cond_kwargs):
class MatryoshkaUNet2DConditionOutput (line 1848) | class MatryoshkaUNet2DConditionOutput(BaseOutput):
class MatryoshkaUNet2DConditionModel (line 1861) | class MatryoshkaUNet2DConditionModel(
method __init__ (line 1961) | def __init__(
method _check_config (line 2300) | def _check_config(
method _set_time_proj (line 2352) | def _set_time_proj(
method _set_encoder_hid_proj (line 2385) | def _set_encoder_hid_proj(
method _set_class_embedding (line 2425) | def _set_class_embedding(
method _set_add_embedding (line 2462) | def _set_add_embedding(
method _set_pos_net_if_use_gligen (line 2513) | def _set_pos_net_if_use_gligen(self, attention_type: str, cross_attent...
method attn_processors (line 2527) | def attn_processors(self) -> dict[str, AttentionProcessor]:
method set_attn_processor (line 2550) | def set_attn_processor(self, processor: Union[AttentionProcessor, Dict...
method set_default_attn_processor (line 2584) | def set_default_attn_processor(self):
method set_attention_slice (line 2599) | def set_attention_slice(self, slice_size: Union[str, int, List[int]] =...
method enable_freeu (line 2664) | def enable_freeu(self, s1: float, s2: float, b1: float, b2: float):
method disable_freeu (line 2688) | def disable_freeu(self):
method fuse_qkv_projections (line 2696) | def fuse_qkv_projections(self):
method unfuse_qkv_projections (line 2718) | def unfuse_qkv_projections(self):
method get_time_embed (line 2728) | def get_time_embed(
method get_class_embed (line 2755) | def get_class_embed(self, sample: torch.Tensor, class_labels: Optional...
method get_aug_embed (line 2771) | def get_aug_embed(
method process_encoder_hidden_states (line 2825) | def process_encoder_hidden_states(
method model_type (line 2862) | def model_type(self) -> str:
method forward (line 2865) | def forward(
class NestedUNet2DConditionOutput (line 3166) | class NestedUNet2DConditionOutput(BaseOutput):
class NestedUNet2DConditionModel (line 3175) | class NestedUNet2DConditionModel(MatryoshkaUNet2DConditionModel):
method __init__ (line 3181) | def __init__(
method model_type (line 3306) | def model_type(self):
method forward (line 3309) | def forward(
class MatryoshkaPipelineOutput (line 3617) | class MatryoshkaPipelineOutput(BaseOutput):
class MatryoshkaPipeline (line 3630) | class MatryoshkaPipeline(
method __init__ (line 3669) | def __init__(
method change_nesting_level (line 3765) | def change_nesting_level(self, nesting_level: int):
method encode_prompt (line 3793) | def encode_prompt(
method encode_image (line 3992) | def encode_image(self, image, device, num_images_per_prompt, output_hi...
method prepare_ip_adapter_image_embeds (line 4016) | def prepare_ip_adapter_image_embeds(
method prepare_extra_step_kwargs (line 4061) | def prepare_extra_step_kwargs(self, generator, eta):
method check_inputs (line 4078) | def check_inputs(
method prepare_latents (line 4147) | def prepare_latents(
method get_guidance_scale_embedding (line 4186) | def get_guidance_scale_embedding(
method guidance_scale (line 4217) | def guidance_scale(self):
method guidance_rescale (line 4221) | def guidance_rescale(self):
method clip_skip (line 4225) | def clip_skip(self):
method do_classifier_free_guidance (line 4232) | def do_classifier_free_guidance(self):
method cross_attention_kwargs (line 4236) | def cross_attention_kwargs(self):
method num_timesteps (line 4240) | def num_timesteps(self):
method interrupt (line 4244) | def interrupt(self):
method __call__ (line 4249) | def __call__(
FILE: examples/community/mixture_canvas.py
function preprocess_image (line 20) | def preprocess_image(image):
class CanvasRegion (line 38) | class CanvasRegion:
method __post_init__ (line 48) | def __post_init__(self):
method width (line 74) | def width(self):
method height (line 78) | def height(self):
method get_region_generator (line 81) | def get_region_generator(self, device="cpu"):
method __dict__ (line 87) | def __dict__(self):
class MaskModes (line 91) | class MaskModes(Enum):
class DiffusionRegion (line 100) | class DiffusionRegion(CanvasRegion):
class Text2ImageRegion (line 107) | class Text2ImageRegion(DiffusionRegion):
method __post_init__ (line 117) | def __post_init__(self):
method tokenize_prompt (line 135) | def tokenize_prompt(self, tokenizer):
method encode_prompt (line 145) | def encode_prompt(self, text_encoder, device):
class Image2ImageRegion (line 154) | class Image2ImageRegion(DiffusionRegion):
method __post_init__ (line 160) | def __post_init__(self):
method encode_reference_image (line 169) | def encode_reference_image(self, encoder, device, generator, cpu_vae=F...
method __dict__ (line 182) | def __dict__(self):
class RerollModes (line 191) | class RerollModes(Enum):
class RerollRegion (line 199) | class RerollRegion(CanvasRegion):
class MaskWeightsBuilder (line 206) | class MaskWeightsBuilder:
method compute_mask_weights (line 212) | def compute_mask_weights(self, region: DiffusionRegion) -> torch.tensor:
method _constant_weights (line 221) | def _constant_weights(self, region: DiffusionRegion) -> torch.tensor:
method _gaussian_weights (line 227) | def _gaussian_weights(self, region: DiffusionRegion) -> torch.tensor:
method _quartic_weights (line 247) | def _quartic_weights(self, region: DiffusionRegion) -> torch.tensor:
class StableDiffusionCanvasPipeline (line 267) | class StableDiffusionCanvasPipeline(DiffusionPipeline, StableDiffusionMi...
method __init__ (line 270) | def __init__(
method decode_latents (line 291) | def decode_latents(self, latents, cpu_vae=False):
method get_latest_timestep_img2img (line 309) | def get_latest_timestep_img2img(self, num_inference_steps, strength):
method __call__ (line 322) | def __call__(
FILE: examples/community/mixture_tiling.py
function _tile2pixel_indices (line 51) | def _tile2pixel_indices(tile_row, tile_col, tile_width, tile_height, til...
function _pixel2latent_indices (line 67) | def _pixel2latent_indices(px_row_init, px_row_end, px_col_init, px_col_e...
function _tile2latent_indices (line 72) | def _tile2latent_indices(tile_row, tile_col, tile_width, tile_height, ti...
function _tile2latent_exclusive_indices (line 87) | def _tile2latent_exclusive_indices(
class StableDiffusionExtrasMixin (line 116) | class StableDiffusionExtrasMixin:
method decode_latents (line 119) | def decode_latents(self, latents, cpu_vae=False):
class StableDiffusionTilingPipeline (line 138) | class StableDiffusionTilingPipeline(DiffusionPipeline, StableDiffusionEx...
method __init__ (line 139) | def __init__(
class SeedTilesMode (line 160) | class SeedTilesMode(Enum):
method __call__ (line 167) | def __call__(
method _gaussian_weights (line 384) | def _gaussian_weights(self, tile_width, tile_height, nbatches):
FILE: examples/community/mixture_tiling_sdxl.py
function _tile2pixel_indices (line 85) | def _tile2pixel_indices(tile_row, tile_col, tile_width, tile_height, til...
function _pixel2latent_indices (line 101) | def _pixel2latent_indices(px_row_init, px_row_end, px_col_init, px_col_e...
function _tile2latent_indices (line 106) | def _tile2latent_indices(tile_row, tile_col, tile_width, tile_height, ti...
function _tile2latent_exclusive_indices (line 121) | def _tile2latent_exclusive_indices(
function _get_crops_coords_list (line 150) | def _get_crops_coords_list(num_rows, num_cols, output_width):
function rescale_noise_cfg (line 196) | def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0):
function retrieve_timesteps (line 223) | def retrieve_timesteps(
class StableDiffusionXLTilingPipeline (line 283) | class StableDiffusionXLTilingPipeline(
method __init__ (line 342) | def __init__(
class SeedTilesMode (line 382) | class SeedTilesMode(Enum):
method encode_prompt (line 388) | def encode_prompt(
method prepare_extra_step_kwargs (line 627) | def prepare_extra_step_kwargs(self, generator, eta):
method check_inputs (line 644) | def check_inputs(self, prompt, height, width, grid_cols, seed_tiles_mo...
method _get_add_time_ids (line 665) | def _get_add_time_ids(
method _gaussian_weights (line 683) | def _gaussian_weights(self, tile_width, tile_height, nbatches, device,...
method upcast_vae (line 708) | def upcast_vae(self):
method get_guidance_scale_embedding (line 713) | def get_guidance_scale_embedding(
method guidance_scale (line 744) | def guidance_scale(self):
method clip_skip (line 748) | def clip_skip(self):
method do_classifier_free_guidance (line 755) | def do_classifier_free_guidance(self):
method cross_attention_kwargs (line 759) | def cross_attention_kwargs(self):
method num_timesteps (line 763) | def num_timesteps(self):
method interrupt (line 767) | def interrupt(self):
method __call__ (line 772) | def __call__(
FILE: examples/community/mod_controlnet_tile_sr_sdxl.py
function _adaptive_tile_size (line 161) | def _adaptive_tile_size(image_size, base_tile_size=512, max_tile_size=12...
function _tile2pixel_indices (line 186) | def _tile2pixel_indices(
function _tile2latent_indices (line 213) | def _tile2latent_indices(
function retrieve_latents (line 245) | def retrieve_latents(
class StableDiffusionXLControlNetTileSRPipeline (line 258) | class StableDiffusionXLControlNetTileSRPipeline(
method __init__ (line 321) | def __init__(
method calculate_overlap (line 368) | def calculate_overlap(self, width, height, base_overlap=128):
class TileWeightingMethod (line 388) | class TileWeightingMethod(Enum):
method encode_prompt (line 395) | def encode_prompt(
method prepare_extra_step_kwargs (line 634) | def prepare_extra_step_kwargs(self, generator, eta):
method check_inputs (line 651) | def check_inputs(
method check_image (line 791) | def check_image(self, image, prompt):
method prepare_control_image (line 827) | def prepare_control_image(
method get_timesteps (line 858) | def get_timesteps(self, num_inference_steps, strength):
method prepare_latents (line 870) | def prepare_latents(
method _get_add_time_ids (line 957) | def _get_add_time_ids(
method _generate_cosine_weights (line 1008) | def _generate_cosine_weights(self, tile_width, tile_height, nbatches, ...
method _generate_gaussian_weights (line 1049) | def _generate_gaussian_weights(self, tile_width, tile_height, nbatches...
method _get_num_tiles (line 1083) | def _get_num_tiles(self, height, width, tile_height, tile_width, norma...
method prepare_tiles (line 1126) | def prepare_tiles(
method upcast_vae (line 1220) | def upcast_vae(self):
method guidance_scale (line 1225) | def guidance_scale(self):
method clip_skip (line 1229) | def clip_skip(self):
method do_classifier_free_guidance (line 1236) | def do_classifier_free_guidance(self):
method cross_attention_kwargs (line 1240) | def cross_attention_kwargs(self):
method num_timesteps (line 1244) | def num_timesteps(self):
method interrupt (line 1248) | def interrupt(self):
method __call__ (line 1253) | def __call__(
FILE: examples/community/multilingual_stable_diffusion.py
function detect_language (line 26) | def detect_language(pipe, prompt, batch_size):
function translate_prompt (line 41) | def translate_prompt(prompt, translation_tokenizer, translation_model, d...
class MultilingualStableDiffusion (line 51) | class MultilingualStableDiffusion(DiffusionPipeline, StableDiffusionMixin):
method __init__ (line 86) | def __init__(
method __call__ (line 139) | def __call__(
FILE: examples/community/one_step_unet.py
class UnetSchedulerOneForwardPipeline (line 7) | class UnetSchedulerOneForwardPipeline(DiffusionPipeline):
method __init__ (line 8) | def __init__(self, unet, scheduler):
method __call__ (line 13) | def __call__(self):
FILE: examples/community/pipeline_animatediff_controlnet.py
function tensor2vid (line 95) | def tensor2vid(video: torch.Tensor, processor, output_type="np"):
class AnimateDiffControlNetPipeline (line 116) | class AnimateDiffControlNetPipeline(
method __init__ (line 155) | def __init__(
method encode_prompt (line 198) | def encode_prompt(
method encode_image (line 380) | def encode_image(self, image, device, num_images_per_prompt, output_hi...
method prepare_ip_adapter_image_embeds (line 405) | def prepare_ip_adapter_image_embeds(
method decode_latents (line 440) | def decode_latents(self, latents):
method prepare_extra_step_kwargs (line 464) | def prepare_extra_step_kwargs(self, generator, eta):
method check_inputs (line 482) | def check_inputs(
method check_image (line 629) | def check_image(self, image, prompt, prompt_embeds):
method prepare_latents (line 667) | def prepare_latents(
method prepare_image (line 693) | def prepare_image(
method guidance_scale (line 724) | def guidance_scale(self):
method clip_skip (line 728) | def clip_skip(self):
method do_classifier_free_guidance (line 735) | def do_classifier_free_guidance(self):
method cross_attention_kwargs (line 739) | def cross_attention_kwargs(self):
method num_timesteps (line 743) | def num_timesteps(self):
method __call__ (line 747) | def __call__(
FILE: examples/community/pipeline_animatediff_img2video.py
function lerp (line 70) | def lerp(
function slerp (line 107) | def slerp(
function tensor2vid (line 162) | def tensor2vid(video: torch.Tensor, processor, output_type="np"):
function retrieve_latents (line 184) | def retrieve_latents(
function retrieve_timesteps (line 198) | def retrieve_timesteps(
class AnimateDiffImgToVideoPipeline (line 242) | class AnimateDiffImgToVideoPipeline(
method __init__ (line 280) | def __init__(
method encode_prompt (line 315) | def encode_prompt(
method encode_image (line 497) | def encode_image(self, image, device, num_images_per_prompt, output_hi...
method prepare_ip_adapter_image_embeds (line 522) | def prepare_ip_adapter_image_embeds(
method decode_latents (line 557) | def decode_latents(self, latents):
method prepare_extra_step_kwargs (line 581) | def prepare_extra_step_kwargs(self, generator, eta):
method check_inputs (line 598) | def check_inputs(
method prepare_latents (line 659) | def prepare_latents(
method __call__ (line 738) | def __call__(
FILE: examples/community/pipeline_animatediff_ipex.py
class AnimateDiffPipelineIpex (line 93) | class AnimateDiffPipelineIpex(
method __init__ (line 133) | def __init__(
method encode_prompt (line 169) | def encode_prompt(
method encode_image (line 352) | def encode_image(self, image, device, num_images_per_prompt, output_hi...
method prepare_ip_adapter_image_embeds (line 377) | def prepare_ip_adapter_image_embeds(
method decode_latents (line 429) | def decode_latents(self, latents):
method prepare_extra_step_kwargs (line 442) | def prepare_extra_step_kwargs(self, generator, eta):
method check_inputs (line 460) | def check_inputs(
method prepare_latents (line 524) | def prepare_latents(
method guidance_scale (line 550) | def guidance_scale(self):
method clip_skip (line 554) | def clip_skip(self):
method do_classifier_free_guidance (line 561) | def do_classifier_free_guidance(self):
method cross_attention_kwargs (line 565) | def cross_attention_kwargs(self):
method num_timesteps (line 569) | def num_timesteps(self):
method __call__ (line 574) | def __call__(
method prepare_for_ipex (line 829) | def prepare_for_ipex(
FILE: examples/community/pipeline_controlnet_xl_kolors.py
function retrieve_latents (line 113) | def retrieve_latents(
class KolorsControlNetPipeline (line 126) | class KolorsControlNetPipeline(
method __init__ (line 189) | def __init__(
method encode_prompt (line 232) | def encode_prompt(
method prepare_ip_adapter_image_embeds (line 400) | def prepare_ip_adapter_image_embeds(
method encode_image (line 433) | def encode_image(self, image, device, num_images_per_prompt, output_hi...
method prepare_extra_step_kwargs (line 458) | def prepare_extra_step_kwargs(self, generator, eta):
method check_inputs (line 475) | def check_inputs(
method check_image (line 632) | def check_image(self, image, prompt, prompt_embeds):
method prepare_control_image (line 670) | def prepare_control_image(
method prepare_latents (line 701) | def prepare_latents(self, batch_size, num_channels_latents, height, wi...
method prepare_latents_t2i (line 719) | def prepare_latents_t2i(
method _get_add_time_ids (line 739) | def _get_add_time_ids(
method upcast_vae (line 758) | def upcast_vae(self):
method guidance_scale (line 763) | def guidance_scale(self):
method do_classifier_free_guidance (line 770) | def do_classifier_free_guidance(self):
method cross_attention_kwargs (line 774) | def cross_attention_kwargs(self):
method num_timesteps (line 778) | def num_timesteps(self):
method __call__ (line 783) | def __call__(
FILE: examples/community/pipeline_controlnet_xl_kolors_img2img.py
function retrieve_latents (line 133) | def retrieve_latents(
class KolorsControlNetImg2ImgPipeline (line 146) | class KolorsControlNetImg2ImgPipeline(
method __init__ (line 210) | def __init__(
method encode_prompt (line 253) | def encode_prompt(
method encode_image (line 430) | def encode_image(self, image, device, num_images_per_prompt, output_hi...
method prepare_ip_adapter_image_embeds (line 455) | def prepare_ip_adapter_image_embeds(
method prepare_extra_step_kwargs (line 501) | def prepare_extra_step_kwargs(self, generator, eta):
method check_inputs (line 518) | def check_inputs(
method check_image (line 707) | def check_image(self, image, prompt, prompt_embeds):
method prepare_control_image (line 745) | def prepare_control_image(
method get_timesteps (line 776) | def get_timesteps(self, num_inference_steps, strength, device):
method prepare_latents (line 788) | def prepare_latents(
method prepare_latents_t2i (line 858) | def prepare_latents_t2i(
method _get_add_time_ids (line 878) | def _get_add_time_ids(
method upcast_vae (line 928) | def upcast_vae(self):
method guidance_scale (line 933) | def guidance_scale(self):
method do_classifier_free_guidance (line 940) | def do_classifier_free_guidance(self):
method cross_attention_kwargs (line 944) | def cross_attention_kwargs(self):
method num_timesteps (line 948) | def num_timesteps(self):
method __call__ (line 953) | def __call__(
FILE: examples/community/pipeline_controlnet_xl_kolors_inpaint.py
function retrieve_latents (line 120) | def retrieve_latents(
function retrieve_timesteps (line 134) | def retrieve_timesteps(
class KolorsControlNetInpaintPipeline (line 193) | class KolorsControlNetInpaintPipeline(
method __init__ (line 259) | def __init__(
method encode_prompt (line 305) | def encode_prompt(
method encode_image (line 480) | def encode_image(self, image, device, num_images_per_prompt, output_hi...
method prepare_ip_adapter_image_embeds (line 505) | def prepare_ip_adapter_image_embeds(
method prepare_extra_step_kwargs (line 552) | def prepare_extra_step_kwargs(self, generator, eta):
method check_inputs (line 569) | def check_inputs(
method check_image (line 758) | def check_image(self, image, prompt, prompt_embeds):
method prepare_control_image (line 796) | def prepare_control_image(
method get_timesteps (line 827) | def get_timesteps(self, num_inference_steps, strength, device, denoisi...
method prepare_latents (line 864) | def prepare_latents(
method prepare_latents_t2i (line 934) | def prepare_latents_t2i(
method _get_add_time_ids (line 954) | def _get_add_time_ids(
method upcast_vae (line 1004) | def upcast_vae(self):
method denoising_end (line 1009) | def denoising_end(self):
method denoising_start (line 1013) | def denoising_start(self):
method guidance_scale (line 1017) | def guidance_scale(self):
method do_classifier_free_guidance (line 1024) | def do_classifier_free_guidance(self):
method cross_attention_kwargs (line 1028) | def cross_attention_kwargs(self):
method num_timesteps (line 1032) | def num_timesteps(self):
method _encode_vae_image (line 1035) | def _encode_vae_image(self, image: torch.Tensor, generator: torch.Gene...
method prepare_mask_latents (line 1058) | def prepare_mask_latents(
method __call__ (line 1113) | def __call__(
FILE: examples/community/pipeline_demofusion_sdxl.py
function gaussian_kernel (line 58) | def gaussian_kernel(kernel_size=3, sigma=1.0, channels=3):
function gaussian_filter (line 68) | def gaussian_filter(latents, kernel_size=3, sigma=1.0):
function rescale_noise_cfg (line 77) | def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0):
class DemoFusionSDXLPipeline (line 91) | class DemoFusionSDXLPipeline(
method __init__ (line 145) | def __init__(
method encode_prompt (line 184) | def encode_prompt(
method prepare_extra_step_kwargs (line 383) | def prepare_extra_step_kwargs(self, generator, eta):
method check_inputs (line 400) | def check_inputs(
method prepare_latents (line 485) | def prepare_latents(self, batch_size, num_channels_latents, height, wi...
method _get_add_time_ids (line 507) | def _get_add_time_ids(self, original_size, crops_coords_top_left, targ...
method get_views (line 523) | def get_views(self, height, width, window_size=128, stride=64, random_...
method tiled_decode (line 573) | def tiled_decode(self, latents, current_height, current_width):
method upcast_vae (line 615) | def upcast_vae(self):
method __call__ (line 621) | def __call__(
method load_lora_weights (line 1279) | def load_lora_weights(self, pretrained_model_name_or_path_or_dict: Uni...
method save_lora_weights (line 1341) | def save_lora_weights(
method _remove_text_encoder_monkey_patch (line 1380) | def _remove_text_encoder_monkey_patch(self):
FILE: examples/community/pipeline_fabric.py
class FabricCrossAttnProcessor (line 57) | class FabricCrossAttnProcessor:
method __init__ (line 58) | def __init__(self):
method __call__ (line 61) | def __call__(
class FabricPipeline (line 118) | class FabricPipeline(DiffusionPipeline):
method __init__ (line 142) | def __init__(
method _encode_prompt (line 190) | def _encode_prompt(
method get_unet_hidden_states (line 351) | def get_unet_hidden_states(self, z_all, t, prompt_embd):
method unet_forward_with_cached_hidden_states (line 374) | def unet_forward_with_cached_hidden_states(
method preprocess_feedback_images (line 458) | def preprocess_feedback_images(self, images, vae, dim, device, dtype, ...
method check_inputs (line 465) | def check_inputs(
method __call__ (line 498) | def __call__(
method image_to_tensor (line 746) | def image_to_tensor(self, image: Union[str, Image.Image], dim: tuple, ...
FILE: examples/community/pipeline_faithdiff_stable_diffusion_xl.py
function zero_module (line 167) | def zero_module(module):
class Encoder (line 174) | class Encoder(nn.Module):
method __init__ (line 177) | def __init__(
method to_rgb_init (line 251) | def to_rgb_init(self):
method enable_tiling (line 259) | def enable_tiling(self):
method encode (line 263) | def encode(self, sample: torch.FloatTensor) -> torch.FloatTensor:
method blend_v (line 293) | def blend_v(self, a: torch.Tensor, b: torch.Tensor, blend_extent: int)...
method blend_h (line 300) | def blend_h(self, a: torch.Tensor, b: torch.Tensor, blend_extent: int)...
method tiled_encode (line 307) | def tiled_encode(self, x: torch.FloatTensor) -> torch.FloatTensor:
method forward (line 335) | def forward(self, sample: torch.FloatTensor) -> torch.FloatTensor:
class ControlNetConditioningEmbedding (line 344) | class ControlNetConditioningEmbedding(nn.Module):
method __init__ (line 347) | def __init__(self, conditioning_embedding_channels: int, conditioning_...
method forward (line 355) | def forward(self, conditioning):
class QuickGELU (line 364) | class QuickGELU(nn.Module):
method forward (line 367) | def forward(self, x: torch.Tensor):
class LayerNorm (line 372) | class LayerNorm(nn.LayerNorm):
method forward (line 375) | def forward(self, x: torch.Tensor):
class ResidualAttentionBlock (line 382) | class ResidualAttentionBlock(nn.Module):
method __init__ (line 385) | def __init__(self, d_model: int, n_head: int, attn_mask: torch.Tensor ...
method attention (line 401) | def attention(self, x: torch.Tensor):
method forward (line 406) | def forward(self, x: torch.Tensor):
class UNet2DConditionOutput (line 414) | class UNet2DConditionOutput(BaseOutput):
class UNet2DConditionModel (line 420) | class UNet2DConditionModel(OriginalUNet2DConditionModel, ConfigMixin, UN...
method __init__ (line 426) | def __init__(
method init_vae_encoder (line 546) | def init_vae_encoder(self, dtype):
method init_information_transformer_layes (line 551) | def init_information_transformer_layes(self):
method init_ControlNetConditioningEmbedding (line 561) | def init_ControlNetConditioningEmbedding(self, channel=512):
method init_extra_weights (line 564) | def init_extra_weights(self):
method load_additional_layers (line 567) | def load_additional_layers(
method to (line 599) | def to(self, *args, **kwargs):
method load_state_dict (line 613) | def load_state_dict(self, state_dict, strict=True):
method forward (line 649) | def forward(
class LocalAttention (line 881) | class LocalAttention:
method __init__ (line 884) | def __init__(self, kernel_size=None, overlap=0.5):
method grids_list (line 895) | def grids_list(self, x):
method grids (line 941) | def grids(self, x):
method _gaussian_weights (line 989) | def _gaussian_weights(self, tile_width, tile_height):
method grids_inverse (line 1018) | def grids_inverse(self, outs):
method _pad (line 1042) | def _pad(self, x):
method forward (line 1059) | def forward(self, x):
function rescale_noise_cfg (line 1075) | def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0):
function retrieve_latents (line 1098) | def retrieve_latents(
function retrieve_timesteps (line 1122) | def retrieve_timesteps(
class FaithDiffStableDiffusionXLPipeline (line 1166) | class FaithDiffStableDiffusionXLPipeline(
method __init__ (line 1232) | def __init__(
method encode_prompt (line 1267) | def encode_prompt(
method prepare_extra_step_kwargs (line 1502) | def prepare_extra_step_kwargs(self, generator, eta):
method check_image_size (line 1519) | def check_image_size(self, x, padder_size=8):
method check_inputs (line 1537) | def check_inputs(
method prepare_latents (line 1620) | def prepare_latents(self, batch_size, num_channels_latents, height, wi...
method upcast_vae (line 1637) | def upcast_vae(self):
method get_guidance_scale_embedding (line 1642) | def get_guidance_scale_embedding(
method set_encoder_tile_settings (line 1672) | def set_encoder_tile_settings(
method enable_vae_tiling (line 1684) | def enable_vae_tiling(self):
method disable_vae_tiling (line 1699) | def disable_vae_tiling(self):
method guidance_scale (line 1714) | def guidance_scale(self):
method guidance_rescale (line 1718) | def guidance_rescale(self):
method clip_skip (line 1722) | def clip_skip(self):
method do_classifier_free_guidance (line 1729) | def do_classifier_free_guidance(self):
method cross_attention_kwargs (line 1733) | def cross_attention_kwargs(self):
method denoising_end (line 1737) | def denoising_end(self):
method num_timesteps (line 1741) | def num_timesteps(self):
method interrupt (line 1745) | def interrupt(self):
method prepare_image_latents (line 1748) | def prepare_image_latents(
method __call__ (line 1803) | def __call__(
FILE: examples/community/pipeline_flux_differential_img2img.py
function calculate_shift (line 85) | def calculate_shift(
function retrieve_latents (line 99) | def retrieve_latents(
function retrieve_timesteps (line 113) | def retrieve_timesteps(
class FluxDifferentialImg2ImgPipeline (line 172) | class FluxDifferentialImg2ImgPipeline(DiffusionPipeline, FluxLoraLoaderM...
method __init__ (line 203) | def __init__(
method _get_t5_prompt_embeds (line 240) | def _get_t5_prompt_embeds(
method _get_clip_prompt_embeds (line 287) | def _get_clip_prompt_embeds(
method encode_prompt (line 329) | def encode_prompt(
method _encode_vae_image (line 409) | def _encode_vae_image(self, image: torch.Tensor, generator: torch.Gene...
method get_timesteps (line 424) | def get_timesteps(self, num_inference_steps, strength, device):
method check_inputs (line 435) | def check_inputs(
method _prepare_latent_image_ids (line 506) | def _prepare_latent_image_ids(batch_size, height, width, device, dtype):
method _pack_latents (line 521) | def _pack_latents(latents, batch_size, num_channels_latents, height, w...
method _unpack_latents (line 530) | def _unpack_latents(latents, height, width, vae_scale_factor):
method prepare_latents (line 543) | def prepare_latents(
method prepare_mask_latents (line 594) | def prepare_mask_latents(
method guidance_scale (line 665) | def guidance_scale(self):
method joint_attention_kwargs (line 669) | def joint_attention_kwargs(self):
method num_timesteps (line 673) | def num_timesteps(self):
method interrupt (line 677) | def interrupt(self):
method __call__ (line 682) | def __call__(
FILE: examples/community/pipeline_flux_kontext_multiple_images.py
function calculate_shift (line 116) | def calculate_shift(
function retrieve_timesteps (line 130) | def retrieve_timesteps(
function retrieve_latents (line 190) | def retrieve_latents(
class FluxKontextPipeline (line 203) | class FluxKontextPipeline(
method __init__ (line 240) | def __init__(
method _get_t5_prompt_embeds (line 276) | def _get_t5_prompt_embeds(
method _get_clip_prompt_embeds (line 326) | def _get_clip_prompt_embeds(
method encode_prompt (line 371) | def encode_prompt(
method encode_image (line 451) | def encode_image(self, image, device, num_images_per_prompt):
method prepare_ip_adapter_image_embeds (line 463) | def prepare_ip_adapter_image_embeds(
method check_inputs (line 500) | def check_inputs(
method _prepare_latent_image_ids (line 571) | def _prepare_latent_image_ids(batch_size, height, width, device, dtype):
method _pack_latents (line 586) | def _pack_latents(latents, batch_size, num_channels_latents, height, w...
method _unpack_latents (line 595) | def _unpack_latents(latents, height, width, vae_scale_factor):
method _encode_vae_image (line 610) | def _encode_vae_image(self, image: torch.Tensor, generator: torch.Gene...
method enable_vae_slicing (line 625) | def enable_vae_slicing(self):
method disable_vae_slicing (line 633) | def disable_vae_slicing(self):
method enable_vae_tiling (line 641) | def enable_vae_tiling(self):
method disable_vae_tiling (line 656) | def disable_vae_tiling(self):
method preprocess_image (line 669) | def preprocess_image(self, image: PipelineImageInput, _auto_resize: bo...
method preprocess_images (line 684) | def preprocess_images(
method prepare_latents (line 721) | def prepare_latents(
method guidance_scale (line 796) | def guidance_scale(self):
method joint_attention_kwargs (line 800) | def joint_attention_kwargs(self):
method num_timesteps (line 804) | def num_timesteps(self):
method current_timestep (line 808) | def current_timestep(self):
method interrupt (line 812) | def interrupt(self):
method __call__ (line 817) | def __call__(
FILE: examples/community/pipeline_flux_rf_inversion.py
function calculate_shift (line 93) | def calculate_shift(
function retrieve_timesteps (line 107) | def retrieve_timesteps(
class RFInversionFluxPipeline (line 166) | class RFInversionFluxPipeline(
method __init__ (line 202) | def __init__(
method _get_t5_prompt_embeds (line 231) | def _get_t5_prompt_embeds(
method _get_clip_prompt_embeds (line 281) | def _get_clip_prompt_embeds(
method encode_prompt (line 326) | def encode_prompt(
method encode_image (line 407) | def encode_image(self, image, dtype=None, height=None, width=None, res...
method check_inputs (line 426) | def check_inputs(
method _prepare_latent_image_ids (line 490) | def _prepare_latent_image_ids(batch_size, height, width, device, dtype):
method _pack_latents (line 504) | def _pack_latents(latents, batch_size, num_channels_latents, height, w...
method _unpack_latents (line 512) | def _unpack_latents(latents, height, width, vae_scale_factor):
method enable_vae_slicing (line 525) | def enable_vae_slicing(self):
method disable_vae_slicing (line 538) | def disable_vae_slicing(self):
method enable_vae_tiling (line 551) | def enable_vae_tiling(self):
method disable_vae_tiling (line 565) | def disable_vae_tiling(self):
method prepare_latents_inversion (line 578) | def prepare_latents_inversion(
method prepare_latents (line 598) | def prepare_latents(
method get_timesteps (line 634) | def get_timesteps(self, num_inference_steps, strength=1.0):
method guidance_scale (line 647) | def guidance_scale(self):
method joint_attention_kwargs (line 651) | def joint_attention_kwargs(self):
method num_timesteps (line 655) | def num_timesteps(self):
method interrupt (line 659) | def interrupt(self):
method __call__ (line 664) | def __call__(
method invert (line 957) | def invert(
FILE: examples/community/pipeline_flux_semantic_guidance.py
function calculate_shift (line 90) | def calculate_shift(
function retrieve_timesteps (line 104) | def retrieve_timesteps(
class FluxSemanticGuidancePipeline (line 163) | class FluxSemanticGuidancePipeline(
method __init__ (line 200) | def __init__(
method _get_t5_prompt_embeds (line 235) | def _get_t5_prompt_embeds(
method _get_clip_prompt_embeds (line 285) | def _get_clip_prompt_embeds(
method encode_prompt (line 330) | def encode_prompt(
method encode_text_with_editing (line 409) | def encode_text_with_editing(
method encode_image (line 521) | def encode_image(self, image, device, num_images_per_prompt):
method prepare_ip_adapter_image_embeds (line 533) | def prepare_ip_adapter_image_embeds(
method check_inputs (line 565) | def check_inputs(
method _prepare_latent_image_ids (line 644) | def _prepare_latent_image_ids(batch_size, height, width, device, dtype):
method _pack_latents (line 659) | def _pack_latents(latents, batch_size, num_channels_latents, height, w...
method _unpack_latents (line 668) | def _unpack_latents(latents, height, width, vae_scale_factor):
method enable_vae_slicing (line 684) | def enable_vae_slicing(self):
method disable_vae_slicing (line 692) | def disable_vae_slicing(self):
method enable_vae_tiling (line 700) | def enable_vae_tiling(self):
method disable_vae_tiling (line 715) | def disable_vae_tiling(self):
method prepare_latents (line 729) | def prepare_latents(
method guidance_scale (line 765) | def guidance_scale(self):
method joint_attention_kwargs (line 769) | def joint_attention_kwargs(self):
method num_timesteps (line 773) | def num_timesteps(self):
method interrupt (line 777) | def interrupt(self):
method __call__ (line 782) | def __call__(
FILE: examples/community/pipeline_flux_with_cfg.py
function calculate_shift (line 69) | def calculate_shift(
function retrieve_timesteps (line 83) | def retrieve_timesteps(
class FluxCFGPipeline (line 142) | class FluxCFGPipeline(DiffusionPipeline, FluxLoraLoaderMixin, FromSingle...
method __init__ (line 173) | def __init__(
method _get_t5_prompt_embeds (line 201) | def _get_t5_prompt_embeds(
method _get_clip_prompt_embeds (line 247) | def _get_clip_prompt_embeds(
method encode_prompt (line 288) | def encode_prompt(
method check_inputs (line 391) | def check_inputs(
method _prepare_latent_image_ids (line 467) | def _prepare_latent_image_ids(batch_size, height, width, device, dtype):
method _pack_latents (line 481) | def _pack_latents(latents, batch_size, num_channels_latents, height, w...
method _unpack_latents (line 489) | def _unpack_latents(latents, height, width, vae_scale_factor):
method enable_vae_slicing (line 502) | def enable_vae_slicing(self):
method disable_vae_slicing (line 515) | def disable_vae_slicing(self):
method enable_vae_tiling (line 528) | def enable_vae_tiling(self):
method disable_vae_tiling (line 542) | def disable_vae_tiling(self):
method prepare_latents (line 555) | def prepare_latents(
method guidance_scale (line 589) | def guidance_scale(self):
method joint_attention_kwargs (line 593) | def joint_attention_kwargs(self):
method num_timesteps (line 597) | def num_timesteps(self):
method interrupt (line 601) | def interrupt(self):
method __call__ (line 606) | def __call__(
FILE: examples/community/pipeline_hunyuandit_differential_img2img.py
function map_to_standard_shapes (line 121) | def map_to_standard_shapes(target_width, target_height):
function get_resize_crop_region_for_grid (line 129) | def get_resize_crop_region_for_grid(src, tgt_size):
function rescale_noise_cfg (line 150) | def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0):
function retrieve_latents (line 165) | def retrieve_latents(
function retrieve_timesteps (line 181) | def retrieve_timesteps(
class HunyuanDiTDifferentialImg2ImgPipeline (line 240) | class HunyuanDiTDifferentialImg2ImgPipeline(DiffusionPipeline):
method __init__ (line 287) | def __init__(
method encode_prompt (line 345) | def encode_prompt(
method run_safety_checker (line 516) | def run_safety_checker(self, image, device, dtype):
method prepare_extra_step_kwargs (line 531) | def prepare_extra_step_kwargs(self, generator, eta):
method check_inputs (line 548) | def check_inputs(
method get_timesteps (line 624) | def get_timesteps(self, num_inference_steps, strength, device):
method prepare_latents (line 636) | def prepare_latents(
method guidance_scale (line 704) | def guidance_scale(self):
method guidance_rescale (line 708) | def guidance_rescale(self):
method do_classifier_free_guidance (line 715) | def do_classifier_free_guidance(self):
method num_timesteps (line 719) | def num_timesteps(self):
method interrupt (line 723) | def interrupt(self):
method __call__ (line 728) | def __call__(
FILE: examples/community/pipeline_kolors_differential_img2img.py
function retrieve_latents (line 69) | def retrieve_latents(
function retrieve_timesteps (line 83) | def retrieve_timesteps(
class KolorsDifferentialImg2ImgPipeline (line 142) | class KolorsDifferentialImg2ImgPipeline(
method __init__ (line 188) | def __init__(
method encode_prompt (line 225) | def encode_prompt(
method encode_image (line 390) | def encode_image(self, image, device, num_images_per_prompt, output_hi...
method prepare_ip_adapter_image_embeds (line 415) | def prepare_ip_adapter_image_embeds(
method prepare_extra_step_kwargs (line 461) | def prepare_extra_step_kwargs(self, generator, eta):
method check_inputs (line 478) | def check_inputs(
method get_timesteps (line 569) | def get_timesteps(self, num_inference_steps, strength, device, denoisi...
method prepare_latents (line 606) | def prepare_latents(
method _get_add_time_ids (line 693) | def _get_add_time_ids(
method upcast_vae (line 711) | def upcast_vae(self):
method get_guidance_scale_embedding (line 716) | def get_guidance_scale_embedding(
method guidance_scale (line 747) | def guidance_scale(self):
method do_classifier_free_guidance (line 754) | def do_classifier_free_guidance(self):
method cross_attention_kwargs (line 758) | def cross_attention_kwargs(self):
method denoising_start (line 762) | def denoising_start(self):
method denoising_end (line 766) | def denoising_end(self):
method num_timesteps (line 770) | def num_timesteps(self):
method interrupt (line 774) | def interrupt(self):
method __call__ (line 779) | def __call__(
FILE: examples/community/pipeline_kolors_inpainting.py
function rescale_noise_cfg (line 92) | def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0):
function mask_pil_to_torch (line 106) | def mask_pil_to_torch(mask, height, width):
function prepare_mask_and_masked_image (line 122) | def prepare_mask_and_masked_image(image, mask, height, width, return_ima...
function retrieve_latents (line 241) | def retrieve_latents(
function retrieve_timesteps (line 255) | def retrieve_timesteps(
class KolorsInpaintPipeline (line 314) | class KolorsInpaintPipeline(
method __init__ (line 376) | def __init__(
method encode_image (line 416) | def encode_image(self, image, device, num_images_per_prompt, output_hi...
method prepare_ip_adapter_image_embeds (line 441) | def prepare_ip_adapter_image_embeds(
method encode_prompt (line 492) | def encode_prompt(
method prepare_extra_step_kwargs (line 667) | def prepare_extra_step_kwargs(self, generator, eta):
method check_inputs (line 684) | def check_inputs(
method prepare_latents (line 774) | def prepare_latents(
method _encode_vae_image (line 840) | def _encode_vae_image(self, image: torch.Tensor, generator: torch.Gene...
method prepare_mask_latents (line 863) | def prepare_mask_latents(
method get_timesteps (line 917) | def get_timesteps(self, num_inference_steps, strength, device, denoisi...
method _get_add_time_ids (line 954) | def _get_add_time_ids(
method upcast_vae (line 1004) | def upcast_vae(self):
method get_guidance_scale_embedding (line 1009) | def get_guidance_scale_embedding(
method guidance_scale (line 1040) | def guidance_scale(self):
method guidance_rescale (line 1044) | def guidance_rescale(self):
method do_classifier_free_guidance (line 1051) | def do_classifier_free_guidance(self):
method cross_attention_kwargs (line 1055) | def cross_attention_kwargs(self):
method denoising_end (line 1059) | def denoising_end(self):
method denoising_start (line 1063) | def denoising_start(self):
method num_timesteps (line 1067) | def num_timesteps(self):
method interrupt (line 1071) | def interrupt(self):
method __call__ (line 1076) | def __call__(
FILE: examples/community/pipeline_null_text_inversion.py
function retrieve_timesteps (line 15) | def retrieve_timesteps(
class NullTextPipeline (line 58) | class NullTextPipeline(StableDiffusionPipeline):
method get_noise_pred (line 59) | def get_noise_pred(self, latents, t, context):
method get_noise_pred_single (line 68) | def get_noise_pred_single(self, latents, t, context):
method image2latent (line 73) | def image2latent(self, image_path):
method latent2image (line 83) | def latent2image(self, latents):
method prev_step (line 89) | def prev_step(self, model_output, timestep, sample):
method next_step (line 101) | def next_step(self, model_output, timestep, sample):
method null_optimization (line 114) | def null_optimization(self, latents, context, num_inner_steps, epsilon):
method ddim_inversion_loop (line 149) | def ddim_inversion_loop(self, latent, context):
method get_context (line 162) | def get_context(self, prompt):
method invert (line 178) | def invert(
method __call__ (line 194) | def __call__(
FILE: examples/community/pipeline_prompt2prompt.py
function rescale_noise_cfg (line 61) | def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0):
class Prompt2PromptPipeline (line 75) | class Prompt2PromptPipeline(
method __init__ (line 120) | def __init__(
method _encode_prompt (line 217) | def _encode_prompt(
method encode_prompt (line 250) | def encode_prompt(
method run_safety_checker (line 434) | def run_safety_checker(self, image, device, dtype):
method prepare_extra_step_kwargs (line 449) | def prepare_extra_step_kwargs(self, generator, eta):
method check_inputs (line 467) | def check_inputs(
method prepare_latents (line 527) | def prepare_latents(
method __call__ (line 560) | def __call__(
method register_attention_control (line 778) | def register_attention_control(self, controller):
class P2PCrossAttnProcessor (line 803) | class P2PCrossAttnProcessor:
method __init__ (line 804) | def __init__(self, controller, place_in_unet):
method __call__ (line 809) | def __call__(
function create_controller (line 846) | def create_controller(
class AttentionControl (line 930) | class AttentionControl(abc.ABC):
method step_callback (line 931) | def step_callback(self, x_t):
method between_steps (line 934) | def between_steps(self):
method num_uncond_att_layers (line 938) | def num_uncond_att_layers(self):
method forward (line 942) | def forward(self, attn, is_cross: bool, place_in_unet: str):
method __call__ (line 945) | def __call__(self, attn, is_cross: bool, place_in_unet: str):
method reset (line 956) | def reset(self):
method __init__ (line 960) | def __init__(self):
class EmptyControl (line 966) | class EmptyControl(AttentionControl):
method forward (line 967) | def forward(self, attn, is_cross: bool, place_in_unet: str):
class AttentionStore (line 971) | class AttentionStore(AttentionControl):
method get_empty_store (line 973) | def get_empty_store():
method forward (line 983) | def forward(self, attn, is_cross: bool, place_in_unet: str):
method between_steps (line 989) | def between_steps(self):
method get_average_attention (line 998) | def get_average_attention(self):
method reset (line 1004) | def reset(self):
method __init__ (line 1009) | def __init__(self):
class LocalBlend (line 1015) | class LocalBlend:
method __call__ (line 1016) | def __call__(self, x_t, attention_store):
method __init__ (line 1030) | def __init__(
class AttentionControlEdit (line 1052) | class AttentionControlEdit(AttentionStore, abc.ABC):
method step_callback (line 1053) | def step_callback(self, x_t):
method replace_self_attention (line 1058) | def replace_self_attention(self, attn_base, att_replace):
method replace_cross_attention (line 1065) | def replace_cross_attention(self, attn_base, att_replace):
method forward (line 1068) | def forward(self, attn, is_cross: bool, place_in_unet: str):
method __init__ (line 1087) | def __init__(
class AttentionReplace (line 1113) | class AttentionReplace(AttentionControlEdit):
method replace_cross_attention (line 1114) | def replace_cross_attention(self, attn_base, att_replace):
method __init__ (line 1117) | def __init__(
class AttentionRefine (line 1139) | class AttentionRefine(AttentionControlEdit):
method replace_cross_attention (line 1140) | def replace_cross_attention(self, attn_base, att_replace):
method __init__ (line 1145) | def __init__(
class AttentionReweight (line 1169) | class AttentionReweight(AttentionControlEdit):
method replace_cross_attention (line 1170) | def replace_cross_attention(self, attn_base, att_replace):
method __init__ (line 1176) | def __init__(
function update_alpha_time_word (line 1202) | def update_alpha_time_word(
function get_time_words_attention_alpha (line 1219) | def get_time_words_attention_alpha(
function get_word_inds (line 1244) | def get_word_inds(text: str, word_place: int, tokenizer):
function get_replacement_mapper_ (line 1266) | def get_replacement_mapper_(x: str, y: str, tokenizer, max_len=77):
function get_replacement_mapper (line 1304) | def get_replacement_mapper(prompts, tokenizer, max_len=77):
function get_equalizer (line 1314) | def get_equalizer(
class ScoreParams (line 1331) | class ScoreParams:
method __init__ (line 1332) | def __init__(self, gap, match, mismatch):
method mis_match_char (line 1337) | def mis_match_char(self, x, y):
function get_matrix (line 1344) | def get_matrix(size_x, size_y, gap):
function get_traceback_matrix (line 1351) | def get_traceback_matrix(size_x, size_y):
function global_align (line 1359) | def global_align(x, y, score):
function get_aligned_sequences (line 1377) | def get_aligned_sequences(x, y, trace_back):
function get_mapper (line 1405) | def get_mapper(x: str, y: str, tokenizer, max_len=77):
function get_refinement_mapper (line 1419) | def get_refinement_mapper(prompts, tokenizer, max_len=77):
FILE: examples/community/pipeline_sdxl_style_aligned.py
function expand_first (line 134) | def expand_first(feat: torch.Tensor, scale: float = 1.0) -> torch.Tensor:
function concat_first (line 145) | def concat_first(feat: torch.Tensor, dim: int = 2, scale: float = 1.0) -...
function calc_mean_std (line 150) | def calc_mean_std(feat: torch.Tensor, eps: float = 1e-5) -> Tuple[torch....
function adain (line 156) | def adain(feat: torch.Tensor) -> torch.Tensor:
function get_switch_vec (line 165) | def get_switch_vec(total_num_layers, level):
class SharedAttentionProcessor (line 182) | class SharedAttentionProcessor(AttnProcessor2_0):
method __init__ (line 183) | def __init__(
method shifted_scaled_dot_product_attention (line 203) | def shifted_scaled_dot_product_attention(
method shared_call (line 211) | def shared_call(
method __call__ (line 284) | def __call__(
function rescale_noise_cfg (line 313) | def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0):
function retrieve_timesteps (line 328) | def retrieve_timesteps(
function retrieve_latents (line 373) | def retrieve_latents(
class StyleAlignedSDXLPipeline (line 386) | class StyleAlignedSDXLPipeline(
method __init__ (line 461) | def __init__(
method encode_prompt (line 508) | def encode_prompt(
method encode_image (line 746) | def encode_image(self, image, device, num_images_per_prompt, output_hi...
method prepare_extra_step_kwargs (line 771) | def prepare_extra_step_kwargs(self, generator, eta):
method check_inputs (line 788) | def check_inputs(
method get_timesteps (line 867) | def get_timesteps(self, num_inference_steps, strength, device, denoisi...
method prepare_latents (line 903) | def prepare_latents(
method prepare_mask_latents (line 1059) | def prepare_mask_latents(
method _encode_vae_image (line 1112) | def _encode_vae_image(self, image: torch.Tensor, generator: torch.Gene...
method _get_add_time_ids (line 1135) | def _get_add_time_ids(self, original_size, crops_coords_top_left, targ...
method upcast_vae (line 1151) | def upcast_vae(self):
method _enable_shared_attention_processors (line 1155) | def _enable_shared_attention_processors(
method _disable_shared_attention_processors (line 1192) | def _disable_shared_attention_processors(self):
method _register_shared_norm (line 1204) | def _register_shared_norm(self, share_group_norm: bool = True, share_l...
method style_aligned_enabled (line 1241) | def style_aligned_enabled(self):
method enable_style_aligned (line 1245) | def enable_style_aligned(
method disable_style_aligned (line 1292) | def disable_style_aligned(self):
method get_guidance_scale_embedding (line 1302) | def get_guidance_scale_embedding(self, w, embedding_dim=512, dtype=tor...
method guidance_scale (line 1331) | def guidance_scale(self):
method guidance_rescale (line 1335) | def guidance_rescale(self):
method clip_skip (line 1339) | def clip_skip(self):
method do_classifier_free_guidance (line 1346) | def do_classifier_free_guidance(self):
method cross_attention_kwargs (line 1350) | def cross_attention_kwargs(self):
method denoising_end (line 1354) | def denoising_end(self):
method denoising_start (line 1358) | def denoising_start(self):
method num_timesteps (line 1362) | def num_timesteps(self):
method interrupt (line 1366) | def interrupt(self):
method __call__ (line 1371) | def __call__(
FILE: examples/community/pipeline_stable_diffusion_3_differential_img2img.py
function retrieve_latents (line 70) | def retrieve_latents(
function retrieve_timesteps (line 84) | def retrieve_timesteps(
class StableDiffusion3DifferentialImg2ImgPipeline (line 143) | class StableDiffusion3DifferentialImg2ImgPipeline(DiffusionPipeline):
method __init__ (line 181) | def __init__(
method _get_t5_prompt_embeds (line 218) | def _get_t5_prompt_embeds(
method _get_clip_prompt_embeds (line 275) | def _get_clip_prompt_embeds(
method encode_prompt (line 331) | def encode_prompt(
method check_inputs (line 500) | def check_inputs(
method get_timesteps (line 589) | def get_timesteps(self, num_inference_steps, strength, device):
method prepare_latents (line 598) | def prepare_latents(
method guidance_scale (line 645) | def guidance_scale(self):
method clip_skip (line 649) | def clip_skip(self):
method do_classifier_free_guidance (line 656) | def do_classifier_free_guidance(self):
method num_timesteps (line 660) | def num_timesteps(self):
method interrupt (line 664) | def interrupt(self):
method __call__ (line 669) | def __call__(
FILE: examples/community/pipeline_stable_diffusion_3_instruct_pix2pix.py
function calculate_shift (line 90) | def calculate_shift(
function retrieve_latents (line 104) | def retrieve_latents(
function retrieve_timesteps (line 118) | def retrieve_timesteps(
class StableDiffusion3InstructPix2PixPipeline (line 177) | class StableDiffusion3InstructPix2PixPipeline(
method __init__ (line 221) | def __init__(
method _get_t5_prompt_embeds (line 264) | def _get_t5_prompt_embeds(
method _get_clip_prompt_embeds (line 320) | def _get_clip_prompt_embeds(
method encode_prompt (line 375) | def encode_prompt(
method check_inputs (line 568) | def check_inputs(
method prepare_latents (line 664) | def prepare_latents(
method prepare_image_latents (line 695) | def prepare_image_latents(
method guidance_scale (line 746) | def guidance_scale(self):
method image_guidance_scale (line 750) | def image_guidance_scale(self):
method skip_guidance_layers (line 754) | def skip_guidance_layers(self):
method clip_skip (line 758) | def clip_skip(self):
method do_classifier_free_guidance (line 765) | def do_classifier_free_guidance(self):
method joint_attention_kwargs (line 769) | def joint_attention_kwargs(self):
method num_timesteps (line 773) | def num_timesteps(self):
method interrupt (line 777) | def interrupt(self):
method encode_image (line 781) | def encode_image(self, image: PipelineImageInput, device: torch.device...
method prepare_ip_adapter_image_embeds (line 801) | def prepare_ip_adapter_image_embeds(
method enable_sequential_cpu_offload (line 847) | def enable_sequential_cpu_offload(self, *args, **kwargs):
method __call__ (line 859) | def __call__(
FILE: examples/community/pipeline_stable_diffusion_boxdiff.py
class GaussianSmoothing (line 71) | class GaussianSmoothing(nn.Module):
method __init__ (line 86) | def __init__(self, channels, kernel_size, sigma, dim=2):
method forward (line 120) | def forward(self, input):
class AttendExciteCrossAttnProcessor (line 131) | class AttendExciteCrossAttnProcessor:
method __init__ (line 132) | def __init__(self, attnstore, place_in_unet):
method __call__ (line 137) | def __call__(
class AttentionControl (line 171) | class AttentionControl(abc.ABC):
method step_callback (line 172) | def step_callback(self, x_t):
method between_steps (line 175) | def between_steps(self):
method forward (line 183) | def forward(self, attn, is_cross: bool, place_in_unet: str):
method __call__ (line 186) | def __call__(self, attn, is_cross: bool, place_in_unet: str):
method reset (line 195) | def reset(self):
method __init__ (line 199) | def __init__(self):
class AttentionStore (line 205) | class AttentionStore(AttentionControl):
method get_empty_store (line 207) | def get_empty_store():
method forward (line 210) | def forward(self, attn, is_cross: bool, place_in_unet: str):
method between_steps (line 216) | def between_steps(self):
method get_average_attention (line 229) | def get_average_attention(self):
method get_average_global_attention (line 233) | def get_average_global_attention(self):
method reset (line 239) | def reset(self):
method __init__ (line 245) | def __init__(self, save_global_store=False):
function aggregate_attention (line 259) | def aggregate_attention(
function register_attention_control (line 282) | def register_attention_control(model, controller):
function rescale_noise_cfg (line 307) | def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0):
function retrieve_timesteps (line 321) | def retrieve_timesteps(
class StableDiffusionBoxDiffPipeline (line 365) | class StableDiffusionBoxDiffPipeline(
method __init__ (line 406) | def __init__(
method enable_vae_slicing (line 502) | def enable_vae_slicing(self):
method disable_vae_slicing (line 515) | def disable_vae_slicing(self):
method enable_vae_tiling (line 528) | def enable_vae_tiling(self):
method disable_vae_tiling (line 542) | def disable_vae_tiling(self):
method _encode_prompt (line 555) | def _encode_prompt(
method encode_prompt (line 587) | def encode_prompt(
method encode_image (line 768) | def encode_image(self, image, device, num_images_per_prompt, output_hi...
method run_safety_checker (line 792) | def run_safety_checker(self, image, device, dtype):
method decode_latents (line 806) | def decode_latents(self, latents):
method prepare_extra_step_kwargs (line 817) | def prepare_extra_step_kwargs(self, generator, eta):
method check_inputs (line 834) | def check_inputs(
method prepare_latents (line 902) | def prepare_latents(self, batch_size, num_channels_latents, height, wi...
method enable_freeu (line 919) | def enable_freeu(self, s1: float, s2: float, b1: float, b2: float):
method disable_freeu (line 941) | def disable_freeu(self):
method fuse_qkv_projections (line 946) | def fuse_qkv_projections(self, unet: bool = True, vae: bool = True):
method unfuse_qkv_projections (line 975) | def unfuse_qkv_projections(self, unet: bool = True, vae: bool = True):
method get_guidance_scale_embedding (line 1001) | def get_guidance_scale_embedding(self, w, embedding_dim=512, dtype=tor...
method guidance_scale (line 1030) | def guidance_scale(self):
method guidance_rescale (line 1034) | def guidance_rescale(self):
method clip_skip (line 1038) | def clip_skip(self):
method do_classifier_free_guidance (line 1045) | def do_classifier_free_guidance(self):
method cross_attention_kwargs (line 1049) | def cross_attention_kwargs(self):
method num_timesteps (line 1053) | def num_timesteps(self):
method interrupt (line 1057) | def interrupt(self):
method _compute_max_attention_per_index (line 1060) | def _compute_max_attention_per_index(
method _aggregate_and_get_max_attention_per_token (line 1143) | def _aggregate_and_get_max_attention_per_token(
method _compute_loss (line 1178) | def _compute_loss(
method _update_latent (line 1195) | def _update_latent(latents: torch.Tensor, loss: torch.Tensor, step_siz...
method _perform_iterative_refinement_step (line 1201) | def _perform_iterative_refinement_step(
method __call__ (line 1312) | def __call__(
FILE: examples/community/pipeline_stable_diffusion_pag.py
class PAGIdentitySelfAttnProcessor (line 53) | class PAGIdentitySelfAttnProcessor:
method __init__ (line 58) | def __init__(self):
method __call__ (line 62) | def __call__(
class PAGCFGIdentitySelfAttnProcessor (line 167) | class PAGCFGIdentitySelfAttnProcessor:
method __init__ (line 172) | def __init__(self):
method __call__ (line 176) | def __call__(
function rescale_noise_cfg (line 279) | def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0):
function retrieve_timesteps (line 293) | def retrieve_timesteps(
class StableDiffusionPAGPipeline (line 335) | class StableDiffusionPAGPipeline(
method __init__ (line 373) | def __init__(
method enable_vae_slicing (line 469) | def enable_vae_slicing(self):
method disable_vae_slicing (line 482) | def disable_vae_slicing(self):
method enable_vae_tiling (line 495) | def enable_vae_tiling(self):
method disable_vae_tiling (line 509) | def disable_vae_tiling(self):
method _encode_prompt (line 522) | def _encode_prompt(
method encode_prompt (line 554) | def encode_prompt(
method encode_image (line 734) | def encode_image(self, image, device, num_images_per_prompt, output_hi...
method prepare_ip_adapter_image_embeds (line 758) | def prepare_ip_adapter_image_embeds(
method run_safety_checker (line 792) | def run_safety_checker(self, image, device, dtype):
method decode_latents (line 806) | def decode_latents(self, latents):
method prepare_extra_step_kwargs (line 817) | def prepare_extra_step_kwargs(self, generator, eta):
method check_inputs (line 834) | def check_inputs(
method prepare_latents (line 893) | def prepare_latents(self, batch_size, num_channels_latents, height, wi...
method enable_freeu (line 915) | def enable_freeu(self, s1: float, s2: float, b1: float, b2: float):
method disable_freeu (line 934) | def disable_freeu(self):
method fuse_qkv_projections (line 939) | def fuse_qkv_projections(self, unet: bool = True, vae: bool = True):
method unfuse_qkv_projections (line 966) | def unfuse_qkv_projections(self, unet: bool = True, vae: bool = True):
method get_guidance_scale_embedding (line 989) | def get_guidance_scale_embedding(self, w, embedding_dim=512, dtype=tor...
method pred_z0 (line 1015) | def pred_z0(self, sample, model_output, timestep):
method pred_x0 (line 1035) | def pred_x0(self, latents, noise_pred, t, generator, device, prompt_em...
method guidance_scale (line 1045) | def guidance_scale(self):
method guidance_rescale (line 1049) | def guidance_rescale(self):
method clip_skip (line 1053) | def clip_skip(self):
method do_classifier_free_guidance (line 1060) | def do_classifier_free_guidance(self):
method cross_attention_kwargs (line 1064) | def cross_attention_kwargs(self):
method num_timesteps (line 1068) | def num_timesteps(self):
method interrupt (line 1072) | def interrupt(self):
method pag_scale (line 1076) | def pag_scale(self):
method do_perturbed_attention_guidance (line 1080) | def do_perturbed_attention_guidance(self):
method pag_adaptive_scaling (line 1084) | def pag_adaptive_scaling(self):
method do_pag_adaptive_scaling (line 1088) | def do_pag_adaptive_scaling(self):
method pag_applied_layers_index (line 1092) | def pag_applied_layers_index(self):
method __call__ (line 1097) | def __call__(
FILE: examples/community/pipeline_stable_diffusion_upscale_ldm3d.py
class StableDiffusionUpscaleLDM3DPipeline (line 71) | class StableDiffusionUpscaleLDM3DPipeline(
method __init__ (line 111) | def __init__(
method _encode_prompt (line 160) | def _encode_prompt(
method encode_prompt (line 193) | def encode_prompt(
method run_safety_checker (line 374) | def run_safety_checker(self, image, device, dtype):
method prepare_extra_step_kwargs (line 390) | def prepare_extra_step_kwargs(self, generator, eta):
method check_inputs (line 407) | def check_inputs(
method prepare_latents (line 493) | def prepare_latents(self, batch_size, num_channels_latents, height, wi...
method upcast_vae (line 506) | def upcast_vae(self):
method __call__ (line 511) | def __call__(
FILE: examples/community/pipeline_stable_diffusion_xl_attentive_eraser.py
class AttentionBase (line 148) | class AttentionBase:
method __init__ (line 149) | def __init__(self):
method after_step (line 154) | def after_step(self):
method __call__ (line 157) | def __call__(self, q, k, v, sim, attn, is_cross, place_in_unet, num_he...
method forward (line 167) | def forward(self, q, k, v, sim, attn, is_cross, place_in_unet, num_hea...
method reset (line 172) | def reset(self):
class AAS_XL (line 177) | class AAS_XL(AttentionBase):
method __init__ (line 180) | def __init__(
method attn_batch (line 221) | def attn_batch(self, q, k, v, sim, attn, is_cross, place_in_unet, num_...
method forward (line 243) | def forward(self, q, k, v, sim, attn, is_cross, place_in_unet, num_hea...
function rescale_noise_cfg (line 295) | def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0):
function mask_pil_to_torch (line 309) | def mask_pil_to_torch(mask, height, width):
function prepare_mask_and_masked_image (line 325) | def prepare_mask_and_masked_image(image, mask, height, width, return_ima...
function retrieve_latents (line 437) | def retrieve_latents(
function retrieve_timesteps (line 451) | def retrieve_timesteps(
class StableDiffusionXL_AE_Pipeline (line 495) | class StableDiffusionXL_AE_Pipeline(
method __init__ (line 573) | def __init__(
method encode_image (line 617) | def encode_image(self, image, device, num_images_per_prompt, output_hi...
method prepare_ip_adapter_image_embeds (line 642) | def prepare_ip_adapter_image_embeds(
method encode_prompt (line 694) | def encode_prompt(
method prepare_extra_step_kwargs (line 929) | def prepare_extra_step_kwargs(self, generator, eta):
method check_inputs (line 946) | def check_inputs(
method prepare_latents (line 1050) | def prepare_latents(
method _encode_vae_image (line 1111) | def _encode_vae_image(self, image: torch.Tensor, generator: torch.Gene...
method prepare_mask_latents (line 1134) | def prepare_mask_latents(
method get_timesteps (line 1189) | def get_timesteps(self, num_inference_steps, strength, device, denoisi...
method _get_add_time_ids (line 1226) | def _get_add_time_ids(
method upcast_vae (line 1278) | def upcast_vae(self):
method get_guidance_scale_embedding (line 1283) | def get_guidance_scale_embedding(self, w, embedding_dim=512, dtype=tor...
method guidance_scale (line 1312) | def guidance_scale(self):
method guidance_rescale (line 1316) | def guidance_rescale(self):
method clip_skip (line 1320) | def clip_skip(self):
method do_self_attention_redirection_guidance (line 1324) | def do_self_attention_redirection_guidance(self): # SARG
method do_classifier_free_guidance (line 1331) | def do_classifier_free_guidance(self):
method cross_attention_kwargs (line 1339) | def cross_attention_kwargs(self):
method denoising_end (line 1343) | def denoising_end(self):
method denoising_start (line 1347) | def denoising_start(self):
method num_timesteps (line 1351) | def num_timesteps(self):
method interrupt (line 1355) | def interrupt(self):
method image2latent (line 1359) | def image2latent(self, image: torch.Tensor, generator: torch.Generator):
method next_step (line 1372) | def next_step(self, model_output: torch.FloatTensor, timestep: int, x:...
method invert (line 1389) | def invert(
method opt (line 1523) | def opt(
method regiter_attention_editor_diffusers (line 1539) | def regiter_attention_editor_diffusers(self, unet, editor: AttentionBa...
method __call__ (line 1608) | def __call__(
FILE: examples/community/pipeline_stable_diffusion_xl_controlnet_adapter.py
function _preprocess_adapter_image (line 113) | def _preprocess_adapter_image(image, height, width):
function rescale_noise_cfg (line 141) | def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0):
class StableDiffusionXLControlNetAdapterPipeline (line 155) | class StableDiffusionXLControlNetAdapterPipeline(
method __init__ (line 199) | def __init__(
method encode_prompt (line 241) | def encode_prompt(
method prepare_extra_step_kwargs (line 479) | def prepare_extra_step_kwargs(self, generator, eta):
method check_image (line 497) | def check_image(self, image, prompt, prompt_embeds):
method check_inputs (line 535) | def check_inputs(
method check_conditions (line 614) | def check_conditions(
method prepare_latents (line 755) | def prepare_latents(self, batch_size, num_channels_latents, height, wi...
method _get_add_time_ids (line 778) | def _get_add_time_ids(
method upcast_vae (line 796) | def upcast_vae(self):
method _default_height_width (line 801) | def _default_height_width(self, height, width, image):
method prepare_control_image (line 828) | def prepare_control_image(
method __call__ (line 860) | def __call__(
FILE: examples/community/pipeline_stable_diffusion_xl_controlnet_adapter_inpaint.py
function _preprocess_adapter_image (line 131) | def _preprocess_adapter_image(image, height, width):
function mask_pil_to_torch (line 158) | def mask_pil_to_torch(mask, height, width):
function prepare_mask_and_masked_image (line 174) | def prepare_mask_and_masked_image(image, mask, height, width, return_ima...
function rescale_noise_cfg (line 287) | def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0):
class StableDiffusionXLControlNetAdapterInpaintPipeline (line 301) | class StableDiffusionXLControlNetAdapterInpaintPipeline(
method __init__ (line 344) | def __init__(
method encode_prompt (line 388) | def encode_prompt(
method prepare_extra_step_kwargs (line 626) | def prepare_extra_step_kwargs(self, generator, eta):
method check_image (line 644) | def check_image(self, image, prompt, prompt_embeds):
method check_inputs (line 682) | def check_inputs(
method check_conditions (line 761) | def check_conditions(
method prepare_latents (line 901) | def prepare_latents(
method _encode_vae_image (line 967) | def _encode_vae_image(self, image: torch.Tensor, generator: torch.Gene...
method prepare_mask_latents (line 990) | def prepare_mask_latents(
method get_timesteps (line 1051) | def get_timesteps(self, num_inference_steps, strength, device, denoisi...
method _get_add_time_ids (line 1087) | def _get_add_time_ids(
method upcast_vae (line 1133) | def upcast_vae(self):
method _default_height_width (line 1138) | def _default_height_width(self, height, width, image):
method prepare_control_image (line 1165) | def prepare_control_image(
method __call__ (line 1197) | def __call__(
FILE: examples/community/pipeline_stable_diffusion_xl_differential_img2img.py
function rescale_noise_cfg (line 88) | def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0):
function retrieve_latents (line 103) | def retrieve_latents(
function retrieve_timesteps (line 117) | def retrieve_timesteps(
class StableDiffusionXLDifferentialImg2ImgPipeline (line 161) | class StableDiffusionXLDifferentialImg2ImgPipeline(
method __init__ (line 227) | def __init__(
method encode_prompt (line 268) | def encode_prompt(
method prepare_extra_step_kwargs (line 506) | def prepare_extra_step_kwargs(self, generator, eta):
method check_inputs (line 523) | def check_inputs(
method get_timesteps (line 613) | def get_timesteps(self, num_inference_steps, strength, device, denoisi...
method prepare_latents (line 649) | def prepare_latents(
method encode_image (line 718) | def encode_image(self, image, device, num_images_per_prompt, output_hi...
method prepare_ip_adapter_image_embeds (line 743) | def prepare_ip_adapter_image_embeds(
method _get_add_time_ids (line 794) | def _get_add_time_ids(
method upcast_vae (line 846) | def upcast_vae(self):
method get_guidance_scale_embedding (line 851) | def get_guidance_scale_embedding(
method guidance_scale (line 882) | def guidance_scale(self):
method guidance_rescale (line 886) | def guidance_rescale(self):
method clip_skip (line 890) | def clip_skip(self):
method do_classifier_free_guidance (line 897) | def do_classifier_free_guidance(self):
method cross_attention_kwargs (line 901) | def cross_attention_kwargs(self):
method denoising_end (line 905) | def denoising_end(self):
method denoising_start (line 909) | def denoising_start(self):
method num_timesteps (line 913) | def num_timesteps(self):
method interrupt (line 917) | def interrupt(self):
method __call__ (line 922) | def __call__(
FILE: examples/community/pipeline_stable_diffusion_xl_instandid_img2img.py
function FeedForward (line 55) | def FeedForward(dim, mult=4):
function reshape_tensor (line 65) | def reshape_tensor(x, heads):
class PerceiverAttention (line 76) | class PerceiverAttention(nn.Module):
method __init__ (line 77) | def __init__(self, *, dim, dim_head=64, heads=8):
method forward (line 91) | def forward(self, x, latents):
class Resampler (line 123) | class Resampler(nn.Module):
method __init__ (line 124) | def __init__(
method forward (line 155) | def forward(self, x):
class AttnProcessor (line 167) | class AttnProcessor(nn.Module):
method __init__ (line 172) | def __init__(
method __call__ (line 179) | def __call__(
class IPAttnProcessor (line 240) | class IPAttnProcessor(nn.Module):
method __init__ (line 254) | def __init__(self, hidden_size, cross_attention_dim=None, scale=1.0, n...
method __call__ (line 265) | def __call__(
method _memory_efficient_attention_xformers (line 351) | def _memory_efficient_attention_xformers(self, query, key, value, atte...
function draw_kps (line 415) | def draw_kps(image_pil, kps, color_list=[(255, 0, 0), (0, 255, 0), (0, 0...
class StableDiffusionXLInstantIDImg2ImgPipeline (line 446) | class StableDiffusionXLInstantIDImg2ImgPipeline(StableDiffusionXLControl...
method cuda (line 447) | def cuda(self, dtype=torch.float16, use_xformers=False):
method load_ip_adapter_instantid (line 467) | def load_ip_adapter_instantid(self, model_ckpt, image_emb_dim=512, num...
method set_image_proj_model (line 471) | def set_image_proj_model(self, model_ckpt, image_emb_dim=512, num_toke...
method set_ip_adapter (line 493) | def set_ip_adapter(self, model_ckpt, num_tokens, scale):
method set_ip_adapter_scale (line 523) | def set_ip_adapter_scale(self, scale):
method _encode_prompt_image_emb (line 529) | def _encode_prompt_image_emb(self, prompt_image_emb, device, dtype, do...
method __call__ (line 548) | def __call__(
FILE: examples/community/pipeline_stable_diffusion_xl_instantid.py
function FeedForward (line 55) | def FeedForward(dim, mult=4):
function reshape_tensor (line 65) | def reshape_tensor(x, heads):
class PerceiverAttention (line 76) | class PerceiverAttention(nn.Module):
method __init__ (line 77) | def __init__(self, *, dim, dim_head=64, heads=8):
method forward (line 91) | def forward(self, x, latents):
class Resampler (line 123) | class Resampler(nn.Module):
method __init__ (line 124) | def __init__(
method forward (line 155) | def forward(self, x):
class AttnProcessor (line 167) | class AttnProcessor(nn.Module):
method __init__ (line 172) | def __init__(
method __call__ (line 179) | def __call__(
class IPAttnProcessor (line 240) | class IPAttnProcessor(nn.Module):
method __init__ (line 254) | def __init__(self, hidden_size, cross_attention_dim=None, scale=1.0, n...
method __call__ (line 265) | def __call__(
method _memory_efficient_attention_xformers (line 351) | def _memory_efficient_attention_xformers(self, query, key, value, atte...
function draw_kps (line 415) | def draw_kps(image_pil, kps, color_list=[(255, 0, 0), (0, 255, 0), (0, 0...
class StableDiffusionXLInstantIDPipeline (line 446) | class StableDiffusionXLInstantIDPipeline(StableDiffusionXLControlNetPipe...
method cuda (line 447) | def cuda(self, dtype=torch.float16, use_xformers=False):
method load_ip_adapter_instantid (line 467) | def load_ip_adapter_instantid(self, model_ckpt, image_emb_dim=512, num...
method set_image_proj_model (line 471) | def set_image_proj_model(self, model_ckpt, image_emb_dim=512, num_toke...
method set_ip_adapter (line 493) | def set_ip_adapter(self, model_ckpt, num_tokens, scale):
method set_ip_adapter_scale (line 523) | def set_ip_adapter_scale(self, scale):
method _encode_prompt_image_emb (line 529) | def _encode_prompt_image_emb(self, prompt_image_emb, device, dtype, do...
method __call__ (line 548) | def __call__(
FILE: examples/community/pipeline_stable_diffusion_xl_ipex.py
function rescale_noise_cfg (line 98) | def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0):
function retrieve_timesteps (line 113) | def retrieve_timesteps(
class StableDiffusionXLPipelineIpex (line 157) | class StableDiffusionXLPipelineIpex(
method __init__ (line 224) | def __init__(
method encode_prompt (line 268) | def encode_prompt(
method encode_image (line 506) | def encode_image(self, image, device, num_images_per_prompt):
method prepare_extra_step_kwargs (line 520) | def prepare_extra_step_kwargs(self, generator, eta):
method check_inputs (line 537) | def check_inputs(
method prepare_latents (line 617) | def prepare_latents(self, batch_size, num_channels_latents, height, wi...
method _get_add_time_ids (line 639) | def _get_add_time_ids(
method upcast_vae (line 657) | def upcast_vae(self):
method get_guidance_scale_embedding (line 662) | def get_guidance_scale_embedding(self, w, embedding_dim=512, dtype=tor...
method guidance_scale (line 691) | def guidance_scale(self):
method guidance_rescale (line 695) | def guidance_rescale(self):
method clip_skip (line 699) | def clip_skip(self):
method do_classifier_free_guidance (line 706) | def do_classifier_free_guidance(self):
method cross_attention_kwargs (line 710) | def cross_attention_kwargs(self):
method denoising_end (line 714) | def denoising_end(self):
method num_timesteps (line 718) | def num_timesteps(self):
method __call__ (line 723) | def __call__(
method prepare_for_ipex (line 1162) | def prepare_for_ipex(
FILE: examples/community/pipeline_stable_diffusion_xl_t5.py
class LinearWithDtype (line 54) | class LinearWithDtype(nn.Linear):
method dtype (line 56) | def dtype(self):
class StableDiffusionXL_T5Pipeline (line 60) | class StableDiffusionXL_T5Pipeline(StableDiffusionXLPipeline):
method __init__ (line 81) | def __init__(
method encode_prompt (line 148) | def encode_prompt(
FILE: examples/community/pipeline_stg_cogvideox.py
function forward_with_stg (line 77) | def forward_with_stg(
function get_resize_crop_region_for_grid (line 123) | def get_resize_crop_region_for_grid(src, tgt_width, tgt_height):
function retrieve_timesteps (line 142) | def retrieve_timesteps(
class CogVideoXSTGPipeline (line 201) | class CogVideoXSTGPipeline(DiffusionPipeline, CogVideoXLoraLoaderMixin):
method __init__ (line 233) | def __init__(
method _get_t5_prompt_embeds (line 256) | def _get_t5_prompt_embeds(
method encode_prompt (line 298) | def encode_prompt(
method prepare_latents (line 379) | def prepare_latents(
method decode_latents (line 405) | def decode_latents(self, latents: torch.Tensor) -> torch.Tensor:
method prepare_extra_step_kwargs (line 413) | def prepare_extra_step_kwargs(self, generator, eta):
method check_inputs (line 431) | def check_inputs(
method fuse_qkv_projections (line 482) | def fuse_qkv_projections(self) -> None:
method unfuse_qkv_projections (line 487) | def unfuse_qkv_projections(self) -> None:
method _prepare_rotary_positional_embeddings (line 495) | def _prepare_rotary_positional_embeddings(
method guidance_scale (line 540) | def guidance_scale(self):
method do_spatio_temporal_guidance (line 544) | def do_spatio_temporal_guidance(self):
method num_timesteps (line 548) | def num_timesteps(self):
method attention_kwargs (line 552) | def attention_kwargs(self):
method current_timestep (line 556) | def current_timestep(self):
method interrupt (line 560) | def interrupt(self):
method __call__ (line 565) | def __call__(
FILE: examples/community/pipeline_stg_hunyuan_video.py
function forward_with_stg (line 92) | def forward_with_stg(
function forward_without_stg (line 103) | def forward_without_stg(
function retrieve_timesteps (line 146) | def retrieve_timesteps(
class HunyuanVideoSTGPipeline (line 205) | class HunyuanVideoSTGPipeline(DiffusionPipeline, HunyuanVideoLoraLoaderM...
method __init__ (line 234) | def __init__(
method _get_llama_prompt_embeds (line 260) | def _get_llama_prompt_embeds(
method _get_clip_prompt_embeds (line 326) | def _get_clip_prompt_embeds(
method encode_prompt (line 365) | def encode_prompt(
method check_inputs (line 401) | def check_inputs(
method prepare_latents (line 448) | def prepare_latents(
method enable_vae_slicing (line 479) | def enable_vae_slicing(self):
method disable_vae_slicing (line 492) | def disable_vae_slicing(self):
method enable_vae_tiling (line 505) | def enable_vae_tiling(self):
method disable_vae_tiling (line 519) | def disable_vae_tiling(self):
method guidance_scale (line 533) | def guidance_scale(self):
method do_spatio_temporal_guidance (line 537) | def do_spatio_temporal_guidance(self):
method num_timesteps (line 541) | def num_timesteps(self):
method attention_kwargs (line 545) | def attention_kwargs(self):
method current_timestep (line 549) | def current_timestep(self):
method interrupt (line 553) | def interrupt(self):
method __call__ (line 558) | def __call__(
FILE: examples/community/pipeline_stg_ltx.py
function forward_with_stg (line 78) | def forward_with_stg(
function calculate_shift (line 123) | def calculate_shift(
function retrieve_timesteps (line 137) | def retrieve_timesteps(
class LTXSTGPipeline (line 196) | class LTXSTGPipeline(DiffusionPipeline, FromSingleFileMixin, LTXVideoLor...
method __init__ (line 224) | def __init__(
method _get_t5_prompt_embeds (line 260) | def _get_t5_prompt_embeds(
method encode_prompt (line 309) | def encode_prompt(
method check_inputs (line 392) | def check_inputs(
method _pack_latents (line 446) | def _pack_latents(latents: torch.Tensor, patch_size: int = 1, patch_si...
method _unpack_latents (line 469) | def _unpack_latents(
method _normalize_latents (line 481) | def _normalize_latents(
method _denormalize_latents (line 491) | def _denormalize_latents(
method prepare_latents (line 500) | def prepare_latents(
method guidance_scale (line 534) | def guidance_scale(self):
method do_classifier_free_guidance (line 538) | def do_classifier_free_guidance(self):
method do_spatio_temporal_guidance (line 542) | def do_spatio_temporal_guidance(self):
method num_timesteps (line 546) | def num_timesteps(self):
method attention_kwargs (line 550) | def attention_kwargs(self):
method interrupt (line 554) | def interrupt(self):
method __call__ (line 559) | def __call__(
FILE: examples/community/pipeline_stg_ltx_image2video.py
function forward_with_stg (line 83) | def forward_with_stg(
function calculate_shift (line 128) | def calculate_shift(
function retrieve_timesteps (line 142) | def retrieve_timesteps(
function retrieve_latents (line 202) | def retrieve_latents(
class LTXImageToVideoSTGPipeline (line 215) | class LTXImageToVideoSTGPipeline(DiffusionPipeline, FromSingleFileMixin,...
method __init__ (line 243) | def __init__(
method _get_t5_prompt_embeds (line 283) | def _get_t5_prompt_embeds(
method encode_prompt (line 332) | def encode_prompt(
method check_inputs (line 416) | def check_inputs(
method _pack_latents (line 471) | def _pack_latents(latents: torch.Tensor, patch_size: int = 1, patch_si...
method _unpack_latents (line 495) | def _unpack_latents(
method _normalize_latents (line 508) | def _normalize_latents(
method _denormalize_latents (line 519) | def _denormalize_latents(
method prepare_latents (line 528) | def prepare_latents(
method guidance_scale (line 593) | def guidance_scale(self):
method do_classifier_free_guidance (line 597) | def do_classifier_free_guidance(self):
method do_spatio_temporal_guidance (line 601) | def do_spatio_temporal_guidance(self):
method num_timesteps (line 605) | def num_timesteps(self):
method attention_kwargs (line 609) | def attention_kwargs(self):
method interrupt (line 613) | def interrupt(self):
method __call__ (line 618) | def __call__(
FILE: examples/community/pipeline_stg_mochi.py
function forward_with_stg (line 73) | def forward_with_stg(
function linear_quadratic_schedule (line 123) | def linear_quadratic_schedule(num_steps, threshold_noise, linear_steps=N...
function retrieve_timesteps (line 141) | def retrieve_timesteps(
class MochiSTGPipeline (line 200) | class MochiSTGPipeline(DiffusionPipeline, Mochi1LoraLoaderMixin):
method __init__ (line 228) | def __init__(
method _get_t5_prompt_embeds (line 259) | def _get_t5_prompt_embeds(
method encode_prompt (line 316) | def encode_prompt(
method check_inputs (line 399) | def check_inputs(
method enable_vae_slicing (line 452) | def enable_vae_slicing(self):
method disable_vae_slicing (line 465) | def disable_vae_slicing(self):
method enable_vae_tiling (line 478) | def enable_vae_tiling(self):
method disable_vae_tiling (line 492) | def disable_vae_tiling(self):
method prepare_latents (line 505) | def prepare_latents(
method guidance_scale (line 536) | def guidance_scale(self):
method do_classifier_free_guidance (line 540) | def do_classifier_free_guidance(self):
method do_spatio_temporal_guidance (line 544) | def do_spatio_temporal_guidance(self):
method num_timesteps (line 548) | def num_timesteps(self):
method attention_kwargs (line 552) | def attention_kwargs(self):
method current_timestep (line 556) | def current_timestep(self):
method interrupt (line 560) | def interrupt(self):
method __call__ (line 565) | def __call__(
FILE: examples/community/pipeline_stg_wan.py
function basic_clean (line 84) | def basic_clean(text):
function whitespace_clean (line 90) | def whitespace_clean(text):
function prompt_clean (line 96) | def prompt_clean(text):
function forward_with_stg (line 101) | def forward_with_stg(
function forward_without_stg (line 111) | def forward_without_stg(
class WanSTGPipeline (line 140) | class WanSTGPipeline(DiffusionPipeline, WanLoraLoaderMixin):
method __init__ (line 165) | def __init__(
method _get_t5_prompt_embeds (line 187) | def _get_t5_prompt_embeds(
method encode_prompt (line 228) | def encode_prompt(
method check_inputs (line 309) | def check_inputs(
method prepare_latents (line 350) | def prepare_latents(
method guidance_scale (line 383) | def guidance_scale(self):
method do_classifier_free_guidance (line 387) | def do_classifier_free_guidance(self):
method do_spatio_temporal_guidance (line 391) | def do_spatio_temporal_guidance(self):
method num_timesteps (line 395) | def num_timesteps(self):
method current_timestep (line 399) | def current_timestep(self):
method interrupt (line 403) | def interrupt(self):
method attention_kwargs (line 407) | def attention_kwargs(self):
method __call__ (line 412) | def __call__(
FILE: examples/community/pipeline_z_image_differential_img2img.py
function calculate_shift (line 69) | def calculate_shift(
function retrieve_latents (line 83) | def retrieve_latents(
function retrieve_timesteps (line 97) | def retrieve_timesteps(
class ZImageDifferentialImg2ImgPipeline (line 156) | class ZImageDifferentialImg2ImgPipeline(DiffusionPipeline, ZImageLoraLoa...
method __init__ (line 177) | def __init__(
method encode_prompt (line 209) | def encode_prompt(
method _encode_prompt (line 244) | def _encode_prompt(
method get_timesteps (line 296) | def get_timesteps(self, num_inference_steps, strength, device):
method _prepare_latent_image_ids (line 308) | def _prepare_latent_image_ids(batch_size, height, width, device, dtype):
method prepare_latents (line 321) | def prepare_latents(
method prepare_mask_latents (line 375) | def prepare_mask_latents(
method guidance_scale (line 430) | def guidance_scale(self):
method do_classifier_free_guidance (line 434) | def do_classifier_free_guidance(self):
method joint_attention_kwargs (line 438) | def joint_attention_kwargs(self):
method num_timesteps (line 442) | def num_timesteps(self):
method interrupt (line 446) | def interrupt(self):
method __call__ (line 451) | def __call__(
FILE: examples/community/pipeline_zero1to3.py
class CCProjection (line 58) | class CCProjection(ModelMixin, ConfigMixin):
method __init__ (line 59) | def __init__(self, in_channel=772, out_channel=768):
method forward (line 65) | def forward(self, x):
class Zero1to3StableDiffusionPipeline (line 69) | class Zero1to3StableDiffusionPipeline(DiffusionPipeline, StableDiffusion...
method __init__ (line 98) | def __init__(
method _encode_prompt (line 192) | def _encode_prompt(
method CLIP_preprocess (line 330) | def CLIP_preprocess(self, x):
method _encode_image (line 349) | def _encode_image(self, image, device, num_images_per_prompt, do_class...
method _encode_pose (line 406) | def _encode_pose(self, pose, device, num_images_per_prompt, do_classif...
method _encode_image_with_pose (line 434) | def _encode_image_with_pose(self, image, pose, device, num_images_per_...
method run_safety_checker (line 446) | def run_safety_checker(self, image, device, dtype):
method decode_latents (line 456) | def decode_latents(self, latents):
method prepare_extra_step_kwargs (line 464) | def prepare_extra_step_kwargs(self, generator, eta):
method check_inputs (line 481) | def check_inputs(self, image, height, width, callback_steps):
method prepare_latents (line 503) | def prepare_latents(self, batch_size, num_channels_latents, height, wi...
method prepare_img_latents (line 525) | def prepare_img_latents(self, image, batch_size, dtype, device, genera...
method __call__ (line 600) | def __call__(
FILE: examples/community/pipline_flux_fill_controlnet_Inpaint.py
function calculate_shift (line 87) | def calculate_shift(
function retrieve_latents (line 101) | def retrieve_latents(
function retrieve_latents_fill (line 114) | def retrieve_latents_fill(
function retrieve_timesteps (line 128) | def retrieve_timesteps(
class FluxControlNetFillInpaintPipeline (line 187) | class FluxControlNetFillInpaintPipeline(DiffusionPipeline, FluxLoraLoade...
method __init__ (line 218) | def __init__(
method _get_t5_prompt_embeds (line 264) | def _get_t5_prompt_embeds(
method _get_clip_prompt_embeds (line 314) | def _get_clip_prompt_embeds(
method encode_prompt (line 359) | def encode_prompt(
method _encode_vae_image (line 439) | def _encode_vae_image(self, image: torch.Tensor, generator: torch.Gene...
method get_timesteps (line 454) | def get_timesteps(self, num_inference_steps, strength, device):
method check_inputs (line 465) | def check_inputs(
method _prepare_latent_image_ids (line 538) | def _prepare_latent_image_ids(batch_size, height, width, device, dtype):
method _pack_latents (line 553) | def _pack_latents(latents, batch_size, num_channels_latents, height, w...
method _unpack_latents (line 562) | def _unpack_latents(latents, height, width, vae_scale_factor):
method prepare_latents (line 577) | def prepare_latents(
method prepare_mask_latents (line 630) | def prepare_mask_latents(
method prepare_image (line 702) | def prepare_image(
method prepare_mask_latents_fill (line 736) | def prepare_mask_latents_fill(
method guidance_scale (line 817) | def guidance_scale(self):
method joint_attention_kwargs (line 821) | def joint_attention_kwargs(self):
method num_timesteps (line 825) | def num_timesteps(self):
method interrupt (line 829) | def interrupt(self):
method __call__ (line 834) | def __call__(
FILE: examples/community/regional_prompting_stable_diffusion.py
class RegionalPromptingStableDiffusionPipeline (line 53) | class RegionalPromptingStableDiffusionPipeline(
method __init__ (line 105) | def __init__(
method __call__ (line 141) | def __call__(
method prepare_extra_step_kwargs (line 490) | def prepare_extra_step_kwargs(self, generator, eta):
method prepare_latents (line 508) | def prepare_latents(self, batch_size, num_channels_latents, height, wi...
method encode_prompt (line 531) | def encode_prompt(
method check_inputs (line 714) | def check_inputs(
method stable_diffusion_call (line 785) | def stable_diffusion_call(
method _encode_prompt (line 1115) | def _encode_prompt(
method encode_image (line 1238) | def encode_image(self, image, device, num_images_per_prompt, output_hi...
method prepare_ip_adapter_image_embeds (line 1263) | def prepare_ip_adapter_image_embeds(
method run_safety_checker (line 1301) | def run_safety_checker(self, image, device, dtype):
method decode_latents (line 1324) | def decode_latents(self, latents):
method guidance_scale (line 1334) | def guidance_scale(self):
method guidance_rescale (line 1338) | def guidance_rescale(self):
method get_guidance_scale_embedding (line 1342) | def get_guidance_scale_embedding(
method clip_skip (line 1373) | def clip_skip(self):
method num_timesteps (line 1377) | def num_timesteps(self):
method interrupt (line 1381) | def interrupt(self):
method cross_attention_kwargs (line 1385) | def cross_attention_kwargs(self):
method do_classifier_free_guidance (line 1389) | def do_classifier_free_guidance(self):
function promptsmaker (line 1394) | def promptsmaker(prompts, batch):
function make_cells (line 1414) | def make_cells(ratios):
function make_emblist (line 1443) | def make_emblist(self, prompts):
function split_dims (line 1456) | def split_dims(xs, height, width):
function get_attn_maps (line 1470) | def get_attn_maps(self, attn):
function reset_attnmaps (line 1493) | def reset_attnmaps(self): # init parameters in every batch
function saveattnmaps (line 1502) | def saveattnmaps(self, output, h, w, th, step, regions):
function makepmask (line 1516) | def makepmask(
function tokendealer (line 1536) | def tokendealer(self, all_prompts):
function scaled_dot_product_attention (line 1573) | def scaled_dot_product_attention(
function retrieve_timesteps (line 1608) | def retrieve_timesteps(
function rescale_noise_cfg (line 1667) | def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0):
FILE: examples/community/rerender_a_video.py
function coords_grid (line 47) | def coords_grid(b, h, w, homogeneous=False, device=None):
function bilinear_sample (line 66) | def bilinear_sample(img, sample_coords, mode="bilinear", padding_mode="z...
function flow_warp (line 90) | def flow_warp(feature, flow, mask=False, mode="bilinear", padding_mode="...
function forward_backward_consistency_check (line 99) | def forward_backward_consistency_check(fwd_flow, bwd_flow, alpha=0.01, b...
function get_warped_and_mask (line 122) | def get_warped_and_mask(flow_model, image1, image2, image3=None, pixel_c...
class TextToVideoSDPipelineOutput (line 147) | class TextToVideoSDPipelineOutput(BaseOutput):
function find_flat_region (line 161) | def find_flat_region(mask):
class AttnState (line 172) | class AttnState:
method __init__ (line 177) | def __init__(self):
method state (line 181) | def state(self):
method timestep (line 185) | def timestep(self):
method set_timestep (line 188) | def set_timestep(self, t):
method reset (line 191) | def reset(self):
method to_load (line 195) | def to_load(self):
method to_load_and_store_prev (line 198) | def to_load_and_store_prev(self):
class CrossFrameAttnProcessor (line 202) | class CrossFrameAttnProcessor(AttnProcessor):
method __init__ (line 210) | def __init__(self, attn_state: AttnState):
method __call__ (line 216) | def __call__(self, attn: Attention, hidden_states, encoder_hidden_stat...
function prepare_image (line 237) | def prepare_image(image):
class RerenderAVideoPipeline (line 261) | class RerenderAVideoPipeline(StableDiffusionControlNetImg2ImgPipeline):
method __init__ (line 298) | def __init__(
method check_inputs (line 391) | def check_inputs(
method prepare_control_image (line 497) | def prepare_control_image(
method get_timesteps (line 528) | def get_timesteps(self, num_inference_steps, strength, device):
method prepare_latents (line 538) | def prepare_latents(self, image, timestep, batch_size, num_images_per_...
method __call__ (line 596) | def __call__(
class InputPadder (line 1189) | class InputPadder:
method __init__ (line 1192) | def __init__(self, dims, mode="sintel", padding_factor=8):
method pad (line 1201) | def pad(self, *inputs):
method unpad (line 1204) | def unpad(self, x):
FILE: examples/community/run_onnx_controlnet.py
function prepare_image (line 77) | def prepare_image(image):
class OnnxStableDiffusionControlNetImg2ImgPipeline (line 101) | class OnnxStableDiffusionControlNetImg2ImgPipeline(DiffusionPipeline):
method __init__ (line 109) | def __init__(
method _encode_prompt (line 134) | def _encode_prompt(
method decode_latents (line 238) | def decode_latents(self, latents):
method prepare_extra_step_kwargs (line 252) | def prepare_extra_step_kwargs(self, generator, eta):
method check_inputs (line 269) | def check_inputs(
method check_image (line 378) | def check_image(self, image, prompt, prompt_embeds):
method prepare_control_image (line 416) | def prepare_control_image(
method get_timesteps (line 447) | def get_timesteps(self, num_inference_steps, strength, device):
method prepare_latents (line 456) | def prepare_latents(self, image, timestep, batch_size, num_images_per_...
method __call__ (line 504) | def __call__(
FILE: examples/community/run_tensorrt_controlnet.py
function load_engine (line 40) | def load_engine(trt_runtime, engine_path):
class TensorRTModel (line 47) | class TensorRTModel:
method __init__ (line 48) | def __init__(
method __call__ (line 105) | def __call__(self, **kwargs):
function prepare_image (line 181) | def prepare_image(image):
class TensorRTStableDiffusionControlNetImg2ImgPipeline (line 205) | class TensorRTStableDiffusionControlNetImg2ImgPipeline(DiffusionPipeline):
method __init__ (line 213) | def __init__(
method _encode_prompt (line 238) | def _encode_prompt(
method decode_latents (line 342) | def decode_latents(self, latents):
method prepare_extra_step_kwargs (line 356) | def prepare_extra_step_kwargs(self, generator, eta):
method check_inputs (line 373) | def check_inputs(
method check_image (line 482) | def check_image(self, image, prompt, prompt_embeds):
method prepare_control_image (line 520) | def prepare_control_image(
method get_timesteps (line 551) | def get_timesteps(self, num_inference_steps, strength, device):
method prepare_latents (line 560) | def prepare_latents(self, image, timestep, batch_size, num_images_per_...
method __call__ (line 608) | def __call__(
FILE: examples/community/scheduling_ufogen.py
class UFOGenSchedulerOutput (line 32) | class UFOGenSchedulerOutput(BaseOutput):
function betas_for_alpha_bar (line 50) | def betas_for_alpha_bar(
function rescale_zero_terminal_snr (line 95) | def rescale_zero_terminal_snr(betas):
class UFOGenScheduler (line 131) | class UFOGenScheduler(SchedulerMixin, ConfigMixin):
method __init__ (line 187) | def __init__(
method scale_model_input (line 243) | def scale_model_input(self, sample: torch.Tensor, timestep: Optional[i...
method set_timesteps (line 260) | def set_timesteps(
method _threshold_sample (line 342) | def _threshold_sample(self, sample: torch.Tensor) -> torch.Tensor:
method step (line 375) | def step(
method add_noise (line 461) | def add_noise(
method get_velocity (line 485) | def get_velocity(self, sample: torch.Tensor, noise: torch.Tensor, time...
method __len__ (line 503) | def __len__(self):
method previous_timestep (line 507) | def previous_timestep(self, timestep):
FILE: examples/community/sd_text2img_k_diffusion.py
class ModelWrapper (line 30) | class ModelWrapper:
method __init__ (line 31) | def __init__(self, model, alphas_cumprod):
method apply_model (line 35) | def apply_model(self, *args, **kwargs):
class StableDiffusionPipeline (line 44) | class StableDiffusionPipeline(DiffusionPipeline, StableDiffusionMixin):
method __init__ (line 74) | def __init__(
method set_sampler (line 114) | def set_sampler(self, scheduler_type: str):
method set_scheduler (line 118) | def set_scheduler(self, scheduler_type: str):
method _encode_prompt (line 123) | def _encode_prompt(self, prompt, device, num_images_per_prompt, do_cla...
method run_safety_checker (line 228) | def run_safety_checker(self, image, device, dtype):
method decode_latents (line 238) | def decode_latents(self, latents):
method check_inputs (line 246) | def check_inputs(self, prompt, height, width, callback_steps):
method prepare_latents (line 261) | def prepare_latents(self, batch_size, num_channels_latents, height, wi...
method __call__ (line 278) | def __call__(
FILE: examples/community/sde_drag.py
class SdeDragPipeline (line 26) | class SdeDragPipeline(DiffusionPipeline):
method __init__ (line 50) | def __init__(
method __call__ (line 63) | def __call__(
method train_lora (line 207) | def train_lora(self, prompt, image, lora_step=100, lora_rank=16, gener...
method _tokenize_prompt (line 332) | def _tokenize_prompt(self, prompt, tokenizer_max_length=None):
method _encode_prompt (line 348) | def _encode_prompt(self, input_ids, attention_mask, text_encoder_use_a...
method _get_text_embed (line 365) | def _get_text_embed(self, prompt):
method _copy_and_paste (line 376) | def _copy_and_paste(
method _get_img_latent (line 412) | def _get_img_latent(self, image, height=None, weight=None):
method _get_eps (line 425) | def _get_eps(self, latent, timestep, guidance_scale, text_embeddings, ...
method _forward_sde (line 450) | def _forward_sde(
method _sample (line 486) | def _sample(
method _forward (line 536) | def _forward(self, latent, steps, t0, lora_scale_min, text_embeddings,...
method _backward (line 572) | def _backward(
FILE: examples/community/seed_resize_stable_diffusion.py
class SeedResizeStableDiffusionPipeline (line 23) | class SeedResizeStableDiffusionPipeline(DiffusionPipeline, StableDiffusi...
method __init__ (line 51) | def __init__(
method __call__ (line 73) | def __call__(
FILE: examples/community/speech_to_image_diffusion.py
class SpeechToImagePipeline (line 30) | class SpeechToImagePipeline(DiffusionPipeline, StableDiffusionMixin):
method __init__ (line 31) | def __init__(
method __call__ (line 67) | def __call__(
FILE: examples/community/stable_diffusion_comparison.py
class StableDiffusionComparisonPipeline (line 26) | class StableDiffusionComparisonPipeline(DiffusionPipeline, StableDiffusi...
method __init__ (line 54) | def __init__(
method layers (line 84) | def layers(self) -> dict[str, Any]:
method text2img_sd1_1 (line 88) | def text2img_sd1_1(
method text2img_sd1_2 (line 125) | def text2img_sd1_2(
method text2img_sd1_3 (line 162) | def text2img_sd1_3(
method text2img_sd1_4 (line 199) | def text2img_sd1_4(
method _call_ (line 236) | def _call_(
FILE: examples/community/stable_diffusion_controlnet_img2img.py
function prepare_image (line 64) | def prepare_image(image):
function prepare_controlnet_conditioning_image (line 88) | def prepare_controlnet_conditioning_image(
class StableDiffusionControlNetImg2ImgPipeline (line 132) | class StableDiffusionControlNetImg2ImgPipeline(DiffusionPipeline, Stable...
method __init__ (line 139) | def __init__(
method _encode_prompt (line 185) | def _encode_prompt(
method run_safety_checker (line 322) | def run_safety_checker(self, image, device, dtype):
method decode_latents (line 332) | def decode_latents(self, latents):
method prepare_extra_step_kwargs (line 340) | def prepare_extra_step_kwargs(self, generator, eta):
method check_controlnet_conditioning_image (line 357) | def check_controlnet_conditioning_image(self, image, prompt, prompt_em...
method check_inputs (line 393) | def check_inputs(
method get_timesteps (line 524) | def get_timesteps(self, num_inference_steps, strength, device):
method prepare_latents (line 533) | def prepare_latents(self, image, timestep, batch_size, num_images_per_...
method _default_height_width (line 574) | def _default_height_width(self, height, width, image):
method __call__ (line 598) | def __call__(
FILE: examples/community/stable_diffusion_controlnet_inpaint.py
function prepare_image (line 127) | def prepare_image(image):
function prepare_mask_image (line 151) | def prepare_mask_image(mask_image):
function prepare_controlnet_conditioning_image (line 186) | def prepare_controlnet_conditioning_image(
class StableDiffusionControlNetInpaintPipeline (line 230) | class StableDiffusionControlNetInpaintPipeline(DiffusionPipeline, Stable...
method __init__ (line 237) | def __init__(
method _encode_prompt (line 284) | def _encode_prompt(
method run_safety_checker (line 421) | def run_safety_checker(self, image, device, dtype):
method decode_latents (line 431) | def decode_latents(self, latents):
method prepare_extra_step_kwargs (line 439) | def prepare_extra_step_kwargs(self, generator, eta):
method check_controlnet_conditioning_image (line 456) | def check_controlnet_conditioning_image(self, image, prompt, prompt_em...
method check_inputs (line 492) | def check_inputs(
method prepare_latents (line 637) | def prepare_latents(self, batch_size, num_channels_latents, height, wi...
method prepare_mask_latents (line 660) | def prepare_mask_latents(self, mask_image, batch_size, height, width, ...
method prepare_masked_image_latents (line 683) | def prepare_masked_image_latents(
method _default_height_width (line 717) | def _default_height_width(self, height, width, image):
method __call__ (line 741) | def __call__(
FILE: examples/community/stable_diffusion_controlnet_inpaint_img2img.py
function prepare_image (line 126) | def prepare_image(image):
function prepare_mask_image (line 150) | def prepare_mask_image(mask_image):
function prepare_controlnet_conditioning_image (line 185) | def prepare_controlnet_conditioning_image(
class StableDiffusionControlNetInpaintImg2ImgPipeline (line 219) | class StableDiffusionControlNetInpaintImg2ImgPipeline(DiffusionPipeline,...
method __init__ (line 226) | def __init__(
method _encode_prompt (line 269) | def _encode_prompt(
method run_safety_checker (line 406) | def run_safety_checker(self, image, device, dtype):
method decode_latents (line 416) | def decode_latents(self, latents):
method prepare_extra_step_kwargs (line 424) | def prepare_extra_step_kwargs(self, generator, eta):
method check_inputs (line 441) | def check_inputs(
method get_timesteps (line 597) | def get_timesteps(self, num_inference_steps, strength, device):
method prepare_latents (line 606) | def prepare_latents(self, image, timestep, batch_size, num_images_per_...
method prepare_mask_latents (line 647) | def prepare_mask_latents(self, mask_image, batch_size, height, width, ...
method prepare_masked_image_latents (line 670) | def prepare_masked_image_latents(
method _default_height_width (line 704) | def _default_height_width(self, height, width, image):
method __call__ (line 728) | def __call__(
FILE: examples/community/stable_diffusion_controlnet_reference.py
function torch_dfs (line 60) | def torch_dfs(model: torch.nn.Module):
class StableDiffusionControlNetReferencePipeline (line 67) | class StableDiffusionControlNetReferencePipeline(StableDiffusionControlN...
method prepare_ref_latents (line 68) | def prepare_ref_latents(self, refimage, batch_size, dtype, device, gen...
method __call__ (line 99) | def __call__(
FILE: examples/community/stable_diffusion_ipex.py
class StableDiffusionIPEXPipeline (line 63) | class StableDiffusionIPEXPipeline(
method __init__ (line 95) | def __init__(
method get_input_example (line 188) | def get_input_example(self, prompt, height=None, width=None, guidance_...
method prepare_for_ipex (line 248) | def prepare_for_ipex(self, promt, dtype=torch.float32, height=None, wi...
method _encode_prompt (line 311) | def _encode_prompt(
method run_safety_checker (line 457) | def run_safety_checker(self, image, device, dtype):
method decode_latents (line 467) | def decode_latents(self, latents):
method prepare_extra_step_kwargs (line 475) | def prepare_extra_step_kwargs(self, generator, eta):
method check_inputs (line 492) | def check_inputs(
method prepare_latents (line 539) | def prepare_latents(self, batch_size, num_channels_latents, height, wi...
method __call__ (line 563) | def __call__(
FILE: examples/community/stable_diffusion_mega.py
class StableDiffusionMegaPipeline (line 27) | class StableDiffusionMegaPipeline(DiffusionPipeline, StableDiffusionMixin):
method __init__ (line 57) | def __init__(
method components (line 95) | def components(self) -> dict[str, Any]:
method inpaint (line 99) | def inpaint(
method img2img (line 134) | def img2img(
method text2img (line 169) | def text2img(
FILE: examples/community/stable_diffusion_reference.py
function torch_dfs (line 67) | def torch_dfs(model: torch.nn.Module):
class StableDiffusionReferencePipeline (line 83) | class StableDiffusionReferencePipeline(
method __init__ (line 122) | def __init__(
method _default_height_width (line 230) | def _default_height_width(
method check_inputs (line 273) | def check_inputs(
method _encode_prompt (line 362) | def _encode_prompt(
method encode_prompt (line 412) | def encode_prompt(
method prepare_latents (line 594) | def prepare_latents(
method prepare_extra_step_kwargs (line 643) | def prepare_extra_step_kwargs(
method prepare_image (line 672) | def prepare_image(
method prepare_ref_latents (line 742) | def prepare_ref_latents(
method run_safety_checker (line 793) | def run_safety_checker(
method __call__ (line 822) | def __call__(
FILE: examples/community/stable_diffusion_repaint.py
function prepare_mask_and_masked_image (line 42) | def prepare_mask_and_masked_image(image, mask):
class StableDiffusionRepaintPipeline (line 142) | class StableDiffusionRepaintPipeline(
method __init__ (line 177) | def __init__(
method _encode_prompt (line 285) | def _encode_prompt(
method run_safety_checker (line 431) | def run_safety_checker(self, image, device, dtype):
method prepare_extra_step_kwargs (line 442) | def prepare_extra_step_kwargs(self, generator, eta):
method decode_latents (line 460) | def decode_latents(self, latents):
method check_inputs (line 469) | def check_inputs(
method prepare_latents (line 517) | def prepare_latents(
method prepare_mask_latents (line 549) | def prepare_mask_latents(
method __call__ (line 610) | def __call__(
FILE: examples/community/stable_diffusion_tensorrt_img2img.py
function preprocess_image (line 93) | def preprocess_image(image):
class Engine (line 106) | class Engine:
method __init__ (line 107) | def __init__(self, engine_path):
method __del__ (line 114) | def __del__(self):
method build (line 121) | def build(
method load (line 147) | def load(self):
method activate (line 151) | def activate(self):
method allocate_buffers (line 154) | def allocate_buffers(self, shape_dict=None, device="cuda"):
method infer (line 167) | def infer(self, feed_dict, stream):
class Optimizer (line 179) | class Optimizer:
method __init__ (line 180) | def __init__(self, onnx_graph):
method cleanup (line 183) | def cleanup(self, return_onnx=False):
method select_outputs (line 188) | def select_outputs(self, keep, names=None):
method fold_constants (line 194) | def fold_constants(self, return_onnx=False):
method infer_shapes (line 200) | def infer_shapes(self, return_onnx=False):
class BaseModel (line 212) | class BaseModel:
method __init__ (line 213) | def __init__(self, model, fp16=False, device="cuda", max_batch_size=16...
method get_model (line 229) | def get_model(self):
method get_input_names (line 232) | def get_input_names(self):
method get_output_names (line 235) | def get_output_names(self):
method get_dynamic_axes (line 238) | def get_dynamic_axes(self):
method get_sample_input (line 241) | def get_sample_input(self, batch_size, image_height, image_width):
method get_input_profile (line 244) | def get_input_profile(self, batch_size, image_height, image_width, sta...
method get_shape_dict (line 247) | def get_shape_dict(self, batch_size, image_height, image_width):
method optimize (line 250) | def optimize(self, onnx_graph):
method check_dims (line 258) | def check_dims(self, batch_size, image_height, image_width):
method get_minmax_dims (line 267) | def get_minmax_dims(self, batch_size, image_height, image_width, stati...
function getOnnxPath (line 294) | def getOnnxPath(model_name, onnx_dir, opt=True):
function getEnginePath (line 298) | def getEnginePath(model_name, engine_dir):
function build_engines (line 302) | def build_engines(
function runEngine (line 392) | def runEngine(engine, feed_dict, stream):
class CLIP (line 396) | class CLIP(BaseModel):
method __init__ (line 397) | def __init__(self, model, device, max_batch_size, embedding_dim):
method get_input_names (line 403) | def get_input_names(self):
method get_output_names (line 406) | def get_output_names(self):
method get_dynamic_axes (line 409) | def get_dynamic_axes(self):
method get_input_profile (line 412) | def get_input_profile(self, batch_size, image_height, image_width, sta...
method get_shape_dict (line 421) | def get_shape_dict(self, batch_size, image_height, image_width):
method get_sample_input (line 428) | def get_sample_input(self, batch_size, image_height, image_width):
method optimize (line 432) | def optimize(self, onnx_graph):
function make_CLIP (line 443) | def make_CLIP(model, device, max_batch_size, embedding_dim, inpaint=False):
class UNet (line 447) | class UNet(BaseModel):
method __init__ (line 448) | def __init__(
method get_input_names (line 462) | def get_input_names(self):
method get_output_names (line 465) | def get_output_names(self):
method get_dynamic_axes (line 468) | def get_dynamic_axes(self):
method get_input_profile (line 475) | def get_input_profile(self, batch_size, image_height, image_width, sta...
method get_shape_dict (line 502) | def get_shape_dict(self, batch_size, image_height, image_width):
method get_sample_input (line 510) | def get_sample_input(self, batch_size, image_height, image_width):
function make_UNet (line 522) | def make_UNet(model, device, max_batch_size, embedding_dim, inpaint=False):
class VAE (line 533) | class VAE(BaseModel):
method __init__ (line 534) | def __init__(self, model, device, max_batch_size, embedding_dim):
method get_input_names (line 540) | def get_input_names(self):
method get_output_names (line 543) | def get_output_names(self):
method get_dynamic_axes (line 546) | def get_dynamic_axes(self):
method get_input_profile (line 549) | def get_input_profile(self, batch_size, image_height, image_width, sta...
method get_shape_dict (line 571) | def get_shape_dict(self, batch_size, image_height, image_width):
method get_sample_input (line 578) | def get_sample_input(self, batch_size, image_height, image_width):
function make_VAE (line 583) | def make_VAE(model, device, max_batch_size, embedding_dim, inpaint=False):
class TorchVAEEncoder (line 587) | class TorchVAEEncoder(torch.nn.Module):
method __init__ (line 588) | def __init__(self, model):
method forward (line 592) | def forward(self, x):
class VAEEncoder (line 596) | class VAEEncoder(BaseModel):
method __init__ (line 597) | def __init__(self, model, device, max_batch_size, embedding_dim):
method get_model (line 603) | def get_model(self):
method get_input_names (line 607) | def get_input_names(self):
method get_output_names (line 610) | def get_output_names(self):
method get_dynamic_axes (line 613) | def get_dynamic_axes(self):
method get_input_profile (line 616) | def get_input_profile(self, batch_size, image_height, image_width, sta...
method get_shape_dict (line 642) | def get_shape_dict(self, batch_size, image_height, image_width):
method get_sample_input (line 649) | def get_sample_input(self, batch_size, image_height, image_width):
function make_VAEEncoder (line 654) | def make_VAEEncoder(model, device, max_batch_size, embedding_dim, inpain...
class TensorRTStableDiffusionImg2ImgPipeline (line 658) | class TensorRTStableDiffusionImg2ImgPipeline(DiffusionPipeline):
method __init__ (line 688) | def __init__(
method __loadModels (line 817) | def __loadModels(self):
method run_safety_checker (line 836) | def run_safety_checker(
method set_cached_folder (line 864) | def set_cached_folder(cls, pretrained_model_name_or_path: Optional[Uni...
method to (line 884) | def to(self, torch_device: Optional[Union[str, torch.device]] = None, ...
method __initialize_timesteps (line 914) | def __initialize_timesteps(self, timesteps, strength):
method __preprocess_images (line 923) | def __preprocess_images(self, batch_size, images=()):
method __encode_image (line 931) | def __encode_image(self, init_image):
method __encode_prompt (line 936) | def __encode_prompt(self, prompt, negative_prompt):
method __denoise_latent (line 987) | def __denoise_latent(
method __decode_latent (line 1017) | def __decode_latent(self, latents):
method __loadResources (line 1022) | def __loadResources(self, image_height, image_width, batch_size):
method __call__ (line 1032) | def __call__(
FILE: examples/community/stable_diffusion_tensorrt_inpaint.py
function preprocess_image (line 97) | def preprocess_image(image):
class Engine (line 110) | class Engine:
method __init__ (line 111) | def __init__(self, engine_path):
method __del__ (line 118) | def __del__(self):
method build (line 125) | def build(
method load (line 151) | def load(self):
method activate (line 155) | def activate(self):
method allocate_buffers (line 158) | def allocate_buffers(self, shape_dict=None, device="cuda"):
method infer (line 171) | def infer(self, feed_dict, stream):
class Optimizer (line 183) | class Optimizer:
method __init__ (line 184) | def __init__(self, onnx_graph):
method cleanup (line 187) | def cleanup(self, return_onnx=False):
method select_outputs (line 192) | def select_outputs(self, keep, names=None):
method fold_constants (line 198) | def fold_constants(self, return_onnx=False):
method infer_shapes (line 204) | def infer_shapes(self, return_onnx=False):
class BaseModel (line 216) | class BaseModel:
method __init__ (line 217) | def __init__(self, model, fp16=False, device="cuda", max_batch_size=16...
method get_model (line 233) | def get_model(self):
method get_input_names (line 236) | def get_input_names(self):
method get_output_names (line 239) | def get_output_names(self):
method get_dynamic_axes (line 242) | def get_dynamic_axes(self):
method get_sample_input (line 245) | def get_sample_input(self, batch_size, image_height, image_width):
method get_input_profile (line 248) | def get_input_profile(self, batch_size, image_height, image_width, sta...
method get_shape_dict (line 251) | def get_shape_dict(self, batch_size, image_height, image_width):
method optimize (line 254) | def optimize(self, onnx_graph):
method check_dims (line 262) | def check_dims(self, batch_size, image_height, image_width):
method get_minmax_dims (line 271) | def get_minmax_dims(self, batch_size, image_height, image_width, stati...
function getOnnxPath (line 298) | def getOnnxPath(model_name, onnx_dir, opt=True):
function getEnginePath (line 302) | def getEnginePath(model_name, engine_dir):
function build_engines (line 306) | def build_engines(
function runEngine (line 396) | def runEngine(engine, feed_dict, stream):
class CLIP (line 400) | class CLIP(BaseModel):
method __init__ (line 401) | def __init__(self, model, device, max_batch_size, embedding_dim):
method get_input_names (line 407) | def get_input_names(self):
method get_output_names (line 410) | def get_output_names(self):
method get_dynamic_axes (line 413) | def get_dynamic_axes(self):
method get_input_profile (line 416) | def get_input_profile(self, batch_size, image_height, image_width, sta...
method get_shape_dict (line 425) | def get_shape_dict(self, batch_size, image_height, image_width):
method get_sample_input (line 432) | def get_sample_input(self, batch_size, image_height, image_width):
method optimize (line 436) | def optimize(self, onnx_graph):
function make_CLIP (line 447) | def make_CLIP(model, device, max_batch_size, embedding_dim, inpaint=False):
class UNet (line 451) | class UNet(BaseModel):
method __init__ (line 452) | def __init__(
method get_input_names (line 466) | def get_input_names(self):
method get_output_names (line 469) | def get_output_names(self):
method get_dynamic_axes (line 472) | def get_dynamic_axes(self):
method get_input_profile (line 479) | def get_input_profile(self, batch_size, image_height, image_width, sta...
method get_shape_dict (line 506) | def get_shape_dict(self, batch_size, image_height, image_width):
method get_sample_input (line 514) | def get_sample_input(self, batch_size, image_height, image_width):
function make_UNet (line 526) | def make_UNet(model, device, max_batch_size, embedding_dim, inpaint=Fals...
class VAE (line 537) | class VAE(BaseModel):
method __init__ (line 538) | def __init__(self, model, device, max_batch_size, embedding_dim):
method get_input_names (line 544) | def get_input_names(self):
method get_output_names (line 547) | def get_output_names(self):
method get_dynamic_axes (line 550) | def get_dynamic_axes(self):
method get_input_profile (line 553) | def get_input_profile(self, batch_size, image_height, image_width, sta...
method get_shape_dict (line 575) | def get_shape_dict(self, batch_size, image_height, image_width):
method get_sample_input (line 582) | def get_sample_input(self, batch_size, image_height, image_width):
function make_VAE (line 587) | def make_VAE(model, device, max_batch_size, embedding_dim, inpaint=False):
class TorchVAEEncoder (line 591) | class TorchVAEEncoder(torch.nn.Module):
method __init__ (line 592) | def __init__(self, model):
method forward (line 596) | def forward(self, x):
class VAEEncoder (line 600) | class VAEEncoder(BaseModel):
method __init__ (line 601) | def __init__(self, model, device, max_batch_size, embedding_dim):
method get_model (line 607) | def get_model(self):
method get_input_names (line 611) | def get_input_names(self):
method get_output_names (line 614) | def get_output_names(self):
method get_dynamic_axes (line 617) | def get_dynamic_axes(self):
method get_input_profile (line 620) | def get_input_profile(self, batch_size, image_height, image_width, sta...
method get_shape_dict (line 646) | def get_shape_dict(self, batch_size, image_height, image_width):
method get_sample_input (line 653) | def get_sample_input(self, batch_size, image_height, image_width):
function make_VAEEncoder (line 658) | def make_VAEEncoder(model, device, max_batch_size, embedding_dim, inpain...
class TensorRTStableDiffusionInpaintPipeline (line 662) | class TensorRTStableDiffusionInpaintPipeline(DiffusionPipeline):
method __init__ (line 692) | def __init__(
method __loadModels (line 821) | def __loadModels(self):
method _encode_vae_image (line 841) | def _encode_vae_image(self, image: torch.Tensor, generator: torch.Gene...
method prepare_latents (line 855) | def prepare_latents(
method run_safety_checker (line 919) | def run_safety_checker(
method set_cached_folder (line 947) | def set_cached_folder(cls, pretrained_model_name_or_path: Optional[Uni...
method to (line 967) | def to(self, torch_device: Optional[Union[str, torch.device]] = None, ...
method __initialize_timesteps (line 997) | def __initialize_timesteps(self, num_inference_steps, strength):
method __preprocess_images (line 1006) | def __preprocess_images(self, batch_size, images=()):
method __encode_image (line 1014) | def __encode_image(self, init_image):
method __encode_prompt (line 1019) | def __encode_prompt(self, prompt, negative_prompt):
method __denoise_latent (line 1070) | def __denoise_latent(
method __decode_latent (line 1100) | def __decode_latent(self, latents):
method __loadResources (line 1105) | def __loadResources(self, image_height, image_width, batch_size):
method __call__ (line 1115) | def __call__(
FILE: examples/community/stable_diffusion_tensorrt_txt2img.py
class Engine (line 93) | class Engine:
method __init__ (line 94) | def __init__(self, engine_path):
method __del__ (line 101) | def __del__(self):
method build (line 108) | def build(
method load (line 134) | def load(self):
method activate (line 138) | def activate(self):
method allocate_buffers (line 141) | def allocate_buffers(self, shape_dict=None, device="cuda"):
method infer (line 154) | def infer(self, feed_dict, stream):
class Optimizer (line 166) | class Optimizer:
method __init__ (line 167) | def __init__(self, onnx_graph):
method cleanup (line 170) | def cleanup(self, return_onnx=False):
method select_outputs (line 175) | def select_outputs(self, keep, names=None):
method fold_constants (line 181) | def fold_constants(self, return_onnx=False):
method infer_shapes (line 187) | def infer_shapes(self, return_onnx=False):
class BaseModel (line 199) | class BaseModel:
method __init__ (line 200) | def __init__(self, model, fp16=False, device="cuda", max_batch_size=16...
method get_model (line 216) | def get_model(self):
method get_input_names (line 219) | def get_input_names(self):
method get_output_names (line 222) | def get_output_names(self):
method get_dynamic_axes (line 225) | def get_dynamic_axes(self):
method get_sample_input (line 228) | def get_sample_input(self, batch_size, image_height, image_width):
method get_input_profile (line 231) | def get_input_profile(self, batch_size, image_height, image_width, sta...
method get_shape_dict (line 234) | def get_shape_dict(self, batch_size, image_height, image_width):
method optimize (line 237) | def optimize(self, onnx_graph):
method check_dims (line 245) | def check_dims(self, batch_size, image_height, image_width):
method get_minmax_dims (line 254) | def get_minmax_dims(self, batch_size, image_height, image_width, stati...
function getOnnxPath (line 281) | def getOnnxPath(model_name, onnx_dir, opt=True):
function getEnginePath (line 285) | def getEnginePath(model_name, engine_dir):
function build_engines (line 289) | def build_engines(
function runEngine (line 379) | def runEngine(engine, feed_dict, stream):
class CLIP (line 383) | class CLIP(BaseModel):
method __init__ (line 384) | def __init__(self, model, device, max_batch_size, embedding_dim):
method get_input_names (line 390) | def get_input_names(self):
method get_output_names (line 393) | def get_output_names(self):
method get_dynamic_axes (line 396) | def get_dynamic_axes(self):
method get_input_profile (line 399) | def get_input_profile(self, batch_size, image_height, image_width, sta...
method get_shape_dict (line 408) | def get_shape_dict(self, batch_size, image_height, image_width):
method get_sample_input (line 415) | def get_sample_input(self, batch_size, image_height, image_width):
method optimize (line 419) | def optimize(self, onnx_graph):
function make_CLIP (line 430) | def make_CLIP(model, device, max_batch_size, embedding_dim, inpaint=False):
class UNet (line 434) | class UNet(BaseModel):
method __init__ (line 435) | def __init__(
method get_input_names (line 449) | def get_input_names(self):
method get_output_names (line 452) | def get_output_names(self):
method get_dynamic_axes (line 455) | def get_dynamic_axes(self):
method get_input_profile (line 462) | def get_input_profile(self, batch_size, image_height, image_width, sta...
method get_shape_dict (line 489) | def get_shape_dict(self, batch_size, image_height, image_width):
method get_sample_input (line 497) | def get_sample_input(self, batch_size, image_height, image_width):
function make_UNet (line 509) | def make_UNet(model, device, max_batch_size, embedding_dim, inpaint=False):
class VAE (line 520) | class VAE(BaseModel):
method __init__ (line 521) | def __init__(self, model, device, max_batch_size, embedding_dim):
method get_input_names (line 527) | def get_input_names(self):
method get_output_names (line 530) | def get_output_names(self):
method get_dynamic_axes (line 533) | def get_dynamic_axes(self):
method get_input_profile (line 536) | def get_input_profile(self, batch_size, image_height, image_width, sta...
method get_shape_dict (line 558) | def get_shape_dict(self, batch_size, image_height, image_width):
method get_sample_input (line 565) | def get_sample_input(self, batch_size, image_height, image_width):
function make_VAE (line 570) | def make_VAE(model, device, max_batch_size, embedding_dim, inpaint=False):
class TensorRTStableDiffusionPipeline (line 574) | class TensorRTStableDiffusionPipeline(DiffusionPipeline):
method __init__ (line 604) | def __init__(
method __loadModels (line 733) | def __loadModels(self):
method prepare_latents (line 750) | def prepare_latents(
method run_safety_checker (line 792) | def run_safety_checker(
method set_cached_folder (line 820) | def set_cached_folder(cls, pretrained_model_name_or_path: Optional[Uni...
method to (line 840) | def to(self, torch_device: Optional[Union[str, torch.device]] = None, ...
method __encode_prompt (line 870) | def __encode_prompt(self, prompt, negative_prompt):
method __denoise_latent (line 921) | def __denoise_latent(
method __decode_latent (line 951) | def __decode_latent(self, latents):
method __loadResources (line 956) | def __loadResources(self, image_height, image_width, batch_size):
method __call__ (line 966) | def __call__(
FILE: examples/community/stable_diffusion_xl_controlnet_reference.py
function torch_dfs (line 83) | def torch_dfs(model: torch.nn.Module):
function retrieve_timesteps (line 91) | def retrieve_timesteps(
class StableDiffusionXLControlNetReferencePipeline (line 150) | class StableDiffusionXLControlNetReferencePipeline(StableDiffusionXLCont...
method prepare_ref_latents (line 194) | def prepare_ref_latents(self, refimage, batch_size, dtype, device, gen...
method prepare_ref_image (line 234) | def prepare_ref_image(
method check_ref_inputs (line 287) | def check_ref_inputs(
method __call__ (line 323) | def __call__(
FILE: examples/community/stable_diffusion_xl_reference.py
function torch_dfs (line 57) | def torch_dfs(model: torch.nn.Module):
function rescale_noise_cfg (line 65) | def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0):
function retrieve_timesteps (line 80) | def retrieve_timesteps(
class StableDiffusionXLReferencePipeline (line 139) | class StableDiffusionXLReferencePipeline(StableDiffusionXLPipeline):
method prepare_ref_latents (line 140) | def prepare_ref_latents(self, refimage, batch_size, dtype, device, gen...
method prepare_ref_image (line 180) | def prepare_ref_image(
method check_ref_inputs (line 233) | def check_ref_inputs(
method __call__ (line 269) | def __call__(
FILE: examples/community/stable_unclip.py
function _encode_image (line 18) | def _encode_image(self, image, device, num_images_per_prompt, do_classif...
class StableUnCLIPPipeline (line 39) | class StableUnCLIPPipeline(DiffusionPipeline):
method __init__ (line 40) | def __init__(
method _encode_prompt (line 68) | def _encode_prompt(
method _execution_device (line 153) | def _execution_device(self):
method prepare_latents (line 170) | def prepare_latents(self, shape, dtype, device, generator, latents, sc...
method to (line 181) | def to(self, torch_device: Optional[Union[str, torch.device]] = None):
method __call__ (line 186) | def __call__(
FILE: examples/community/text_inpainting.py
class TextInpainting (line 26) | class TextInpainting(DiffusionPipeline, StableDiffusionMixin):
method __init__ (line 60) | def __init__(
method __call__ (line 125) | def __call__(
FILE: examples/community/tiled_upscaling.py
function make_transparency_mask (line 29) | def make_transparency_mask(size, overlap_pixels, remove_borders=[]):
function clamp (line 52) | def clamp(n, smallest, largest):
function clamp_rect (line 56) | def clamp_rect(rect: [int], min: [int], max: [int]):
function add_overlap_rect (line 65) | def add_overlap_rect(rect: [int], overlap: int, image_size: [int]):
function squeeze_tile (line 75) | def squeeze_tile(tile, original_image, original_slice, slice_x):
function unsqueeze_tile (line 87) | def unsqueeze_tile(tile, original_image_slice):
function next_divisible (line 93) | def next_divisible(n, d):
class StableDiffusionTiledUpscalePipeline (line 98) | class StableDiffusionTiledUpscalePipeline(StableDiffusionUpscalePipeline):
method __init__ (line 125) | def __init__(
method _process_tile (line 145) | def _process_tile(self, original_image_slice, x, y, tile_size, tile_bo...
method __call__ (line 185) | def __call__(
function main (line 282) | def main():
FILE: examples/community/unclip_image_interpolation.py
function slerp (line 29) | def slerp(val, low, high):
class UnCLIPImageInterpolationPipeline (line 41) | class UnCLIPImageInterpolationPipeline(DiffusionPipeline):
method __init__ (line 88) | def __init__(
method prepare_latents (line 117) | def prepare_latents(self, shape, dtype, device, generator, latents, sc...
method _encode_prompt (line 129) | def _encode_prompt(self, prompt, device, num_images_per_prompt, do_cla...
method _encode_image (line 193) | def _encode_image(self, image, device, num_images_per_prompt, image_em...
method __call__ (line 208) | def __call__(
FILE: examples/community/unclip_text_interpolation.py
function slerp (line 25) | def slerp(val, low, high):
class UnCLIPTextInterpolationPipeline (line 37) | class UnCLIPTextInterpolationPipeline(DiffusionPipeline):
method __init__ (line 82) | def __init__(
method prepare_latents (line 111) | def prepare_latents(self, shape, dtype, device, generator, latents, sc...
method _encode_prompt (line 123) | def _encode_prompt(
method __call__ (line 215) | def __call__(
FILE: examples/community/wildcard_stable_diffusion.py
function get_filename (line 25) | def get_filename(path: str):
function read_wildcard_values (line 30) | def read_wildcard_values(path: str):
function grab_wildcard_values (line 35) | def grab_wildcard_values(wildcard_option_dict: Dict[str, List[str]] = {}...
function replace_prompt_with_wildcards (line 45) | def replace_prompt_with_wildcards(
class WildcardStableDiffusionOutput (line 62) | class WildcardStableDiffusionOutput(StableDiffusionPipelineOutput):
class WildcardStableDiffusionPipeline (line 66) | class WildcardStableDiffusionPipeline(DiffusionPipeline, StableDiffusion...
method __init__ (line 111) | def __init__(
method __call__ (line 158) | def __call__(
FILE: examples/conftest.py
function pytest_addoption (line 39) | def pytest_addoption(parser):
function pytest_terminal_summary (line 45) | def pytest_terminal_summary(terminalreporter):
FILE: examples/consistency_distillation/test_lcm_lora.py
class TextToImageLCM (line 35) | class TextToImageLCM(ExamplesTestsAccelerate):
method test_text_to_image_lcm_lora_sdxl (line 36) | def test_text_to_image_lcm_lora_sdxl(self):
method test_text_to_image_lcm_lora_sdxl_checkpointing (line 63) | def test_text_to_image_lcm_lora_sdxl_checkpointing(self):
FILE: examples/consistency_distillation/train_lcm_distill_lora_sd_wds.py
function get_module_kohya_state_dict (line 82) | def get_module_kohya_state_dict(module, prefix: str, dtype: torch.dtype,...
function filter_keys (line 99) | def filter_keys(key_set):
function group_by_keys_nothrow (line 106) | def group_by_keys_nothrow(data, keys=base_plus_ext, lcase=True, suffixes...
function tarfile_to_samples_nothrow (line 134) | def tarfile_to_samples_nothrow(src, handler=wds.warn_and_continue):
class WebdatasetFilter (line 142) | class WebdatasetFilter:
method __init__ (line 143) | def __init__(self, min_size=1024, max_pwatermark=0.5):
method __call__ (line 147) | def __call__(self, x):
class SDText2ImageDataset (line 162) | class SDText2ImageDataset:
method __init__ (line 163) | def __init__(
method train_dataset (line 233) | def train_dataset(self):
method train_dataloader (line 237) | def train_dataloader(self):
function log_validation (line 241) | def log_validation(vae, unet, args, accelerator, weight_dtype, step):
function guidance_scale_embedding (line 327) | def guidance_scale_embedding(w, embedding_dim=512, dtype=torch.float32):
function append_dims (line 356) | def append_dims(x, target_dims):
function scalings_for_boundary_conditions (line 365) | def scalings_for_boundary_conditions(timestep, sigma_data=0.5, timestep_...
function get_predicted_original_sample (line 373) | def get_predicted_original_sample(model_output, timesteps, sample, predi...
function get_predicted_noise (line 392) | def get_predicted_noise(model_output, timesteps, sample, prediction_type...
function extract_into_tensor (line 410) | def extract_into_tensor(a, t, x_shape):
class DDIMSolver (line 416) | class DDIMSolver:
method __init__ (line 417) | def __init__(self, alpha_cumprods, timesteps=1000, ddim_timesteps=50):
method to (line 430) | def to(self, device):
method ddim_step (line 436) | def ddim_step(self, pred_x0, pred_noise, timestep_index):
function update_ema (lin
Copy disabled (too large)
Download .json
Condensed preview — 2484 files, each showing path, character count, and a content snippet. Download the .json file for the full structured content (16,327K chars).
[
{
"path": ".ai/AGENTS.md",
"chars": 1981,
"preview": "# Diffusers — Agent Guide\n\n## Coding style\n\nStrive to write code as simple and explicit as possible.\n\n- Minimize small h"
},
{
"path": ".ai/skills/model-integration/SKILL.md",
"chars": 9631,
"preview": "---\nname: integrating-models\ndescription: >\n Use when adding a new model or pipeline to diffusers, setting up file\n st"
},
{
"path": ".ai/skills/model-integration/modular-conversion.md",
"chars": 5589,
"preview": "# Modular Pipeline Conversion Reference\n\n## When to use\n\nModular pipelines break a monolithic `__call__` into composable"
},
{
"path": ".ai/skills/parity-testing/SKILL.md",
"chars": 10700,
"preview": "---\nname: testing-parity\ndescription: >\n Use when debugging or verifying numerical parity between pipeline\n implementa"
},
{
"path": ".ai/skills/parity-testing/checkpoint-mechanism.md",
"chars": 3853,
"preview": "# Checkpoint Mechanism for Stage Testing\n\n## Overview\n\nPipelines are monolithic `__call__` methods -- you can't just cal"
},
{
"path": ".ai/skills/parity-testing/pitfalls.md",
"chars": 8265,
"preview": "# Complete Pitfalls Reference\n\n## 1. Global CPU RNG\n`MultivariateNormal.sample()` uses the global CPU RNG, not `torch.Ge"
},
{
"path": ".github/ISSUE_TEMPLATE/bug-report.yml",
"chars": 5189,
"preview": "name: \"\\U0001F41B Bug Report\"\ndescription: Report a bug on Diffusers\nlabels: [ \"bug\" ]\nbody:\n - type: markdown\n attr"
},
{
"path": ".github/ISSUE_TEMPLATE/config.yml",
"chars": 172,
"preview": "contact_links:\n - name: Questions / Discussions\n url: https://github.com/huggingface/diffusers/discussions\n about"
},
{
"path": ".github/ISSUE_TEMPLATE/feature_request.md",
"chars": 612,
"preview": "---\nname: \"\\U0001F680 Feature Request\"\nabout: Suggest an idea for this project\ntitle: ''\nlabels: ''\nassignees: ''\n\n---\n\n"
},
{
"path": ".github/ISSUE_TEMPLATE/feedback.md",
"chars": 299,
"preview": "---\nname: \"💬 Feedback about API Design\"\nabout: Give feedback about the current API design\ntitle: ''\nlabels: ''\nassignees"
},
{
"path": ".github/ISSUE_TEMPLATE/new-model-addition.yml",
"chars": 1228,
"preview": "name: \"\\U0001F31F New Model/Pipeline/Scheduler Addition\"\ndescription: Submit a proposal/request to implement a new diffu"
},
{
"path": ".github/ISSUE_TEMPLATE/remote-vae-pilot-feedback.yml",
"chars": 1165,
"preview": "name: \"\\U0001F31F Remote VAE\"\ndescription: Feedback for remote VAE pilot\nlabels: [ \"Remote VAE\" ]\n\nbody:\n - type: texta"
},
{
"path": ".github/ISSUE_TEMPLATE/translate.md",
"chars": 1593,
"preview": "---\nname: 🌐 Translating a New Language?\nabout: Start a new translation effort in your language\ntitle: '[<languageCode>] "
},
{
"path": ".github/PULL_REQUEST_TEMPLATE.md",
"chars": 2941,
"preview": "# What does this PR do?\n\n<!--\nCongratulations! You've made it this far! You're not quite done yet though.\n\nOnce merged, "
},
{
"path": ".github/actions/setup-miniconda/action.yml",
"chars": 6722,
"preview": "name: Set up conda environment for testing\n\ndescription: Sets up miniconda in your ${RUNNER_TEMP} environment and gives "
},
{
"path": ".github/workflows/benchmark.yml",
"chars": 2135,
"preview": "name: Benchmarking tests\n\non:\n workflow_dispatch:\n schedule:\n - cron: \"30 1 1,15 * *\" # every 2 weeks on the 1st an"
},
{
"path": ".github/workflows/build_docker_images.yml",
"chars": 3787,
"preview": "name: Test, build, and push Docker images\n\non:\n pull_request: # During PRs, we just check if the changes Dockerfiles ca"
},
{
"path": ".github/workflows/build_documentation.yml",
"chars": 636,
"preview": "name: Build documentation\n\non:\n push:\n branches:\n - main\n - doc-builder*\n - v*-release\n - v*-pat"
},
{
"path": ".github/workflows/build_pr_documentation.yml",
"chars": 1259,
"preview": "name: Build PR Documentation\n\non:\n pull_request:\n paths:\n - \"src/diffusers/**.py\"\n - \"examples/**\"\n -"
},
{
"path": ".github/workflows/codeql.yml",
"chars": 530,
"preview": "---\nname: CodeQL Security Analysis For Github Actions\n\non:\n push:\n branches: [\"main\"]\n workflow_dispatch:\n # pull_"
},
{
"path": ".github/workflows/mirror_community_pipeline.yml",
"chars": 3612,
"preview": "name: Mirror Community Pipeline\n\non:\n # Push changes on the main branch\n push:\n branches:\n - main\n paths:\n "
},
{
"path": ".github/workflows/nightly_tests.yml",
"chars": 22807,
"preview": "name: Nightly and release tests on main/release branch\n\non:\n workflow_dispatch:\n schedule:\n - cron: \"0 0 * * *\" # e"
},
{
"path": ".github/workflows/notify_slack_about_release.yml",
"chars": 479,
"preview": "name: Notify Slack about a release\n\non:\n workflow_dispatch:\n release:\n types: [published]\n\njobs:\n build:\n runs-"
},
{
"path": ".github/workflows/pr_dependency_test.yml",
"chars": 693,
"preview": "name: Run dependency tests\n\non:\n pull_request:\n branches:\n - main\n paths:\n - \"src/diffusers/**.py\"\n pu"
},
{
"path": ".github/workflows/pr_modular_tests.yml",
"chars": 4596,
"preview": "\nname: Fast PR tests for Modular\n\non:\n pull_request:\n branches: [main]\n paths:\n - \"src/diffusers/modular_pip"
},
{
"path": ".github/workflows/pr_style_bot.yml",
"chars": 336,
"preview": "name: PR Style Bot\n\non:\n issue_comment:\n types: [created]\n\npermissions:\n contents: write\n pull-requests: write\n\njo"
},
{
"path": ".github/workflows/pr_test_fetcher.yml",
"chars": 5155,
"preview": "name: Fast tests for PRs - Test Fetcher\n\non: workflow_dispatch\n\nenv:\n DIFFUSERS_IS_CI: yes\n OMP_NUM_THREADS: 4\n MKL_N"
},
{
"path": ".github/workflows/pr_tests.yml",
"chars": 8446,
"preview": "name: Fast tests for PRs\n\non:\n pull_request:\n branches: [main]\n paths:\n - \"src/diffusers/**.py\"\n - \"ben"
},
{
"path": ".github/workflows/pr_tests_gpu.yml",
"chars": 10136,
"preview": "name: Fast GPU Tests on PR\n\npermissions:\n contents: read\n\non:\n pull_request:\n branches: main\n paths:\n - \"sr"
},
{
"path": ".github/workflows/pr_torch_dependency_test.yml",
"chars": 734,
"preview": "name: Run Torch dependency tests\n\non:\n pull_request:\n branches:\n - main\n paths:\n - \"src/diffusers/**.py"
},
{
"path": ".github/workflows/push_tests.yml",
"chars": 8865,
"preview": "name: Fast GPU Tests on main\n\non:\n workflow_dispatch:\n push:\n branches:\n - main\n paths:\n - \"src/diffus"
},
{
"path": ".github/workflows/push_tests_fast.yml",
"chars": 2395,
"preview": "name: Fast tests on main\n\non:\n push:\n branches:\n - main\n paths:\n - \"src/diffusers/**.py\"\n - \"examp"
},
{
"path": ".github/workflows/push_tests_mps.yml",
"chars": 1926,
"preview": "name: Fast mps tests on main\n\non:\n workflow_dispatch:\n\nenv:\n DIFFUSERS_IS_CI: yes\n HF_HOME: /mnt/cache\n OMP_NUM_THRE"
},
{
"path": ".github/workflows/pypi_publish.yaml",
"chars": 2824,
"preview": "# Adapted from https://blog.deepjyoti30.dev/pypi-release-github-action\n\nname: PyPI release\n\non:\n workflow_dispatch:\n p"
},
{
"path": ".github/workflows/release_tests_fast.yml",
"chars": 11675,
"preview": "# Duplicate workflow to push_tests.yml that is meant to run on release/patch branches as a final check\n# Creating a dupl"
},
{
"path": ".github/workflows/run_tests_from_a_pr.yml",
"chars": 1957,
"preview": "name: Check running SLOW tests from a PR (only GPU)\n\non:\n workflow_dispatch:\n inputs:\n docker_image:\n de"
},
{
"path": ".github/workflows/ssh-pr-runner.yml",
"chars": 1067,
"preview": "name: SSH into PR runners\n\non:\n workflow_dispatch:\n inputs:\n docker_image:\n description: 'Name of the Do"
},
{
"path": ".github/workflows/ssh-runner.yml",
"chars": 1453,
"preview": "name: SSH into GPU runners\n\non:\n workflow_dispatch:\n inputs:\n runner_type:\n description: 'Type of runner"
},
{
"path": ".github/workflows/stale.yml",
"chars": 612,
"preview": "name: Stale Bot\n\non:\n schedule:\n - cron: \"0 15 * * *\"\n\njobs:\n close_stale_issues:\n name: Close Stale Issues\n "
},
{
"path": ".github/workflows/trufflehog.yml",
"chars": 315,
"preview": "on:\n push:\n\nname: Secret Leaks\n\njobs:\n trufflehog:\n runs-on: ubuntu-22.04\n steps:\n - name: Checkout code\n "
},
{
"path": ".github/workflows/typos.yml",
"chars": 197,
"preview": "name: Check typos\n\non:\n workflow_dispatch:\n\njobs:\n build:\n runs-on: ubuntu-22.04\n\n steps:\n - uses: actions/"
},
{
"path": ".github/workflows/update_metadata.yml",
"chars": 613,
"preview": "name: Update Diffusers metadata\n\non:\n workflow_dispatch:\n push:\n branches:\n - main\n - update_diffusers_me"
},
{
"path": ".github/workflows/upload_pr_documentation.yml",
"chars": 383,
"preview": "name: Upload PR Documentation\n\non:\n workflow_run:\n workflows: [\"Build PR Documentation\"]\n types:\n - complete"
},
{
"path": ".gitignore",
"chars": 1995,
"preview": "# Initially taken from GitHub's Python gitignore file\n\n# Byte-compiled / optimized / DLL files\n__pycache__/\n*.py[cod]\n*$"
},
{
"path": "CITATION.cff",
"chars": 1325,
"preview": "cff-version: 1.2.0\ntitle: 'Diffusers: State-of-the-art diffusion models'\nmessage: >-\n If you use this software, please "
},
{
"path": "CODE_OF_CONDUCT.md",
"chars": 5324,
"preview": "\n# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nWe as members, contributors, and leaders pledge to make particip"
},
{
"path": "LICENSE",
"chars": 11357,
"preview": " Apache License\n Version 2.0, January 2004\n "
},
{
"path": "MANIFEST.in",
"chars": 67,
"preview": "include LICENSE\ninclude src/diffusers/utils/model_card_template.md\n"
},
{
"path": "Makefile",
"chars": 3242,
"preview": ".PHONY: deps_table_update modified_only_fixup extra_style_checks quality style fixup fix-copies test test-examples codex"
},
{
"path": "PHILOSOPHY.md",
"chars": 15330,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "README.md",
"chars": 14365,
"preview": "<!---\nCopyright 2022 - The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \""
},
{
"path": "_typos.toml",
"chars": 407,
"preview": "# Files for typos\n# Instruction: https://github.com/marketplace/actions/typos-action#getting-started\n\n[default.extend-i"
},
{
"path": "benchmarks/README.md",
"chars": 2538,
"preview": "# Diffusers Benchmarks\n\nWelcome to Diffusers Benchmarks. These benchmarks are use to obtain latency and memory informati"
},
{
"path": "benchmarks/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "benchmarks/benchmarking_flux.py",
"chars": 3785,
"preview": "from functools import partial\n\nimport torch\nfrom benchmarking_utils import BenchmarkMixin, BenchmarkScenario, model_init"
},
{
"path": "benchmarks/benchmarking_ltx.py",
"chars": 2986,
"preview": "from functools import partial\n\nimport torch\nfrom benchmarking_utils import BenchmarkMixin, BenchmarkScenario, model_init"
},
{
"path": "benchmarks/benchmarking_sdxl.py",
"chars": 2929,
"preview": "from functools import partial\n\nimport torch\nfrom benchmarking_utils import BenchmarkMixin, BenchmarkScenario, model_init"
},
{
"path": "benchmarks/benchmarking_utils.py",
"chars": 8069,
"preview": "import gc\nimport inspect\nimport logging\nimport os\nimport queue\nimport threading\nfrom contextlib import nullcontext\nfrom "
},
{
"path": "benchmarks/benchmarking_wan.py",
"chars": 2736,
"preview": "from functools import partial\n\nimport torch\nfrom benchmarking_utils import BenchmarkMixin, BenchmarkScenario, model_init"
},
{
"path": "benchmarks/push_results.py",
"chars": 2359,
"preview": "import os\n\nimport pandas as pd\nfrom huggingface_hub import hf_hub_download, upload_file\nfrom huggingface_hub.utils impor"
},
{
"path": "benchmarks/requirements.txt",
"chars": 64,
"preview": "pandas \npsutil\ngpustat\ntorchprofile\nbitsandbytes\npsycopg2==2.9.9"
},
{
"path": "benchmarks/run_all.py",
"chars": 2684,
"preview": "import glob\nimport logging\nimport os\nimport subprocess\n\nimport pandas as pd\n\n\nlogging.basicConfig(level=logging.INFO, fo"
},
{
"path": "docker/diffusers-doc-builder/Dockerfile",
"chars": 1066,
"preview": "FROM python:3.10-slim\nENV PYTHONDONTWRITEBYTECODE=1\nLABEL maintainer=\"Hugging Face\"\nLABEL repository=\"diffusers\"\n\nENV DE"
},
{
"path": "docker/diffusers-onnxruntime-cpu/Dockerfile",
"chars": 1364,
"preview": "FROM ubuntu:20.04\nLABEL maintainer=\"Hugging Face\"\nLABEL repository=\"diffusers\"\n\nENV DEBIAN_FRONTEND=noninteractive\n\nRUN "
},
{
"path": "docker/diffusers-onnxruntime-cuda/Dockerfile",
"chars": 1416,
"preview": "FROM nvidia/cuda:12.1.0-runtime-ubuntu20.04\nLABEL maintainer=\"Hugging Face\"\nLABEL repository=\"diffusers\"\n\nENV DEBIAN_FRO"
},
{
"path": "docker/diffusers-pytorch-cpu/Dockerfile",
"chars": 955,
"preview": "FROM python:3.10-slim\nENV PYTHONDONTWRITEBYTECODE=1\nLABEL maintainer=\"Hugging Face\"\nLABEL repository=\"diffusers\"\n\nENV DE"
},
{
"path": "docker/diffusers-pytorch-cuda/Dockerfile",
"chars": 1534,
"preview": "FROM nvidia/cuda:12.9.1-runtime-ubuntu24.04\nLABEL maintainer=\"Hugging Face\"\nLABEL repository=\"diffusers\"\n\nARG PYTHON_VER"
},
{
"path": "docker/diffusers-pytorch-minimum-cuda/Dockerfile",
"chars": 1509,
"preview": "FROM nvidia/cuda:12.1.0-runtime-ubuntu20.04\nLABEL maintainer=\"Hugging Face\"\nLABEL repository=\"diffusers\"\n\nARG PYTHON_VER"
},
{
"path": "docker/diffusers-pytorch-xformers-cuda/Dockerfile",
"chars": 1549,
"preview": "FROM nvidia/cuda:12.9.1-runtime-ubuntu24.04\nLABEL maintainer=\"Hugging Face\"\nLABEL repository=\"diffusers\"\n\nARG PYTHON_VER"
},
{
"path": "docs/README.md",
"chars": 11061,
"preview": "<!---\nCopyright 2024- The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"L"
},
{
"path": "docs/TRANSLATING.md",
"chars": 3871,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/_config.py",
"chars": 375,
"preview": "# docstyle-ignore\nINSTALL_CONTENT = \"\"\"\n# Diffusers installation\n! pip install diffusers transformers datasets accelerat"
},
{
"path": "docs/source/en/_toctree.yml",
"chars": 27990,
"preview": "- sections:\n - local: index\n title: Diffusers\n - local: installation\n title: Installation\n - local: quicktour\n "
},
{
"path": "docs/source/en/advanced_inference/outpaint.md",
"chars": 8948,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/activations.md",
"chars": 1027,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/attnprocessor.md",
"chars": 4663,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/cache.md",
"chars": 1261,
"preview": "<!-- Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "docs/source/en/api/configuration.md",
"chars": 1100,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/image_processor.md",
"chars": 2160,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/internal_classes_overview.md",
"chars": 923,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/loaders/ip_adapter.md",
"chars": 1254,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/loaders/lora.md",
"chars": 6397,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/loaders/peft.md",
"chars": 1159,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/loaders/single_file.md",
"chars": 2496,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/loaders/textual_inversion.md",
"chars": 1326,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/loaders/transformer_sd3.md",
"chars": 1290,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/loaders/unet.md",
"chars": 1532,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/logging.md",
"chars": 3757,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/models/allegro_transformer3d.md",
"chars": 1282,
"preview": "<!-- Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "docs/source/en/api/models/asymmetricautoencoderkl.md",
"chars": 4087,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/models/aura_flow_transformer2d.md",
"chars": 777,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/models/auto_model.md",
"chars": 766,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/models/autoencoder_dc.md",
"chars": 5389,
"preview": "<!-- Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "docs/source/en/api/models/autoencoder_kl_hunyuan_video.md",
"chars": 1301,
"preview": "<!-- Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "docs/source/en/api/models/autoencoder_kl_hunyuan_video15.md",
"chars": 1275,
"preview": "<!-- Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "docs/source/en/api/models/autoencoder_kl_hunyuanimage.md",
"chars": 1126,
"preview": "<!-- Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "docs/source/en/api/models/autoencoder_kl_hunyuanimage_refiner.md",
"chars": 1247,
"preview": "<!-- Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "docs/source/en/api/models/autoencoder_kl_wan.md",
"chars": 1116,
"preview": "<!-- Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "docs/source/en/api/models/autoencoder_oobleck.md",
"chars": 2084,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/models/autoencoder_rae.md",
"chars": 4026,
"preview": "<!-- Copyright 2026 The NYU Vision-X and HuggingFace Teams. All rights reserved.\n\nLicensed under the Apache License, Ver"
},
{
"path": "docs/source/en/api/models/autoencoder_tiny.md",
"chars": 2032,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/models/autoencoderkl.md",
"chars": 2613,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/models/autoencoderkl_allegro.md",
"chars": 1363,
"preview": "<!-- Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "docs/source/en/api/models/autoencoderkl_audio_ltx_2.md",
"chars": 1159,
"preview": "<!-- Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "docs/source/en/api/models/autoencoderkl_cogvideox.md",
"chars": 1418,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/models/autoencoderkl_cosmos.md",
"chars": 1264,
"preview": "<!-- Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "docs/source/en/api/models/autoencoderkl_ltx_2.md",
"chars": 1096,
"preview": "<!-- Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "docs/source/en/api/models/autoencoderkl_ltx_video.md",
"chars": 1258,
"preview": "<!-- Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "docs/source/en/api/models/autoencoderkl_magvit.md",
"chars": 1267,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/models/autoencoderkl_mochi.md",
"chars": 1217,
"preview": "<!-- Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "docs/source/en/api/models/autoencoderkl_qwenimage.md",
"chars": 1077,
"preview": "<!-- Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "docs/source/en/api/models/bria_transformer.md",
"chars": 763,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/models/chroma_transformer.md",
"chars": 777,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/models/chronoedit_transformer_3d.md",
"chars": 1793,
"preview": "<!-- Copyright 2025 The ChronoEdit Team and HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, V"
},
{
"path": "docs/source/en/api/models/cogvideox_transformer3d.md",
"chars": 1336,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/models/cogview3plus_transformer2d.md",
"chars": 1334,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/models/cogview4_transformer2d.md",
"chars": 1105,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/models/consisid_transformer3d.md",
"chars": 1345,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/models/consistency_decoder_vae.md",
"chars": 1315,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/models/controlnet.md",
"chars": 3702,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/models/controlnet_flux.md",
"chars": 2918,
"preview": "<!--Copyright 2025 The HuggingFace Team and The InstantX Team. All rights reserved.\n\nLicensed under the Apache License, "
},
{
"path": "docs/source/en/api/models/controlnet_hunyuandit.md",
"chars": 2794,
"preview": "<!--Copyright 2025 The HuggingFace Team and Tencent Hunyuan Team. All rights reserved.\n\nLicensed under the Apache Licens"
},
{
"path": "docs/source/en/api/models/controlnet_sana.md",
"chars": 2430,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/models/controlnet_sd3.md",
"chars": 2714,
"preview": "<!--Copyright 2025 The HuggingFace Team and The InstantX Team. All rights reserved.\n\nLicensed under the Apache License, "
},
{
"path": "docs/source/en/api/models/controlnet_sparsectrl.md",
"chars": 3177,
"preview": "<!-- Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "docs/source/en/api/models/controlnet_union.md",
"chars": 2018,
"preview": "<!--Copyright 2025 The HuggingFace Team and The InstantX Team. All rights reserved.\n\nLicensed under the Apache License, "
},
{
"path": "docs/source/en/api/models/cosmos_transformer3d.md",
"chars": 1230,
"preview": "<!-- Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "docs/source/en/api/models/dit_transformer2d.md",
"chars": 768,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/models/easyanimate_transformer3d.md",
"chars": 1210,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/models/flux2_transformer.md",
"chars": 893,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/models/flux_transformer.md",
"chars": 788,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/models/glm_image_transformer2d.md",
"chars": 773,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/models/helios_transformer3d.md",
"chars": 1675,
"preview": "<!-- Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "docs/source/en/api/models/hidream_image_transformer.md",
"chars": 1729,
"preview": "<!-- Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "docs/source/en/api/models/hunyuan_transformer2d.md",
"chars": 764,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/models/hunyuan_video15_transformer_3d.md",
"chars": 1231,
"preview": "<!-- Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "docs/source/en/api/models/hunyuan_video_transformer_3d.md",
"chars": 1271,
"preview": "<!-- Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "docs/source/en/api/models/hunyuanimage_transformer_2d.md",
"chars": 1193,
"preview": "<!-- Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "docs/source/en/api/models/latte_transformer3d.md",
"chars": 772,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/models/longcat_image_transformer2d.md",
"chars": 974,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/models/ltx2_video_transformer3d.md",
"chars": 1083,
"preview": "<!-- Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "docs/source/en/api/models/ltx_video_transformer3d.md",
"chars": 1177,
"preview": "<!-- Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "docs/source/en/api/models/lumina2_transformer2d.md",
"chars": 1197,
"preview": "<!-- Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "docs/source/en/api/models/lumina_nextdit2d.md",
"chars": 791,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/models/mochi_transformer3d.md",
"chars": 1179,
"preview": "<!-- Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "docs/source/en/api/models/omnigen_transformer.md",
"chars": 2568,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/models/overview.md",
"chars": 1177,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/models/ovisimage_transformer2d.md",
"chars": 952,
"preview": "<!-- Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "docs/source/en/api/models/pixart_transformer2d.md",
"chars": 847,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/models/prior_transformer.md",
"chars": 2143,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/models/qwenimage_transformer2d.md",
"chars": 1040,
"preview": "<!-- Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "docs/source/en/api/models/sana_transformer2d.md",
"chars": 2787,
"preview": "<!-- Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "docs/source/en/api/models/sana_video_transformer3d.md",
"chars": 3193,
"preview": "<!-- Copyright 2025 The SANA-Video Authors and HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License"
},
{
"path": "docs/source/en/api/models/sd3_transformer2d.md",
"chars": 813,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/models/skyreels_v2_transformer_3d.md",
"chars": 1216,
"preview": "<!-- Copyright 2024 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "docs/source/en/api/models/stable_audio_transformer.md",
"chars": 776,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/models/stable_cascade_unet.md",
"chars": 776,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/models/transformer2d.md",
"chars": 1710,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/models/transformer_bria_fibo.md",
"chars": 771,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/models/transformer_temporal.md",
"chars": 885,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/models/unet-motion.md",
"chars": 2410,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/models/unet.md",
"chars": 2371,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/models/unet2d-cond.md",
"chars": 2438,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/models/unet2d.md",
"chars": 2371,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/models/unet3d-cond.md",
"chars": 2438,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/models/uvit2d.md",
"chars": 2569,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/models/vq.md",
"chars": 2107,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/models/wan_animate_transformer_3d.md",
"chars": 1210,
"preview": "<!-- Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "docs/source/en/api/models/wan_transformer_3d.md",
"chars": 1168,
"preview": "<!-- Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "docs/source/en/api/models/z_image_transformer2d.md",
"chars": 787,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/modular_diffusers/guiders.md",
"chars": 1163,
"preview": "# Guiders\n\nGuiders are components in Modular Diffusers that control how the diffusion process is guided during generatio"
},
{
"path": "docs/source/en/api/modular_diffusers/pipeline.md",
"chars": 105,
"preview": "# Pipeline\n\n## ModularPipeline\n\n[[autodoc]] diffusers.modular_pipelines.modular_pipeline.ModularPipeline\n"
},
{
"path": "docs/source/en/api/modular_diffusers/pipeline_blocks.md",
"chars": 569,
"preview": "# Pipeline blocks\n\n## ModularPipelineBlocks\n\n[[autodoc]] diffusers.modular_pipelines.modular_pipeline.ModularPipelineBlo"
},
{
"path": "docs/source/en/api/modular_diffusers/pipeline_components.md",
"chars": 396,
"preview": "# Components and configs\n\n## ComponentSpec\n\n[[autodoc]] diffusers.modular_pipelines.modular_pipeline.ComponentSpec\n\n## C"
},
{
"path": "docs/source/en/api/modular_diffusers/pipeline_states.md",
"chars": 192,
"preview": "# Pipeline states\n\n## PipelineState\n\n[[autodoc]] diffusers.modular_pipelines.modular_pipeline.PipelineState\n\n## BlockSta"
},
{
"path": "docs/source/en/api/normalization.md",
"chars": 1904,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/outputs.md",
"chars": 1834,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/parallel.md",
"chars": 1006,
"preview": "<!-- Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "docs/source/en/api/pipelines/allegro.md",
"chars": 4267,
"preview": "<!-- Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "docs/source/en/api/pipelines/amused.md",
"chars": 3083,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/pipelines/animatediff.md",
"chars": 44824,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/pipelines/attend_and_excite.md",
"chars": 3354,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/pipelines/audioldm.md",
"chars": 3935,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/pipelines/audioldm2.md",
"chars": 7516,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/pipelines/aura_flow.md",
"chars": 4771,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/pipelines/auto_pipeline.md",
"chars": 1306,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/pipelines/blip_diffusion.md",
"chars": 3374,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/pipelines/bria_3_2.md",
"chars": 2026,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/pipelines/bria_fibo.md",
"chars": 2027,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/pipelines/bria_fibo_edit.md",
"chars": 1617,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/pipelines/chroma.md",
"chars": 4158,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/pipelines/chronoedit.md",
"chars": 11821,
"preview": "<!-- Copyright 2025 The ChronoEdit Team and HuggingFace Team. All rights reserved.\n#\n# Licensed under the Apache License"
},
{
"path": "docs/source/en/api/pipelines/cogvideox.md",
"chars": 7725,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"L"
},
{
"path": "docs/source/en/api/pipelines/cogview3.md",
"chars": 2785,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"L"
},
{
"path": "docs/source/en/api/pipelines/cogview4.md",
"chars": 1387,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"L"
},
{
"path": "docs/source/en/api/pipelines/consisid.md",
"chars": 5369,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"L"
},
{
"path": "docs/source/en/api/pipelines/consistency_models.md",
"chars": 3321,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/pipelines/control_flux_inpaint.md",
"chars": 4255,
"preview": "<!--Copyright 2025 The HuggingFace Team, The Black Forest Team. All rights reserved.\n\nLicensed under the Apache License,"
},
{
"path": "docs/source/en/api/pipelines/controlnet.md",
"chars": 3989,
"preview": "<!--Copyright 2025 The HuggingFace Team. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "docs/source/en/api/pipelines/controlnet_flux.md",
"chars": 4119,
"preview": "<!--Copyright 2025 The HuggingFace Team, The InstantX Team, and the XLabs Team. All rights reserved.\n\nLicensed under the"
}
]
// ... and 2284 more files (download for full content)
About this extraction
This page contains the full source code of the huggingface/diffusers GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 2484 files (42.4 MB), approximately 4.1M tokens, and a symbol index with 4166 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.