repo stringclasses 454
values | file_path stringlengths 5 201 | extension stringclasses 1
value | content stringlengths 8 509k | num_lines int64 3 16.9k | size_bytes int64 8 511k |
|---|---|---|---|---|---|
diffusers | tests/testing_utils.py | .py | import functools
import glob
import importlib
import importlib.metadata
import inspect
import io
import logging
import multiprocessing
import os
import random
import re
import struct
import sys
import tempfile
import time
import urllib.parse
from collections import UserDict
from contextlib import contextmanager
from io... | 1,862 | 68,739 |
diffusers | tests/conftest.py | .py | # Copyright 2026 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 applicabl... | 68 | 3,671 |
diffusers | tests/hooks/test_mag_cache.py | .py | # Copyright 2026 HuggingFace Inc.
#
# 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 writ... | 247 | 8,240 |
diffusers | tests/hooks/test_group_offloading.py | .py | # Copyright 2026 HuggingFace Inc.
#
# 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 writ... | 695 | 30,316 |
diffusers | tests/hooks/test_hooks.py | .py | # Copyright 2026 HuggingFace Inc.
#
# 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 writ... | 419 | 15,406 |
diffusers | tests/schedulers/test_scheduler_flow_map_euler_discrete.py | .py | # Copyright 2026 The AnyFlow Team, NVIDIA Corp., and 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-... | 190 | 9,335 |
diffusers | tests/schedulers/test_scheduler_dpm_sde.py | .py | import torch
from diffusers import DPMSolverSDEScheduler
from ..testing_utils import require_torchsde, torch_device
from .test_schedulers import SchedulerCommonTest
@require_torchsde
class DPMSolverSDESchedulerTest(SchedulerCommonTest):
scheduler_classes = (DPMSolverSDEScheduler,)
num_inference_steps = 10
... | 174 | 6,719 |
diffusers | tests/schedulers/test_scheduler_euler.py | .py | import torch
from diffusers import EulerDiscreteScheduler
from ..testing_utils import torch_device
from .test_schedulers import SchedulerCommonTest
class EulerDiscreteSchedulerTest(SchedulerCommonTest):
scheduler_classes = (EulerDiscreteScheduler,)
num_inference_steps = 10
def get_scheduler_config(self... | 272 | 10,526 |
diffusers | tests/schedulers/test_scheduler_discrete_ddim.py | .py | import unittest
import torch
from diffusers import DiscreteDDIMScheduler
class DiscreteDDIMSchedulerTest(unittest.TestCase):
def get_scheduler(self, **kwargs):
config = {"num_inference_steps": 8}
config.update(kwargs)
return DiscreteDDIMScheduler(**config)
def test_set_timesteps(sel... | 107 | 4,737 |
diffusers | tests/schedulers/test_scheduler_block_refinement.py | .py | import tempfile
import unittest
import torch
from diffusers import BlockRefinementScheduler
class BlockRefinementSchedulerTest(unittest.TestCase):
def get_scheduler(self, **kwargs):
config = {
"block_length": 32,
"num_inference_steps": 8,
"threshold": 0.95,
... | 527 | 21,112 |
diffusers | tests/schedulers/test_schedulers.py | .py | # coding=utf-8
# Copyright 2026 HuggingFace Inc.
#
# 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 ag... | 870 | 37,672 |
diffusers | tests/schedulers/test_scheduler_deis.py | .py | import tempfile
import unittest
import torch
from diffusers import (
DEISMultistepScheduler,
DPMSolverMultistepScheduler,
DPMSolverSinglestepScheduler,
UniPCMultistepScheduler,
)
from .test_schedulers import SchedulerCommonTest
class DEISMultistepSchedulerTest(SchedulerCommonTest):
scheduler_cl... | 274 | 11,457 |
diffusers | tests/schedulers/test_scheduler_edm_dpmsolver_multistep.py | .py | import tempfile
import unittest
import torch
from diffusers import EDMDPMSolverMultistepScheduler
from .test_schedulers import SchedulerCommonTest
class EDMDPMSolverMultistepSchedulerTest(SchedulerCommonTest):
scheduler_classes = (EDMDPMSolverMultistepScheduler,)
forward_default_kwargs = (("num_inference_s... | 263 | 11,311 |
diffusers | tests/schedulers/test_scheduler_edm_euler.py | .py | import inspect
import tempfile
import unittest
from typing import Dict, List, Tuple
import torch
from diffusers import EDMEulerScheduler
from .test_schedulers import SchedulerCommonTest
class EDMEulerSchedulerTest(SchedulerCommonTest):
scheduler_classes = (EDMEulerScheduler,)
forward_default_kwargs = (("nu... | 204 | 8,312 |
diffusers | tests/schedulers/test_scheduler_ddim_inverse.py | .py | import unittest
import torch
from diffusers import DDIMInverseScheduler
from .test_schedulers import SchedulerCommonTest
class DDIMInverseSchedulerTest(SchedulerCommonTest):
scheduler_classes = (DDIMInverseScheduler,)
forward_default_kwargs = (("num_inference_steps", 50),)
def get_scheduler_config(sel... | 139 | 4,942 |
diffusers | tests/schedulers/test_scheduler_dpm_single.py | .py | import tempfile
import unittest
import torch
from diffusers import (
DEISMultistepScheduler,
DPMSolverMultistepScheduler,
DPMSolverSinglestepScheduler,
UniPCMultistepScheduler,
)
from .test_schedulers import SchedulerCommonTest
class DPMSolverSinglestepSchedulerTest(SchedulerCommonTest):
schedu... | 357 | 15,118 |
diffusers | tests/schedulers/test_scheduler_heun.py | .py | import torch
from diffusers import HeunDiscreteScheduler
from ..testing_utils import torch_device
from .test_schedulers import SchedulerCommonTest
class HeunDiscreteSchedulerTest(SchedulerCommonTest):
scheduler_classes = (HeunDiscreteScheduler,)
num_inference_steps = 10
def get_scheduler_config(self, *... | 228 | 8,700 |
diffusers | tests/schedulers/test_scheduler_kdpm2_discrete.py | .py | import torch
from diffusers import KDPM2DiscreteScheduler
from ..testing_utils import torch_device
from .test_schedulers import SchedulerCommonTest
class KDPM2DiscreteSchedulerTest(SchedulerCommonTest):
scheduler_classes = (KDPM2DiscreteScheduler,)
num_inference_steps = 10
def get_scheduler_config(self... | 173 | 6,207 |
diffusers | tests/schedulers/test_scheduler_lcm.py | .py | import tempfile
from typing import Dict, List, Tuple
import torch
from diffusers import LCMScheduler
from ..testing_utils import torch_device
from .test_schedulers import SchedulerCommonTest
class LCMSchedulerTest(SchedulerCommonTest):
scheduler_classes = (LCMScheduler,)
forward_default_kwargs = (("num_inf... | 301 | 12,313 |
diffusers | tests/schedulers/test_scheduler_ddim.py | .py | import torch
from diffusers import DDIMScheduler
from .test_schedulers import SchedulerCommonTest
class DDIMSchedulerTest(SchedulerCommonTest):
scheduler_classes = (DDIMScheduler,)
forward_default_kwargs = (("eta", 0.0), ("num_inference_steps", 50))
def get_scheduler_config(self, **kwargs):
con... | 177 | 6,748 |
diffusers | tests/schedulers/test_scheduler_ddim_parallel.py | .py | # Copyright 2025 ParaDiGMS authors and 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... | 217 | 8,510 |
diffusers | tests/schedulers/test_scheduler_dpm_multi.py | .py | import tempfile
import unittest
import torch
from diffusers import (
DEISMultistepScheduler,
DPMSolverMultistepScheduler,
DPMSolverSinglestepScheduler,
UniPCMultistepScheduler,
)
from .test_schedulers import SchedulerCommonTest
class DPMSolverMultistepSchedulerTest(SchedulerCommonTest):
schedul... | 369 | 15,807 |
diffusers | tests/schedulers/test_scheduler_kdpm2_ancestral.py | .py | import torch
from diffusers import KDPM2AncestralDiscreteScheduler
from ..testing_utils import torch_device
from .test_schedulers import SchedulerCommonTest
class KDPM2AncestralDiscreteSchedulerTest(SchedulerCommonTest):
scheduler_classes = (KDPM2AncestralDiscreteScheduler,)
num_inference_steps = 10
de... | 165 | 5,804 |
diffusers | tests/schedulers/test_scheduler_score_sde_ve.py | .py | import tempfile
import unittest
import numpy as np
import torch
from diffusers import ScoreSdeVeScheduler
class ScoreSdeVeSchedulerTest(unittest.TestCase):
# TODO adapt with class SchedulerCommonTest (scheduler needs Numpy Integration)
scheduler_classes = (ScoreSdeVeScheduler,)
forward_default_kwargs = ... | 190 | 7,018 |
diffusers | tests/schedulers/test_scheduler_vq_diffusion.py | .py | import unittest
import torch
import torch.nn.functional as F
from diffusers import VQDiffusionScheduler
from .test_schedulers import SchedulerCommonTest
class VQDiffusionSchedulerTest(SchedulerCommonTest):
scheduler_classes = (VQDiffusionScheduler,)
def get_scheduler_config(self, **kwargs):
config... | 60 | 1,607 |
diffusers | tests/schedulers/test_scheduler_ddpm_parallel.py | .py | # Copyright 2025 ParaDiGMS authors and 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... | 252 | 9,640 |
diffusers | tests/schedulers/test_scheduler_unclip.py | .py | import unittest
import torch
from diffusers import UnCLIPScheduler
from .test_schedulers import SchedulerCommonTest
# UnCLIPScheduler is a modified DDPMScheduler with a subset of the configuration.
class UnCLIPSchedulerTest(SchedulerCommonTest):
scheduler_classes = (UnCLIPScheduler,)
def get_scheduler_con... | 142 | 5,019 |
diffusers | tests/schedulers/test_scheduler_tcd.py | .py | import torch
from diffusers import TCDScheduler
from .test_schedulers import SchedulerCommonTest
class TCDSchedulerTest(SchedulerCommonTest):
scheduler_classes = (TCDScheduler,)
forward_default_kwargs = (("num_inference_steps", 10),)
def get_scheduler_config(self, **kwargs):
config = {
... | 181 | 6,832 |
diffusers | tests/schedulers/test_scheduler_dpm_multi_inverse.py | .py | import tempfile
import torch
from diffusers import DPMSolverMultistepInverseScheduler, DPMSolverMultistepScheduler
from .test_schedulers import SchedulerCommonTest
class DPMSolverMultistepSchedulerTest(SchedulerCommonTest):
scheduler_classes = (DPMSolverMultistepInverseScheduler,)
forward_default_kwargs = ... | 274 | 11,759 |
diffusers | tests/schedulers/test_scheduler_entropy_bound.py | .py | import unittest
import torch
from diffusers import EntropyBoundScheduler
class EntropyBoundSchedulerTest(unittest.TestCase):
def get_scheduler(self, **kwargs):
config = {"entropy_bound": 0.1, "num_inference_steps": 8}
config.update(kwargs)
return EntropyBoundScheduler(**config)
def ... | 57 | 2,473 |
diffusers | tests/schedulers/test_scheduler_lms.py | .py | import torch
from diffusers import LMSDiscreteScheduler
from ..testing_utils import torch_device
from .test_schedulers import SchedulerCommonTest
class LMSDiscreteSchedulerTest(SchedulerCommonTest):
scheduler_classes = (LMSDiscreteScheduler,)
num_inference_steps = 10
def get_scheduler_config(self, **kw... | 177 | 6,165 |
diffusers | tests/schedulers/test_scheduler_sasolver.py | .py | import torch
from diffusers import SASolverScheduler
from ..testing_utils import require_torchsde, torch_device
from .test_schedulers import SchedulerCommonTest
@require_torchsde
class SASolverSchedulerTest(SchedulerCommonTest):
scheduler_classes = (SASolverScheduler,)
forward_default_kwargs = (("num_infere... | 201 | 7,830 |
diffusers | tests/schedulers/test_scheduler_consistency_model.py | .py | import torch
from diffusers import CMStochasticIterativeScheduler
from .test_schedulers import SchedulerCommonTest
class CMStochasticIterativeSchedulerTest(SchedulerCommonTest):
scheduler_classes = (CMStochasticIterativeScheduler,)
num_inference_steps = 10
def get_scheduler_config(self, **kwargs):
... | 190 | 6,948 |
diffusers | tests/schedulers/test_scheduler_pndm.py | .py | import tempfile
import unittest
import torch
from diffusers import PNDMScheduler
from .test_schedulers import SchedulerCommonTest
class PNDMSchedulerTest(SchedulerCommonTest):
scheduler_classes = (PNDMScheduler,)
forward_default_kwargs = (("num_inference_steps", 50),)
def get_scheduler_config(self, **... | 245 | 10,356 |
diffusers | tests/schedulers/test_scheduler_ddpm.py | .py | import torch
from diffusers import DDPMScheduler
from .test_schedulers import SchedulerCommonTest
class DDPMSchedulerTest(SchedulerCommonTest):
scheduler_classes = (DDPMScheduler,)
def get_scheduler_config(self, **kwargs):
config = {
"num_train_timesteps": 1000,
"beta_start"... | 223 | 8,352 |
diffusers | tests/schedulers/test_scheduler_unipc.py | .py | import tempfile
import torch
from diffusers import (
DEISMultistepScheduler,
DPMSolverMultistepScheduler,
DPMSolverSinglestepScheduler,
UniPCMultistepScheduler,
)
from .test_schedulers import SchedulerCommonTest
class UniPCMultistepSchedulerTest(SchedulerCommonTest):
scheduler_classes = (UniPCM... | 431 | 17,256 |
diffusers | tests/schedulers/test_scheduler_euler_ancestral.py | .py | import torch
from diffusers import EulerAncestralDiscreteScheduler
from ..testing_utils import torch_device
from .test_schedulers import SchedulerCommonTest
class EulerAncestralDiscreteSchedulerTest(SchedulerCommonTest):
scheduler_classes = (EulerAncestralDiscreteScheduler,)
num_inference_steps = 10
de... | 157 | 5,614 |
diffusers | tests/schedulers/test_scheduler_ipndm.py | .py | import tempfile
import unittest
import torch
from diffusers import IPNDMScheduler
from .test_schedulers import SchedulerCommonTest
class IPNDMSchedulerTest(SchedulerCommonTest):
scheduler_classes = (IPNDMScheduler,)
forward_default_kwargs = (("num_inference_steps", 50),)
def get_scheduler_config(self,... | 166 | 7,075 |
diffusers | tests/quantization/test_pipeline_level_quantization.py | .py | # coding=utf-8
# Copyright 2025 The HuggingFace Team Inc.
#
# 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 clone of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 313 | 12,689 |
diffusers | tests/quantization/utils.py | .py | from diffusers.utils import is_torch_available
from ..testing_utils import (
backend_empty_cache,
backend_max_memory_allocated,
backend_reset_peak_memory_stats,
torch_device,
)
if is_torch_available():
import torch
import torch.nn as nn
class LoRALayer(nn.Module):
"""Wraps a line... | 46 | 1,588 |
diffusers | tests/quantization/test_torch_compile_utils.py | .py | # coding=utf-8
# Copyright 2025 The HuggingFace Team Inc.
#
# 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 clone of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 67 | 2,397 |
diffusers | tests/quantization/torchao/test_torchao.py | .py | # coding=utf-8
# Copyright 2026 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 requir... | 743 | 33,486 |
diffusers | tests/quantization/modelopt/test_modelopt.py | .py | import copy
import gc
import os
import tempfile
import pytest
from diffusers import NVIDIAModelOptConfig, SD3Transformer2DModel, StableDiffusion3Pipeline
from diffusers.utils import is_nvidia_modelopt_available, is_torch_available
from ...testing_utils import (
backend_empty_cache,
backend_reset_peak_memory_... | 344 | 12,319 |
diffusers | tests/quantization/bnb/test_4bit.py | .py | # coding=utf-8
# Copyright 2025 The HuggingFace Team Inc.
#
# 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 clone of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 688 | 26,412 |
diffusers | tests/quantization/bnb/test_mixed_int8.py | .py | # coding=utf-8
# Copyright 2025 The HuggingFace Team Inc.
#
# 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 clone of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 803 | 31,059 |
diffusers | tests/quantization/quanto/test_quanto.py | .py | import gc
import pytest
from diffusers import FluxPipeline, FluxTransformer2DModel, QuantoConfig
from diffusers.utils import is_torch_available
from ...testing_utils import (
backend_empty_cache,
backend_reset_peak_memory_stats,
enable_full_determinism,
nightly,
require_accelerate,
require_ac... | 177 | 5,964 |
diffusers | tests/quantization/gguf/test_gguf.py | .py | import gc
import numpy as np
import pytest
import torch
import torch.nn as nn
from diffusers import (
AuraFlowPipeline,
AuraFlowTransformer2DModel,
DiffusionPipeline,
FluxControlPipeline,
FluxPipeline,
FluxTransformer2DModel,
GGUFQuantizationConfig,
HiDreamImageTransformer2DModel,
... | 769 | 29,077 |
diffusers | tests/remote/test_remote_decode.py | .py | # coding=utf-8
# Copyright 2026 HuggingFace Inc.
#
# 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 ag... | 537 | 21,531 |
diffusers | tests/remote/test_remote_encode.py | .py | # coding=utf-8
# Copyright 2026 HuggingFace Inc.
#
# 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 ag... | 226 | 6,340 |
diffusers | tests/pipelines/test_pipelines.py | .py | # coding=utf-8
# Copyright 2026 HuggingFace Inc.
#
# 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 ag... | 2,621 | 118,513 |
diffusers | tests/pipelines/pipeline_params.py | .py | # These are canonical sets of parameters for different types of pipelines.
# They are set on subclasses of `PipelineTesterMixin` as `params` and
# `batch_params`.
#
# If a pipeline's set of arguments has minor changes from one of the common sets
# of arguments, do not make modifications to the existing common sets of a... | 135 | 3,472 |
diffusers | tests/pipelines/test_pipeline_utils.py | .py | import contextlib
import io
import json
import os
import re
import tempfile
import uuid
import pytest
import torch
from huggingface_hub import ModelCard, delete_repo
from huggingface_hub.utils import is_jinja_available
from PIL import Image
from transformers import CLIPTextConfig, CLIPTextModel, CLIPTokenizer
from di... | 1,114 | 47,408 |
diffusers | tests/pipelines/test_pipelines_common.py | .py | import gc
import inspect
import json
import os
import tempfile
import unittest
from typing import Any, Callable, Dict
import numpy as np
import PIL.Image
import pytest
import torch
import torch.nn as nn
import diffusers
from diffusers import (
AsymmetricAutoencoderKL,
AutoencoderKL,
AutoencoderTiny,
C... | 2,942 | 135,728 |
diffusers | tests/pipelines/test_pipelines_auto.py | .py | # coding=utf-8
# Copyright 2026 HuggingFace Inc.
#
# 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 ag... | 578 | 29,135 |
diffusers | tests/pipelines/test_pipelines_combined.py | .py | # coding=utf-8
# Copyright 2026 HuggingFace Inc.
#
# 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 ag... | 129 | 5,906 |
diffusers | tests/pipelines/test_pipelines_onnx_common.py | .py | from ..testing_utils import require_onnxruntime
@require_onnxruntime
class OnnxPipelineTesterMixin:
"""
This mixin is designed to be used with unittest.TestCase classes.
It provides a set of common tests for each ONNXRuntime pipeline, e.g. saving and loading the pipeline,
equivalence of dict and tuple... | 13 | 353 |
diffusers | tests/pipelines/flux2/test_pipeline_flux2_klein_inpaint.py | .py | import random
import pytest
import torch
from transformers import Qwen2TokenizerFast, Qwen3Config, Qwen3ForCausalLM
from diffusers import (
AutoencoderKLFlux2,
FlowMatchEulerDiscreteScheduler,
Flux2KleinInpaintPipeline,
Flux2Transformer2DModel,
)
from ...testing_utils import floats_tensor, torch_devi... | 185 | 7,029 |
diffusers | tests/pipelines/flux2/test_pipeline_flux2_klein_kv.py | .py | import pytest
import torch
from PIL import Image
from transformers import Qwen2TokenizerFast, Qwen3Config, Qwen3ForCausalLM
from diffusers import (
AutoencoderKLFlux2,
FlowMatchEulerDiscreteScheduler,
Flux2KleinKVPipeline,
Flux2Transformer2DModel,
)
from ...testing_utils import assert_tensors_close, t... | 177 | 6,166 |
diffusers | tests/pipelines/flux2/test_pipeline_flux2_klein.py | .py | import gc
import os
import numpy as np
import pytest
import torch
from PIL import Image
from transformers import Qwen2TokenizerFast, Qwen3Config, Qwen3ForCausalLM
from diffusers import (
AutoencoderKLFlux2,
FlowMatchEulerDiscreteScheduler,
Flux2KleinPipeline,
Flux2Transformer2DModel,
)
from ...testin... | 286 | 10,248 |
diffusers | tests/pipelines/flux2/test_pipeline_flux2.py | .py | import torch
from transformers import AutoProcessor, Mistral3Config, Mistral3ForConditionalGeneration
from diffusers import (
AutoencoderKLFlux2,
FlowMatchEulerDiscreteScheduler,
Flux2Pipeline,
Flux2Transformer2DModel,
)
from ...testing_utils import assert_tensors_close, torch_device
from ..testing_ut... | 190 | 6,792 |
diffusers | tests/pipelines/stable_cascade/test_stable_cascade_prior.py | .py | # coding=utf-8
# Copyright 2026 HuggingFace Inc.
#
# 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 ag... | 292 | 9,439 |
diffusers | tests/pipelines/stable_cascade/test_stable_cascade_decoder.py | .py | # coding=utf-8
# Copyright 2026 HuggingFace Inc.
#
# 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 ag... | 325 | 11,035 |
diffusers | tests/pipelines/stable_cascade/test_stable_cascade_combined.py | .py | # coding=utf-8
# Copyright 2026 HuggingFace Inc.
#
# 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 ag... | 245 | 8,298 |
diffusers | tests/pipelines/easyanimate/test_easyanimate.py | .py | # Copyright 2025 The HuggingFace Team.
#
# 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... | 295 | 10,658 |
diffusers | tests/pipelines/lumina2/test_pipeline_lumina2.py | .py | import unittest
import torch
from transformers import AutoTokenizer, Gemma2Config, Gemma2Model
from diffusers import (
AutoencoderKL,
FlowMatchEulerDiscreteScheduler,
Lumina2Pipeline,
Lumina2Transformer2DModel,
)
from ..test_pipelines_common import PipelineTesterMixin
class Lumina2PipelineFastTests... | 117 | 3,223 |
diffusers | tests/pipelines/ace_step/test_ace_step.py | .py | # coding=utf-8
# Copyright 2026 HuggingFace Inc.
#
# 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 ag... | 486 | 17,357 |
diffusers | tests/pipelines/testing_utils/utils.py | .py | # coding=utf-8
# Copyright 2025 HuggingFace Inc.
#
# 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 ag... | 55 | 2,131 |
diffusers | tests/pipelines/testing_utils/__init__.py | .py | from .cache import (
CacheTesterMixin,
FasterCacheTesterMixin,
FirstBlockCacheTesterMixin,
MagCacheTesterMixin,
PyramidAttentionBroadcastTesterMixin,
TaylorSeerCacheTesterMixin,
)
from .common import BasePipelineTesterConfig, PipelineTesterMixin
from .memory import (
GroupOffloadTesterMixin,... | 42 | 1,121 |
diffusers | tests/pipelines/testing_utils/common.py | .py | # coding=utf-8
# Copyright 2025 HuggingFace Inc.
#
# 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 ag... | 859 | 37,967 |
diffusers | tests/pipelines/testing_utils/cache.py | .py | # coding=utf-8
# Copyright 2025 HuggingFace Inc.
#
# 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 ag... | 344 | 15,924 |
diffusers | tests/pipelines/testing_utils/memory.py | .py | # coding=utf-8
# Copyright 2025 HuggingFace Inc.
#
# 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 ag... | 418 | 18,622 |
diffusers | tests/pipelines/kandinsky3/test_kandinsky3.py | .py | # coding=utf-8
# Copyright 2026 HuggingFace Inc.
#
# 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 ag... | 243 | 8,027 |
diffusers | tests/pipelines/kandinsky3/test_kandinsky3_img2img.py | .py | # coding=utf-8
# Copyright 2026 HuggingFace Inc.
#
# 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 ag... | 239 | 7,763 |
diffusers | tests/pipelines/prx/test_pipeline_prx.py | .py | import unittest
import numpy as np
import torch
from transformers import AutoTokenizer
from transformers.models.t5gemma.configuration_t5gemma import T5GemmaConfig, T5GemmaModuleConfig
from transformers.models.t5gemma.modeling_t5gemma import T5GemmaEncoder
from diffusers.models import AutoencoderDC, AutoencoderKL
from... | 283 | 10,248 |
diffusers | tests/pipelines/prx/test_pipeline_prx_pixel.py | .py | import unittest
import numpy as np
import torch
from transformers import Qwen2Tokenizer, Qwen3Config, Qwen3Model
from diffusers.models.transformers.transformer_prx import PRXTransformer2DModel
from diffusers.pipelines.prx.pipeline_prx_pixel import PRXPixelPipeline
from diffusers.schedulers import FlowMatchEulerDiscre... | 296 | 12,048 |
diffusers | tests/pipelines/glm_image/test_glm_image.py | .py | # Copyright 2025 The HuggingFace Team.
#
# 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... | 397 | 13,851 |
diffusers | tests/pipelines/controlnet_flux/test_controlnet_flux_inpaint.py | .py | import random
import unittest
import numpy as np
import torch
from transformers import AutoConfig, AutoTokenizer, CLIPTextConfig, CLIPTextModel, CLIPTokenizer, T5EncoderModel
from diffusers import (
AutoencoderKL,
FlowMatchEulerDiscreteScheduler,
FluxControlNetInpaintPipeline,
FluxControlNetModel,
... | 216 | 7,444 |
diffusers | tests/pipelines/controlnet_flux/test_controlnet_flux.py | .py | # coding=utf-8
# Copyright 2025 HuggingFace Inc and The InstantX Team.
#
# 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 b... | 275 | 9,216 |
diffusers | tests/pipelines/controlnet_flux/test_controlnet_flux_img2img.py | .py | import unittest
import numpy as np
import torch
from transformers import AutoConfig, AutoTokenizer, CLIPTextConfig, CLIPTextModel, CLIPTokenizer, T5EncoderModel
from diffusers import (
AutoencoderKL,
FlowMatchEulerDiscreteScheduler,
FluxControlNetImg2ImgPipeline,
FluxControlNetModel,
FluxTransform... | 219 | 7,677 |
diffusers | tests/pipelines/controlnet_sd3/test_controlnet_inpaint_sd3.py | .py | # coding=utf-8
# Copyright 2026 HuggingFace Inc.
#
# 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 ag... | 207 | 6,774 |
diffusers | tests/pipelines/controlnet_sd3/test_controlnet_sd3.py | .py | # coding=utf-8
# Copyright 2025 HuggingFace Inc and The InstantX Team.
#
# 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 b... | 373 | 13,733 |
diffusers | tests/pipelines/cogvideo/test_cogvideox.py | .py | # Copyright 2025 The HuggingFace Team.
#
# 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... | 274 | 9,841 |
diffusers | tests/pipelines/cogvideo/test_cogvideox_fun_control.py | .py | # Copyright 2025 The HuggingFace Team.
#
# 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... | 218 | 8,439 |
diffusers | tests/pipelines/cogvideo/test_cogvideox_image2video.py | .py | # Copyright 2025 The HuggingFace Team.
#
# 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... | 298 | 11,220 |
diffusers | tests/pipelines/cogvideo/test_cogvideox_video2video.py | .py | # Copyright 2025 The HuggingFace Team.
#
# 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... | 223 | 8,593 |
diffusers | tests/pipelines/hunyuandit/test_hunyuan_dit.py | .py | # coding=utf-8
# Copyright 2026 HuggingFace Inc.
#
# 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 ag... | 351 | 13,786 |
diffusers | tests/pipelines/latent_diffusion/test_latent_diffusion_superresolution.py | .py | # coding=utf-8
# Copyright 2026 HuggingFace Inc.
#
# 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 ag... | 141 | 4,562 |
diffusers | tests/pipelines/latent_diffusion/test_latent_diffusion.py | .py | # coding=utf-8
# Copyright 2026 HuggingFace Inc.
#
# 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 ag... | 219 | 7,394 |
diffusers | tests/pipelines/krea2/test_krea2.py | .py | # Copyright 2026 The HuggingFace Team.
#
# 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... | 240 | 8,804 |
diffusers | tests/pipelines/bria/test_pipeline_bria.py | .py | # Copyright 2024 Bria AI and 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 ... | 321 | 11,692 |
diffusers | tests/pipelines/stable_diffusion_2/test_stable_diffusion_latent_upscale.py | .py | # coding=utf-8
# Copyright 2026 HuggingFace Inc.
#
# 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 ag... | 359 | 12,785 |
diffusers | tests/pipelines/stable_diffusion_2/test_stable_diffusion.py | .py | # coding=utf-8
# Copyright 2026 HuggingFace Inc.
#
# 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 ag... | 438 | 16,969 |
diffusers | tests/pipelines/stable_diffusion_2/test_stable_diffusion_inpaint.py | .py | # coding=utf-8
# Copyright 2026 HuggingFace Inc.
#
# 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 ag... | 294 | 10,936 |
diffusers | tests/pipelines/stable_diffusion_2/test_stable_diffusion_depth.py | .py | # coding=utf-8
# Copyright 2026 HuggingFace Inc.
#
# 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 ag... | 469 | 17,696 |
diffusers | tests/pipelines/stable_diffusion_2/test_stable_diffusion_upscale.py | .py | # coding=utf-8
# Copyright 2026 HuggingFace Inc.
#
# 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 ag... | 499 | 17,617 |
diffusers | tests/pipelines/stable_diffusion_2/test_stable_diffusion_v_pred.py | .py | # coding=utf-8
# Copyright 2026 HuggingFace Inc.
#
# 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 ag... | 555 | 21,186 |
diffusers | tests/pipelines/kandinsky5/test_kandinsky5_t2i.py | .py | # Copyright 2025 The Kandinsky Team and The HuggingFace Team.
#
# 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 applica... | 207 | 6,668 |
diffusers | tests/pipelines/kandinsky5/test_kandinsky5_i2v.py | .py | # Copyright 2025 The Kandinsky Team and The HuggingFace Team.
#
# 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 applica... | 211 | 6,693 |
diffusers | tests/pipelines/kandinsky5/test_kandinsky5_i2i.py | .py | # Copyright 2025 The Kandinsky Team and The HuggingFace Team.
#
# 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 applica... | 213 | 6,932 |
diffusers | tests/pipelines/kandinsky5/test_kandinsky5.py | .py | # Copyright 2025 The Kandinsky Team and The HuggingFace Team.
#
# 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 applica... | 210 | 6,549 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.