sample_id stringlengths 21 196 | text stringlengths 105 936k | metadata dict | category stringclasses 6
values |
|---|---|---|---|
huggingface/diffusers:src/diffusers/pipelines/sana/pipeline_sana_sprint.py | # Copyright 2025 SANA-Sprint 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
#
# Unle... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/pipelines/sana/pipeline_sana_sprint.py",
"license": "Apache License 2.0",
"lines": 792,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:src/diffusers/schedulers/scheduling_scm.py | # # Copyright 2025 Sana-Sprint 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
#
# Un... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/schedulers/scheduling_scm.py",
"license": "Apache License 2.0",
"lines": 236,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:tests/pipelines/sana/test_sana_sprint.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... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/pipelines/sana/test_sana_sprint.py",
"license": "Apache License 2.0",
"lines": 257,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:src/diffusers/hooks/faster_cache.py | # 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 applicabl... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/hooks/faster_cache.py",
"license": "Apache License 2.0",
"lines": 557,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:src/diffusers/pipelines/ltx/pipeline_ltx_condition.py | # Copyright 2025 Lightricks 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 requir... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/pipelines/ltx/pipeline_ltx_condition.py",
"license": "Apache License 2.0",
"lines": 1137,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:tests/pipelines/ltx/test_ltx_condition.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... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/pipelines/ltx/test_ltx_condition.py",
"license": "Apache License 2.0",
"lines": 239,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:examples/cogview4-control/train_control_cogview4.py | #!/usr/bin/env python
# coding=utf-8
# Copyright 2025 The HuggingFace Inc. 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/LI... | {
"repo_id": "huggingface/diffusers",
"file_path": "examples/cogview4-control/train_control_cogview4.py",
"license": "Apache License 2.0",
"lines": 1101,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:src/diffusers/pipelines/cogview4/pipeline_cogview4_control.py | # Copyright 2025 The CogVideoX team, Tsinghua University & ZhipuAI 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.o... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/pipelines/cogview4/pipeline_cogview4_control.py",
"license": "Apache License 2.0",
"lines": 643,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:tests/remote/test_remote_encode.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... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/remote/test_remote_encode.py",
"license": "Apache License 2.0",
"lines": 198,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:examples/research_projects/anytext/anytext.py | # Copyright 2025 The HuggingFace Team. All rights reserved.
# Copyright (c) Alibaba, Inc. and its affiliates.
#
# 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/lic... | {
"repo_id": "huggingface/diffusers",
"file_path": "examples/research_projects/anytext/anytext.py",
"license": "Apache License 2.0",
"lines": 2105,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:examples/research_projects/anytext/anytext_controlnet.py | # Copyright 2023 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... | {
"repo_id": "huggingface/diffusers",
"file_path": "examples/research_projects/anytext/anytext_controlnet.py",
"license": "Apache License 2.0",
"lines": 411,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:examples/research_projects/anytext/ocr_recog/RNN.py | import torch
from torch import nn
from .RecSVTR import Block
class Swish(nn.Module):
def __int__(self):
super(Swish, self).__int__()
def forward(self, x):
return x * torch.sigmoid(x)
class Im2Im(nn.Module):
def __init__(self, in_channels, **kwargs):
super().__init__()
s... | {
"repo_id": "huggingface/diffusers",
"file_path": "examples/research_projects/anytext/ocr_recog/RNN.py",
"license": "Apache License 2.0",
"lines": 178,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
huggingface/diffusers:examples/research_projects/anytext/ocr_recog/RecCTCHead.py | from torch import nn
class CTCHead(nn.Module):
def __init__(
self, in_channels, out_channels=6625, fc_decay=0.0004, mid_channels=None, return_feats=False, **kwargs
):
super(CTCHead, self).__init__()
if mid_channels is None:
self.fc = nn.Linear(
in_channels,
... | {
"repo_id": "huggingface/diffusers",
"file_path": "examples/research_projects/anytext/ocr_recog/RecCTCHead.py",
"license": "Apache License 2.0",
"lines": 39,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
huggingface/diffusers:examples/research_projects/anytext/ocr_recog/RecModel.py | from torch import nn
from .RecCTCHead import CTCHead
from .RecMv1_enhance import MobileNetV1Enhance
from .RNN import Im2Im, Im2Seq, SequenceEncoder
backbone_dict = {"MobileNetV1Enhance": MobileNetV1Enhance}
neck_dict = {"SequenceEncoder": SequenceEncoder, "Im2Seq": Im2Seq, "None": Im2Im}
head_dict = {"CTCHead": CTCH... | {
"repo_id": "huggingface/diffusers",
"file_path": "examples/research_projects/anytext/ocr_recog/RecModel.py",
"license": "Apache License 2.0",
"lines": 37,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
huggingface/diffusers:examples/research_projects/anytext/ocr_recog/RecMv1_enhance.py | import torch
import torch.nn as nn
import torch.nn.functional as F
from .common import Activation
class ConvBNLayer(nn.Module):
def __init__(
self, num_channels, filter_size, num_filters, stride, padding, channels=None, num_groups=1, act="hard_swish"
):
super(ConvBNLayer, self).__init__()
... | {
"repo_id": "huggingface/diffusers",
"file_path": "examples/research_projects/anytext/ocr_recog/RecMv1_enhance.py",
"license": "Apache License 2.0",
"lines": 169,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
huggingface/diffusers:examples/research_projects/anytext/ocr_recog/RecSVTR.py | import numpy as np
import torch
import torch.nn as nn
from torch.nn import functional
from torch.nn.init import ones_, trunc_normal_, zeros_
def drop_path(x, drop_prob=0.0, training=False):
"""Drop paths (Stochastic Depth) per sample (when applied in main path of residual blocks).
the original name is mislead... | {
"repo_id": "huggingface/diffusers",
"file_path": "examples/research_projects/anytext/ocr_recog/RecSVTR.py",
"license": "Apache License 2.0",
"lines": 519,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
huggingface/diffusers:examples/research_projects/anytext/ocr_recog/common.py | import torch
import torch.nn as nn
import torch.nn.functional as F
class Hswish(nn.Module):
def __init__(self, inplace=True):
super(Hswish, self).__init__()
self.inplace = inplace
def forward(self, x):
return x * F.relu6(x + 3.0, inplace=self.inplace) / 6.0
# out = max(0, min(1, slo... | {
"repo_id": "huggingface/diffusers",
"file_path": "examples/research_projects/anytext/ocr_recog/common.py",
"license": "Apache License 2.0",
"lines": 59,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
huggingface/diffusers:tests/quantization/utils.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... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/quantization/utils.py",
"license": "Apache License 2.0",
"lines": 36,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:tests/lora/test_lora_layers_cogview4.py | # 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 agreed to in writ... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/lora/test_lora_layers_cogview4.py",
"license": "Apache License 2.0",
"lines": 136,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:tests/single_file/test_sana_transformer.py | from diffusers import (
SanaTransformer2DModel,
)
from ..testing_utils import (
enable_full_determinism,
)
from .single_file_testing_utils import SingleFileModelTesterMixin
enable_full_determinism()
class TestSanaTransformer2DModelSingleFile(SingleFileModelTesterMixin):
model_class = SanaTransformer2DM... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/single_file/test_sana_transformer.py",
"license": "Apache License 2.0",
"lines": 18,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:src/diffusers/quantizers/quanto/quanto_quantizer.py | from typing import TYPE_CHECKING, Any
from diffusers.utils.import_utils import is_optimum_quanto_version
from ...utils import (
get_module_from_name,
is_accelerate_available,
is_accelerate_version,
is_optimum_quanto_available,
is_torch_available,
logging,
)
from ..base import DiffusersQuantize... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/quantizers/quanto/quanto_quantizer.py",
"license": "Apache License 2.0",
"lines": 146,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
huggingface/diffusers:src/diffusers/quantizers/quanto/utils.py | import torch.nn as nn
from ...utils import is_accelerate_available, logging
logger = logging.get_logger(__name__)
if is_accelerate_available():
from accelerate import init_empty_weights
def _replace_with_quanto_layers(model, quantization_config, modules_to_not_convert: list, pre_quantized=False):
# Quanto... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/quantizers/quanto/utils.py",
"license": "Apache License 2.0",
"lines": 44,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
huggingface/diffusers:tests/quantization/quanto/test_quanto.py | import gc
import tempfile
import unittest
from diffusers import FluxPipeline, FluxTransformer2DModel, QuantoConfig
from diffusers.models.attention_processor import Attention
from diffusers.utils import is_optimum_quanto_available, is_torch_available
from ...testing_utils import (
backend_empty_cache,
backend_... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/quantization/quanto/test_quanto.py",
"license": "Apache License 2.0",
"lines": 262,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:examples/community/pipeline_stg_cogvideox.py | # Copyright 2025 The CogVideoX team, Tsinghua University & ZhipuAI 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.o... | {
"repo_id": "huggingface/diffusers",
"file_path": "examples/community/pipeline_stg_cogvideox.py",
"license": "Apache License 2.0",
"lines": 757,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:examples/community/pipeline_stg_hunyuan_video.py | # Copyright 2025 The HunyuanVideo Team 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
#
# Un... | {
"repo_id": "huggingface/diffusers",
"file_path": "examples/community/pipeline_stg_hunyuan_video.py",
"license": "Apache License 2.0",
"lines": 714,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:examples/community/pipeline_stg_ltx.py | # Copyright 2025 Lightricks 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 requir... | {
"repo_id": "huggingface/diffusers",
"file_path": "examples/community/pipeline_stg_ltx.py",
"license": "Apache License 2.0",
"lines": 779,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:examples/community/pipeline_stg_ltx_image2video.py | # Copyright 2025 Lightricks 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 requir... | {
"repo_id": "huggingface/diffusers",
"file_path": "examples/community/pipeline_stg_ltx_image2video.py",
"license": "Apache License 2.0",
"lines": 867,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:examples/community/pipeline_stg_mochi.py | # Copyright 2025 Genmo 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 by... | {
"repo_id": "huggingface/diffusers",
"file_path": "examples/community/pipeline_stg_mochi.py",
"license": "Apache License 2.0",
"lines": 758,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:tests/single_file/test_model_wan_autoencoder_single_file.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... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/single_file/test_model_wan_autoencoder_single_file.py",
"license": "Apache License 2.0",
"lines": 29,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:tests/single_file/test_model_wan_transformer3d_single_file.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... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/single_file/test_model_wan_transformer3d_single_file.py",
"license": "Apache License 2.0",
"lines": 36,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:src/diffusers/pipelines/hunyuan_video/pipeline_hunyuan_video_image2video.py | # Copyright 2025 The HunyuanVideo Team 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
#
# Un... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/pipelines/hunyuan_video/pipeline_hunyuan_video_image2video.py",
"license": "Apache License 2.0",
"lines": 885,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": "... | license |
huggingface/diffusers:tests/pipelines/hunyuan_video/test_hunyuan_image2video.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... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/pipelines/hunyuan_video/test_hunyuan_image2video.py",
"license": "Apache License 2.0",
"lines": 337,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:examples/community/cogvideox_ddim_inversion.py | """
This script performs DDIM inversion for video frames using a pre-trained model and generates
a video reconstruction based on a provided prompt. It utilizes the CogVideoX pipeline to
process video frames, apply the DDIM inverse scheduler, and produce an output video.
**Please notice that this script is based on the... | {
"repo_id": "huggingface/diffusers",
"file_path": "examples/community/cogvideox_ddim_inversion.py",
"license": "Apache License 2.0",
"lines": 551,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
huggingface/diffusers:examples/community/mod_controlnet_tile_sr_sdxl.py | # Copyright 2025 The DEVAIEXP Team 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... | {
"repo_id": "huggingface/diffusers",
"file_path": "examples/community/mod_controlnet_tile_sr_sdxl.py",
"license": "Apache License 2.0",
"lines": 1602,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:tests/lora/test_lora_layers_wan.py | # 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 agreed to in writ... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/lora/test_lora_layers_wan.py",
"license": "Apache License 2.0",
"lines": 94,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:src/diffusers/models/autoencoders/autoencoder_kl_magvit.py | # Copyright 2025 The EasyAnimate team 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
#
# U... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/models/autoencoders/autoencoder_kl_magvit.py",
"license": "Apache License 2.0",
"lines": 923,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:src/diffusers/models/transformers/transformer_easyanimate.py | # Copyright 2025 The EasyAnimate team 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
#
# U... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/models/transformers/transformer_easyanimate.py",
"license": "Apache License 2.0",
"lines": 460,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:src/diffusers/pipelines/easyanimate/pipeline_easyanimate.py | # Copyright 2025 The EasyAnimate team 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
#
# U... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/pipelines/easyanimate/pipeline_easyanimate.py",
"license": "Apache License 2.0",
"lines": 680,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:src/diffusers/pipelines/easyanimate/pipeline_easyanimate_control.py | # Copyright 2025 The EasyAnimate team 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
#
# U... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/pipelines/easyanimate/pipeline_easyanimate_control.py",
"license": "Apache License 2.0",
"lines": 879,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:src/diffusers/pipelines/easyanimate/pipeline_easyanimate_inpaint.py | # Copyright 2025 The EasyAnimate team 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
#
# U... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/pipelines/easyanimate/pipeline_easyanimate_inpaint.py",
"license": "Apache License 2.0",
"lines": 1095,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:src/diffusers/pipelines/easyanimate/pipeline_output.py | from dataclasses import dataclass
import torch
from diffusers.utils import BaseOutput
@dataclass
class EasyAnimatePipelineOutput(BaseOutput):
r"""
Output class for EasyAnimate pipelines.
Args:
frames (`torch.Tensor`, `np.ndarray`, or list[list[PIL.Image.Image]]):
list of video outpu... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/pipelines/easyanimate/pipeline_output.py",
"license": "Apache License 2.0",
"lines": 14,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | documentation |
huggingface/diffusers:tests/models/autoencoders/test_models_autoencoder_magvit.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... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/models/autoencoders/test_models_autoencoder_magvit.py",
"license": "Apache License 2.0",
"lines": 79,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:tests/models/transformers/test_models_transformer_easyanimate.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... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/models/transformers/test_models_transformer_easyanimate.py",
"license": "Apache License 2.0",
"lines": 72,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:tests/pipelines/easyanimate/test_easyanimate.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... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/pipelines/easyanimate/test_easyanimate.py",
"license": "Apache License 2.0",
"lines": 247,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:src/diffusers/utils/remote_utils.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... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/utils/remote_utils.py",
"license": "Apache License 2.0",
"lines": 384,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:tests/remote/test_remote_decode.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... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/remote/test_remote_decode.py",
"license": "Apache License 2.0",
"lines": 489,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:scripts/convert_wan_to_diffusers.py | import argparse
import pathlib
from typing import Any, Dict, Tuple
import torch
from accelerate import init_empty_weights
from huggingface_hub import hf_hub_download, snapshot_download
from safetensors.torch import load_file
from transformers import (
AutoProcessor,
AutoTokenizer,
CLIPImageProcessor,
C... | {
"repo_id": "huggingface/diffusers",
"file_path": "scripts/convert_wan_to_diffusers.py",
"license": "Apache License 2.0",
"lines": 1191,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
huggingface/diffusers:src/diffusers/models/autoencoders/autoencoder_kl_wan.py | # Copyright 2025 The Wan Team 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 requ... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/models/autoencoders/autoencoder_kl_wan.py",
"license": "Apache License 2.0",
"lines": 1202,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:src/diffusers/models/transformers/transformer_wan.py | # Copyright 2025 The Wan Team 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 requ... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/models/transformers/transformer_wan.py",
"license": "Apache License 2.0",
"lines": 600,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:src/diffusers/pipelines/wan/pipeline_output.py | from dataclasses import dataclass
import torch
from diffusers.utils import BaseOutput
@dataclass
class WanPipelineOutput(BaseOutput):
r"""
Output class for Wan pipelines.
Args:
frames (`torch.Tensor`, `np.ndarray`, or list[list[PIL.Image.Image]]):
list of video outputs - It can be a... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/pipelines/wan/pipeline_output.py",
"license": "Apache License 2.0",
"lines": 14,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | documentation |
huggingface/diffusers:src/diffusers/pipelines/wan/pipeline_wan.py | # Copyright 2025 The Wan Team 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 requ... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/pipelines/wan/pipeline_wan.py",
"license": "Apache License 2.0",
"lines": 583,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:src/diffusers/pipelines/wan/pipeline_wan_i2v.py | # Copyright 2025 The Wan Team 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 requ... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/pipelines/wan/pipeline_wan_i2v.py",
"license": "Apache License 2.0",
"lines": 733,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:tests/models/autoencoders/test_models_autoencoder_wan.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... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/models/autoencoders/test_models_autoencoder_wan.py",
"license": "Apache License 2.0",
"lines": 74,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:tests/models/transformers/test_models_transformer_wan.py | # 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 agreed to in writ... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/models/transformers/test_models_transformer_wan.py",
"license": "Apache License 2.0",
"lines": 186,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:tests/pipelines/wan/test_wan.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... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/pipelines/wan/test_wan.py",
"license": "Apache License 2.0",
"lines": 171,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:tests/pipelines/wan/test_wan_image_to_video.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... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/pipelines/wan/test_wan_image_to_video.py",
"license": "Apache License 2.0",
"lines": 332,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:src/diffusers/pipelines/marigold/pipeline_marigold_intrinsics.py | # Copyright 2023-2025 Marigold Team, ETH Zürich. All rights reserved.
# Copyright 2024-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
#
# ... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/pipelines/marigold/pipeline_marigold_intrinsics.py",
"license": "Apache License 2.0",
"lines": 641,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:tests/pipelines/marigold/test_marigold_intrinsics.py | # Copyright 2023-2025 Marigold Team, ETH Zürich. All rights reserved.
# Copyright 2024-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
#
# ... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/pipelines/marigold/test_marigold_intrinsics.py",
"license": "Apache License 2.0",
"lines": 558,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:src/diffusers/utils/typing_utils.py | # 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 applicabl... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/utils/typing_utils.py",
"license": "Apache License 2.0",
"lines": 80,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:utils/extract_tests_from_mixin.py | import argparse
import inspect
import sys
from pathlib import Path
from typing import List, Type
root_dir = Path(__file__).parent.parent.absolute()
sys.path.insert(0, str(root_dir))
parser = argparse.ArgumentParser()
parser.add_argument("--type", type=str, default=None)
args = parser.parse_args()
def get_test_meth... | {
"repo_id": "huggingface/diffusers",
"file_path": "utils/extract_tests_from_mixin.py",
"license": "Apache License 2.0",
"lines": 44,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
huggingface/diffusers:src/diffusers/pipelines/hunyuan_video/pipeline_hunyuan_skyreels_image2video.py | # Copyright 2025 The HunyuanVideo Team 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
#
# Un... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/pipelines/hunyuan_video/pipeline_hunyuan_skyreels_image2video.py",
"license": "Apache License 2.0",
"lines": 734,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template"... | license |
huggingface/diffusers:tests/pipelines/hunyuan_video/test_hunyuan_skyreels_image2video.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... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/pipelines/hunyuan_video/test_hunyuan_skyreels_image2video.py",
"license": "Apache License 2.0",
"lines": 296,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:src/diffusers/utils/source_code_parsing_utils.py | import ast
import importlib
import inspect
import textwrap
class ReturnNameVisitor(ast.NodeVisitor):
"""Thanks to ChatGPT for pairing."""
def __init__(self):
self.return_names = []
def visit_Return(self, node):
# Check if the return value is a tuple.
if isinstance(node.value, ast... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/utils/source_code_parsing_utils.py",
"license": "Apache License 2.0",
"lines": 45,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
huggingface/diffusers:tests/others/test_check_support_list.py | import os
import sys
import unittest
from unittest.mock import mock_open, patch
git_repo_path = os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
sys.path.append(os.path.join(git_repo_path, "utils"))
from check_support_list import check_documentation # noqa: E402
class TestCheckSupportL... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/others/test_check_support_list.py",
"license": "Apache License 2.0",
"lines": 54,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:utils/check_support_list.py | # coding=utf-8
# Copyright 2025 The HuggingFace Inc. 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
#
"""
Utility that checks that mo... | {
"repo_id": "huggingface/diffusers",
"file_path": "utils/check_support_list.py",
"license": "Apache License 2.0",
"lines": 108,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:examples/dreambooth/test_dreambooth_lora_lumina2.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... | {
"repo_id": "huggingface/diffusers",
"file_path": "examples/dreambooth/test_dreambooth_lora_lumina2.py",
"license": "Apache License 2.0",
"lines": 176,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:examples/dreambooth/train_dreambooth_lora_lumina2.py | #!/usr/bin/env python
# coding=utf-8
# Copyright 2025 The HuggingFace Inc. 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/LI... | {
"repo_id": "huggingface/diffusers",
"file_path": "examples/dreambooth/train_dreambooth_lora_lumina2.py",
"license": "Apache License 2.0",
"lines": 1386,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:tests/lora/test_lora_layers_lumina2.py | # 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 agreed to in writ... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/lora/test_lora_layers_lumina2.py",
"license": "Apache License 2.0",
"lines": 125,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:scripts/convert_cogview4_to_diffusers.py | """
Convert a CogView4 checkpoint from SAT(https://github.com/THUDM/SwissArmyTransformer) to the Diffusers format.
(deprecated Since 2025-02-07 and will remove it in later CogView4 version)
This script converts a CogView4 checkpoint to the Diffusers format, which can then be used
with the Diffusers library.
Example u... | {
"repo_id": "huggingface/diffusers",
"file_path": "scripts/convert_cogview4_to_diffusers.py",
"license": "Apache License 2.0",
"lines": 212,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
huggingface/diffusers:scripts/convert_cogview4_to_diffusers_megatron.py | """
Convert a CogView4 checkpoint from Megatron to the Diffusers format.
Example usage:
python scripts/convert_cogview4_to_diffusers.py \
--transformer_checkpoint_path 'your path/cogview4_6b/mp_rank_00/model_optim_rng.pt' \
--vae_checkpoint_path 'your path/cogview4_6b/imagekl_ch16.pt' \
--o... | {
"repo_id": "huggingface/diffusers",
"file_path": "scripts/convert_cogview4_to_diffusers_megatron.py",
"license": "Apache License 2.0",
"lines": 333,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
huggingface/diffusers:src/diffusers/models/transformers/transformer_cogview4.py | # Copyright 2025 The CogView team, Tsinghua University & ZhipuAI 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/l... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/models/transformers/transformer_cogview4.py",
"license": "Apache License 2.0",
"lines": 653,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:src/diffusers/pipelines/cogview4/pipeline_cogview4.py | # Copyright 2025 The CogVideoX team, Tsinghua University & ZhipuAI 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.o... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/pipelines/cogview4/pipeline_cogview4.py",
"license": "Apache License 2.0",
"lines": 605,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:src/diffusers/pipelines/cogview4/pipeline_output.py | from dataclasses import dataclass
import numpy as np
import PIL.Image
from ...utils import BaseOutput
@dataclass
class CogView4PipelineOutput(BaseOutput):
"""
Output class for CogView3 pipelines.
Args:
images (`list[PIL.Image.Image]` or `np.ndarray`)
list of denoised PIL images of l... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/pipelines/cogview4/pipeline_output.py",
"license": "Apache License 2.0",
"lines": 14,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | documentation |
huggingface/diffusers:tests/models/transformers/test_models_transformer_cogview4.py | # 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 agreed to in writ... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/models/transformers/test_models_transformer_cogview4.py",
"license": "Apache License 2.0",
"lines": 68,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:tests/pipelines/cogview4/test_cogview4.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... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/pipelines/cogview4/test_cogview4.py",
"license": "Apache License 2.0",
"lines": 195,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:src/diffusers/hooks/group_offloading.py | # 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 applicabl... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/hooks/group_offloading.py",
"license": "Apache License 2.0",
"lines": 807,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:tests/hooks/test_group_offloading.py | # 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 agreed to in writ... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/hooks/test_group_offloading.py",
"license": "Apache License 2.0",
"lines": 451,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:src/diffusers/models/controlnets/multicontrolnet_union.py | import os
from typing import Any, Callable
import torch
from torch import nn
from ...utils import logging
from ..controlnets.controlnet import ControlNetOutput
from ..controlnets.controlnet_union import ControlNetUnionModel
from ..modeling_utils import ModelMixin
logger = logging.get_logger(__name__)
class MultiC... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/models/controlnets/multicontrolnet_union.py",
"license": "Apache License 2.0",
"lines": 170,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | documentation |
huggingface/diffusers:tests/single_file/test_lumina2_transformer.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... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/single_file/test_lumina2_transformer.py",
"license": "Apache License 2.0",
"lines": 30,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:src/diffusers/models/transformers/transformer_lumina2.py | # Copyright 2025 Alpha-VLLM 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
#
# Unles... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/models/transformers/transformer_lumina2.py",
"license": "Apache License 2.0",
"lines": 452,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:src/diffusers/pipelines/lumina2/pipeline_lumina2.py | # Copyright 2025 Alpha-VLLM 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 requir... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/pipelines/lumina2/pipeline_lumina2.py",
"license": "Apache License 2.0",
"lines": 723,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:tests/models/transformers/test_models_transformer_lumina2.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... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/models/transformers/test_models_transformer_lumina2.py",
"license": "Apache License 2.0",
"lines": 73,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:tests/pipelines/lumina2/test_pipeline_lumina2.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... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/pipelines/lumina2/test_pipeline_lumina2.py",
"license": "Apache License 2.0",
"lines": 104,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:examples/community/mixture_tiling_sdxl.py | # Copyright 2025 The DEVAIEXP Team 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
#
... | {
"repo_id": "huggingface/diffusers",
"file_path": "examples/community/mixture_tiling_sdxl.py",
"license": "Apache License 2.0",
"lines": 1054,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:scripts/convert_omnigen_to_diffusers.py | import argparse
import os
import torch
from huggingface_hub import snapshot_download
from safetensors.torch import load_file
from transformers import AutoTokenizer
from diffusers import AutoencoderKL, FlowMatchEulerDiscreteScheduler, OmniGenPipeline, OmniGenTransformer2DModel
def main(args):
# checkpoint from h... | {
"repo_id": "huggingface/diffusers",
"file_path": "scripts/convert_omnigen_to_diffusers.py",
"license": "Apache License 2.0",
"lines": 184,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
huggingface/diffusers:src/diffusers/models/transformers/transformer_omnigen.py | # Copyright 2025 OmniGen team 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 requ... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/models/transformers/transformer_omnigen.py",
"license": "Apache License 2.0",
"lines": 398,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:src/diffusers/pipelines/omnigen/pipeline_omnigen.py | # Copyright 2025 OmniGen team 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 requ... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/pipelines/omnigen/pipeline_omnigen.py",
"license": "Apache License 2.0",
"lines": 477,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:src/diffusers/pipelines/omnigen/processor_omnigen.py | # Copyright 2025 OmniGen team 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 requ... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/pipelines/omnigen/processor_omnigen.py",
"license": "Apache License 2.0",
"lines": 273,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:tests/models/transformers/test_models_transformer_omnigen.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... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/models/transformers/test_models_transformer_omnigen.py",
"license": "Apache License 2.0",
"lines": 73,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:tests/pipelines/omnigen/test_pipeline_omnigen.py | import gc
import unittest
import numpy as np
import torch
from transformers import AutoTokenizer
from diffusers import AutoencoderKL, FlowMatchEulerDiscreteScheduler, OmniGenPipeline, OmniGenTransformer2DModel
from ...testing_utils import (
Expectations,
backend_empty_cache,
numpy_cosine_similarity_dista... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/pipelines/omnigen/test_pipeline_omnigen.py",
"license": "Apache License 2.0",
"lines": 156,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:src/diffusers/hooks/pyramid_attention_broadcast.py | # 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 applicabl... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/hooks/pyramid_attention_broadcast.py",
"license": "Apache License 2.0",
"lines": 264,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:src/diffusers/models/cache_utils.py | # 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 applicabl... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/models/cache_utils.py",
"license": "Apache License 2.0",
"lines": 125,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:tests/hooks/test_hooks.py | # 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 agreed to in writ... | {
"repo_id": "huggingface/diffusers",
"file_path": "tests/hooks/test_hooks.py",
"license": "Apache License 2.0",
"lines": 297,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
huggingface/diffusers:examples/dreambooth/convert_to_imagefolder.py | import argparse
import json
import pathlib
parser = argparse.ArgumentParser()
parser.add_argument(
"--path",
type=str,
required=True,
help="Path to folder with image-text pairs.",
)
parser.add_argument("--caption_column", type=str, default="prompt", help="Name of caption column.")
args = parser.parse_... | {
"repo_id": "huggingface/diffusers",
"file_path": "examples/dreambooth/convert_to_imagefolder.py",
"license": "Apache License 2.0",
"lines": 26,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
huggingface/diffusers:examples/community/pipeline_flux_semantic_guidance.py | # Copyright 2025 Black Forest Labs 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... | {
"repo_id": "huggingface/diffusers",
"file_path": "examples/community/pipeline_flux_semantic_guidance.py",
"license": "Apache License 2.0",
"lines": 1199,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:examples/research_projects/autoencoderkl/train_autoencoderkl.py | #!/usr/bin/env python
# coding=utf-8
# Copyright 2025 The HuggingFace Inc. 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/LI... | {
"repo_id": "huggingface/diffusers",
"file_path": "examples/research_projects/autoencoderkl/train_autoencoderkl.py",
"license": "Apache License 2.0",
"lines": 949,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:examples/community/pipeline_stable_diffusion_xl_attentive_eraser.py | # 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 applicabl... | {
"repo_id": "huggingface/diffusers",
"file_path": "examples/community/pipeline_stable_diffusion_xl_attentive_eraser.py",
"license": "Apache License 2.0",
"lines": 2009,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:scripts/extract_lora_from_model.py | """
This script demonstrates how to extract a LoRA checkpoint from a fully finetuned model with the CogVideoX model.
To make it work for other models:
* Change the model class. Here we use `CogVideoXTransformer3DModel`. For Flux, it would be `FluxTransformer2DModel`,
for example. (TODO: more reason to add `AutoModel`... | {
"repo_id": "huggingface/diffusers",
"file_path": "scripts/extract_lora_from_model.py",
"license": "Apache License 2.0",
"lines": 121,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
huggingface/diffusers:src/diffusers/hooks/hooks.py | # 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 applicabl... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/hooks/hooks.py",
"license": "Apache License 2.0",
"lines": 233,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
huggingface/diffusers:src/diffusers/hooks/layerwise_casting.py | # 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 applicabl... | {
"repo_id": "huggingface/diffusers",
"file_path": "src/diffusers/hooks/layerwise_casting.py",
"license": "Apache License 2.0",
"lines": 200,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | license |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.