repo stringlengths 7 90 | file_url stringlengths 81 315 | file_path stringlengths 4 228 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 14:38:15 2026-01-05 02:33:18 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/community/pipeline_stable_diffusion_xl_controlnet_adapter_inpaint.py | examples/community/pipeline_stable_diffusion_xl_controlnet_adapter_inpaint.py | # Copyright 2025 Jake Babbidge, TencentARC 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
#
... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/community/lpw_stable_diffusion_onnx.py | examples/community/lpw_stable_diffusion_onnx.py | import inspect
import re
from typing import Callable, List, Optional, Union
import numpy as np
import PIL.Image
import torch
from packaging import version
from transformers import CLIPImageProcessor, CLIPTokenizer
import diffusers
from diffusers import OnnxRuntimeModel, OnnxStableDiffusionPipeline, SchedulerMixin
fro... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/community/kohya_hires_fix.py | examples/community/kohya_hires_fix.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/community/stable_diffusion_xl_reference.py | examples/community/stable_diffusion_xl_reference.py | # Based on stable_diffusion_reference.py
import inspect
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
import numpy as np
import PIL.Image
import torch
from diffusers import StableDiffusionXLPipeline
from diffusers.callbacks import MultiPipelineCallbacks, PipelineCallback
from diffusers.image_p... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/community/one_step_unet.py | examples/community/one_step_unet.py | #!/usr/bin/env python3
import torch
from diffusers import DiffusionPipeline
class UnetSchedulerOneForwardPipeline(DiffusionPipeline):
def __init__(self, unet, scheduler):
super().__init__()
self.register_modules(unet=unet, scheduler=scheduler)
def __call__(self):
image = torch.randn... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/community/bit_diffusion.py | examples/community/bit_diffusion.py | from typing import Optional, Tuple, Union
import torch
from einops import rearrange, reduce
from diffusers import DDIMScheduler, DDPMScheduler, DiffusionPipeline, ImagePipelineOutput, UNet2DConditionModel
from diffusers.schedulers.scheduling_ddim import DDIMSchedulerOutput
from diffusers.schedulers.scheduling_ddpm im... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/community/pipeline_flux_differential_img2img.py | examples/community/pipeline_flux_differential_img2img.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/community/latent_consistency_interpolate.py | examples/community/latent_consistency_interpolate.py | import inspect
from typing import Any, Callable, Dict, List, Optional, Union
import numpy as np
import torch
from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer
from diffusers.image_processor import VaeImageProcessor
from diffusers.loaders import FromSingleFileMixin, StableDiffusionLoraLoaderMix... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/community/mixture_tiling.py | examples/community/mixture_tiling.py | import inspect
from copy import deepcopy
from enum import Enum
from typing import List, Optional, Tuple, Union
import torch
from tqdm.auto import tqdm
from diffusers.models import AutoencoderKL, UNet2DConditionModel
from diffusers.pipelines.pipeline_utils import DiffusionPipeline
from diffusers.pipelines.stable_diffu... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/community/stable_diffusion_controlnet_img2img.py | examples/community/stable_diffusion_controlnet_img2img.py | # Inspired by: https://github.com/haofanwang/ControlNet-for-Diffusers/
import inspect
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
import numpy as np
import PIL.Image
import torch
from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer
from diffusers import AutoencoderKL, Co... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/community/checkpoint_merger.py | examples/community/checkpoint_merger.py | import glob
import os
from typing import Dict, List, Union
import safetensors.torch
import torch
from huggingface_hub import snapshot_download
from huggingface_hub.utils import validate_hf_hub_args
from diffusers import DiffusionPipeline, __version__
from diffusers.schedulers.scheduling_utils import SCHEDULER_CONFIG_... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/community/lpw_stable_diffusion.py | examples/community/lpw_stable_diffusion.py | import inspect
import re
from typing import Any, Callable, Dict, List, Optional, Union
import numpy as np
import PIL.Image
import torch
from packaging import version
from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer
from diffusers import DiffusionPipeline
from diffusers.configuration_utils imp... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/community/scheduling_ufogen.py | examples/community/scheduling_ufogen.py | # Copyright 2025 UC Berkeley 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 ... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/community/pipeline_demofusion_sdxl.py | examples/community/pipeline_demofusion_sdxl.py | import inspect
import os
import random
import warnings
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
import matplotlib.pyplot as plt
import torch
import torch.nn.functional as F
from transformers import CLIPTextModel, CLIPTextModelWithProjection, CLIPTokenizer
from diffusers.image_processor imp... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/community/mixture_canvas.py | examples/community/mixture_canvas.py | import re
from copy import deepcopy
from dataclasses import asdict, dataclass
from enum import Enum
from typing import List, Optional, Union
import numpy as np
import torch
from numpy import exp, pi, sqrt
from torchvision.transforms.functional import resize
from tqdm.auto import tqdm
from transformers import CLIPImage... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/community/stable_unclip.py | examples/community/stable_unclip.py | import types
from typing import List, Optional, Tuple, Union
import torch
from transformers import CLIPTextModelWithProjection, CLIPTokenizer
from transformers.models.clip.modeling_clip import CLIPTextModelOutput
from diffusers.models import PriorTransformer
from diffusers.pipelines import DiffusionPipeline, StableDi... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/community/img2img_inpainting.py | examples/community/img2img_inpainting.py | import inspect
from typing import Callable, List, Optional, Tuple, Union
import numpy as np
import PIL.Image
import torch
from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer
from diffusers import DiffusionPipeline
from diffusers.configuration_utils import FrozenDict
from diffusers.models import ... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/community/pipeline_stable_diffusion_xl_t5.py | examples/community/pipeline_stable_diffusion_xl_t5.py | # Copyright Philip Brown, ppbrown@github
#
# 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 ... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/community/pipeline_stg_hunyuan_video.py | 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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/community/ip_adapter_face_id.py | examples/community/ip_adapter_face_id.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/community/stable_diffusion_tensorrt_img2img.py | examples/community/stable_diffusion_tensorrt_img2img.py | #
# Copyright 2025 The HuggingFace Inc. team.
# SPDX-FileCopyrightText: Copyright (c) 1993-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licens... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/community/imagic_stable_diffusion.py | examples/community/imagic_stable_diffusion.py | """
modeled after the textual_inversion.py / train_dreambooth.py and the work
of justinpinkney here: https://github.com/justinpinkney/stable-diffusion/blob/main/notebooks/imagic.ipynb
"""
import inspect
import warnings
from typing import List, Optional, Union
import numpy as np
import PIL.Image
import torch
import to... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/community/pipeline_zero1to3.py | examples/community/pipeline_zero1to3.py | # A diffuser version implementation of Zero1to3 (https://github.com/cvlab-columbia/zero123), ICCV 2023
# by Xin Kong
import inspect
from typing import Any, Callable, Dict, List, Optional, Union
import kornia
import numpy as np
import PIL.Image
import torch
from packaging import version
from transformers import CLIPIm... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/amused/train_amused.py | examples/amused/train_amused.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
#
# Unless required by applicable... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/textual_inversion/textual_inversion_flax.py | examples/textual_inversion/textual_inversion_flax.py | import argparse
import logging
import math
import os
import random
from pathlib import Path
import jax
import jax.numpy as jnp
import numpy as np
import optax
import PIL
import torch
import torch.utils.checkpoint
import transformers
from flax import jax_utils
from flax.training import train_state
from flax.training.co... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/textual_inversion/test_textual_inversion_sdxl.py | examples/textual_inversion/test_textual_inversion_sdxl.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/textual_inversion/textual_inversion_sdxl.py | examples/textual_inversion/textual_inversion_sdxl.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/textual_inversion/test_textual_inversion.py | examples/textual_inversion/test_textual_inversion.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/textual_inversion/textual_inversion.py | examples/textual_inversion/textual_inversion.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/advanced_diffusion_training/train_dreambooth_lora_sd15_advanced.py | examples/advanced_diffusion_training/train_dreambooth_lora_sd15_advanced.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/advanced_diffusion_training/test_dreambooth_lora_flux_advanced.py | examples/advanced_diffusion_training/test_dreambooth_lora_flux_advanced.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/advanced_diffusion_training/train_dreambooth_lora_flux_advanced.py | examples/advanced_diffusion_training/train_dreambooth_lora_flux_advanced.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/advanced_diffusion_training/train_dreambooth_lora_sdxl_advanced.py | examples/advanced_diffusion_training/train_dreambooth_lora_sdxl_advanced.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/t2i_adapter/train_t2i_adapter_sdxl.py | examples/t2i_adapter/train_t2i_adapter_sdxl.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/t2i_adapter/test_t2i_adapter.py | examples/t2i_adapter/test_t2i_adapter.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/kandinsky2_2/text_to_image/train_text_to_image_lora_decoder.py | examples/kandinsky2_2/text_to_image/train_text_to_image_lora_decoder.py | # 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/LICENSE-2.0
#
# Unless r... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/kandinsky2_2/text_to_image/train_text_to_image_lora_prior.py | examples/kandinsky2_2/text_to_image/train_text_to_image_lora_prior.py | # 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/LICENSE-2.0
#
# Unless r... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/kandinsky2_2/text_to_image/train_text_to_image_prior.py | examples/kandinsky2_2/text_to_image/train_text_to_image_prior.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/kandinsky2_2/text_to_image/train_text_to_image_decoder.py | examples/kandinsky2_2/text_to_image/train_text_to_image_decoder.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/cogview4-control/train_control_cogview4.py | 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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/cogvideo/train_cogvideox_lora.py | examples/cogvideo/train_cogvideox_lora.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 applica... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/cogvideo/train_cogvideox_image_to_video_lora.py | examples/cogvideo/train_cogvideox_image_to_video_lora.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 applica... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/vqgan/train_vqgan.py | examples/vqgan/train_vqgan.py | # coding=utf-8
# Copyright 2023 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
#
# Unless required by applicable... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/vqgan/discriminator.py | examples/vqgan/discriminator.py | """
Ported from Paella
"""
import torch
from torch import nn
from diffusers.configuration_utils import ConfigMixin, register_to_config
from diffusers.models.modeling_utils import ModelMixin
# Discriminator model ported from Paella https://github.com/dome272/Paella/blob/main/src_distributed/vqgan.py
class Discrimina... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/vqgan/test_vqgan.py | examples/vqgan/test_vqgan.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/custom_diffusion/retrieve.py | examples/custom_diffusion/retrieve.py | # Copyright 2025 Custom Diffusion authors. 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 appl... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/custom_diffusion/train_custom_diffusion.py | examples/custom_diffusion/train_custom_diffusion.py | #!/usr/bin/env python
# coding=utf-8
# Copyright 2025 Custom Diffusion authors and 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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/custom_diffusion/test_custom_diffusion.py | examples/custom_diffusion/test_custom_diffusion.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/instruct_pix2pix/test_instruct_pix2pix.py | examples/instruct_pix2pix/test_instruct_pix2pix.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/instruct_pix2pix/train_instruct_pix2pix.py | examples/instruct_pix2pix/train_instruct_pix2pix.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/instruct_pix2pix/train_instruct_pix2pix_sdxl.py | examples/instruct_pix2pix/train_instruct_pix2pix_sdxl.py | #!/usr/bin/env python
# coding=utf-8
# Copyright 2025 Harutatsu Akiyama and 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.... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/dreambooth/train_dreambooth_lora_sdxl.py | examples/dreambooth/train_dreambooth_lora_sdxl.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/dreambooth/test_dreambooth.py | examples/dreambooth/test_dreambooth.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/dreambooth/test_dreambooth_lora_edm.py | examples/dreambooth/test_dreambooth_lora_edm.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/dreambooth/test_dreambooth_lora.py | examples/dreambooth/test_dreambooth_lora.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/dreambooth/train_dreambooth_lora.py | examples/dreambooth/train_dreambooth_lora.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/dreambooth/train_dreambooth_lora_flux2.py | examples/dreambooth/train_dreambooth_lora_flux2.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/dreambooth/test_dreambooth_lora_lumina2.py | 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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/dreambooth/train_dreambooth_lora_lumina2.py | 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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/dreambooth/test_dreambooth_lora_flux_kontext.py | examples/dreambooth/test_dreambooth_lora_flux_kontext.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/dreambooth/train_dreambooth_sd3.py | examples/dreambooth/train_dreambooth_sd3.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/dreambooth/train_dreambooth_lora_hidream.py | examples/dreambooth/train_dreambooth_lora_hidream.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/dreambooth/test_dreambooth_lora_qwenimage.py | examples/dreambooth/test_dreambooth_lora_qwenimage.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/dreambooth/test_dreambooth_lora_sana.py | examples/dreambooth/test_dreambooth_lora_sana.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/dreambooth/train_dreambooth_lora_flux_kontext.py | examples/dreambooth/train_dreambooth_lora_flux_kontext.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/dreambooth/test_dreambooth_lora_sd3.py | examples/dreambooth/test_dreambooth_lora_sd3.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/dreambooth/train_dreambooth_flax.py | examples/dreambooth/train_dreambooth_flax.py | import argparse
import logging
import math
import os
from pathlib import Path
import jax
import jax.numpy as jnp
import numpy as np
import optax
import torch
import torch.utils.checkpoint
import transformers
from flax import jax_utils
from flax.training import train_state
from flax.training.common_utils import shard
f... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/dreambooth/test_dreambooth_sd3.py | examples/dreambooth/test_dreambooth_sd3.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/dreambooth/train_dreambooth_lora_sd3.py | examples/dreambooth/train_dreambooth_lora_sd3.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/dreambooth/train_dreambooth_lora_flux2_img2img.py | examples/dreambooth/train_dreambooth_lora_flux2_img2img.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/dreambooth/test_dreambooth_flux.py | examples/dreambooth/test_dreambooth_flux.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/dreambooth/test_dreambooth_lora_hidream.py | examples/dreambooth/test_dreambooth_lora_hidream.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/dreambooth/train_dreambooth_lora_flux.py | examples/dreambooth/train_dreambooth_lora_flux.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/dreambooth/train_dreambooth.py | examples/dreambooth/train_dreambooth.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/dreambooth/test_dreambooth_lora_flux.py | examples/dreambooth/test_dreambooth_lora_flux.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/dreambooth/train_dreambooth_flux.py | examples/dreambooth/train_dreambooth_flux.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/dreambooth/convert_to_imagefolder.py | 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_... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/dreambooth/train_dreambooth_lora_sana.py | examples/dreambooth/train_dreambooth_lora_sana.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/dreambooth/train_dreambooth_lora_qwen_image.py | examples/dreambooth/train_dreambooth_lora_qwen_image.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/dreambooth/test_dreambooth_lora_flux2.py | examples/dreambooth/test_dreambooth_lora_flux2.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/controlnet/train_controlnet_flux.py | examples/controlnet/train_controlnet_flux.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/controlnet/train_controlnet_sdxl.py | examples/controlnet/train_controlnet_sdxl.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/controlnet/train_controlnet_sd3.py | examples/controlnet/train_controlnet_sd3.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/controlnet/test_controlnet.py | examples/controlnet/test_controlnet.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/controlnet/train_controlnet.py | examples/controlnet/train_controlnet.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/controlnet/train_controlnet_flax.py | examples/controlnet/train_controlnet_flax.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/server-async/serverasync.py | examples/server-async/serverasync.py | import asyncio
import gc
import logging
import os
import random
import threading
from contextlib import asynccontextmanager
from dataclasses import dataclass
from typing import Any, Dict, Optional, Type
import torch
from fastapi import FastAPI, HTTPException, Request
from fastapi.concurrency import run_in_threadpool
f... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/server-async/Pipelines.py | examples/server-async/Pipelines.py | import logging
import os
from dataclasses import dataclass, field
from typing import List
import torch
from pydantic import BaseModel
from diffusers.pipelines.stable_diffusion_3.pipeline_stable_diffusion_3 import StableDiffusion3Pipeline
logger = logging.getLogger(__name__)
class TextToImageInput(BaseModel):
... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/server-async/test.py | examples/server-async/test.py | import os
import time
import urllib.parse
import requests
SERVER_URL = "http://localhost:8500/api/diffusers/inference"
BASE_URL = "http://localhost:8500"
DOWNLOAD_FOLDER = "generated_images"
WAIT_BEFORE_DOWNLOAD = 2 # seconds
os.makedirs(DOWNLOAD_FOLDER, exist_ok=True)
def save_from_url(url: str) -> str:
"""... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/server-async/utils/requestscopedpipeline.py | examples/server-async/utils/requestscopedpipeline.py | import copy
import threading
from typing import Any, Iterable, List, Optional
import torch
from diffusers.utils import logging
from .scheduler import BaseAsyncScheduler, async_retrieve_timesteps
logger = logging.get_logger(__name__)
def safe_tokenize(tokenizer, *args, lock, **kwargs):
with lock:
retu... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/server-async/utils/utils.py | examples/server-async/utils/utils.py | import gc
import logging
import os
import tempfile
import uuid
import torch
logger = logging.getLogger(__name__)
class Utils:
def __init__(self, host: str = "0.0.0.0", port: int = 8500):
self.service_url = f"http://{host}:{port}"
self.image_dir = os.path.join(tempfile.gettempdir(), "images")
... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/server-async/utils/__init__.py | examples/server-async/utils/__init__.py | from .requestscopedpipeline import RequestScopedPipeline
from .utils import Utils
| python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/server-async/utils/scheduler.py | examples/server-async/utils/scheduler.py | import copy
import inspect
from typing import Any, List, Optional, Union
import torch
class BaseAsyncScheduler:
def __init__(self, scheduler: Any):
self.scheduler = scheduler
def __getattr__(self, name: str):
if hasattr(self.scheduler, name):
return getattr(self.scheduler, name)
... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/text_to_image/train_text_to_image.py | examples/text_to_image/train_text_to_image.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/text_to_image/test_text_to_image_lora.py | examples/text_to_image/test_text_to_image_lora.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/text_to_image/train_text_to_image_flax.py | examples/text_to_image/train_text_to_image_flax.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/text_to_image/test_text_to_image.py | examples/text_to_image/test_text_to_image.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | false |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/text_to_image/train_text_to_image_lora.py | examples/text_to_image/train_text_to_image_lora.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/text_to_image/train_text_to_image_lora_sdxl.py | examples/text_to_image/train_text_to_image_lora_sdxl.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
huggingface/diffusers | https://github.com/huggingface/diffusers/blob/47378066c002573613a1dba686570fbd5a1cf48a/examples/text_to_image/train_text_to_image_sdxl.py | examples/text_to_image/train_text_to_image_sdxl.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... | python | Apache-2.0 | 47378066c002573613a1dba686570fbd5a1cf48a | 2026-01-04T14:42:56.953111Z | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.