index int64 0 0 | repo_id stringclasses 351
values | file_path stringlengths 26 186 | content stringlengths 1 990k |
|---|---|---|---|
0 | hf_public_repos/diffusers/examples/research_projects/wuerstchen | hf_public_repos/diffusers/examples/research_projects/wuerstchen/text_to_image/requirements.txt | accelerate>=0.16.0
torchvision
transformers>=4.25.1
wandb
bitsandbytes
deepspeed
peft>=0.6.0
|
0 | hf_public_repos/diffusers/examples/research_projects/wuerstchen | hf_public_repos/diffusers/examples/research_projects/wuerstchen/text_to_image/README.md | # Würstchen text-to-image fine-tuning
## Running locally with PyTorch
Before running the scripts, make sure to install the library's training dependencies:
**Important**
To make sure you can successfully run the latest versions of the example scripts, we highly recommend **installing from source** and keeping the i... |
0 | hf_public_repos/diffusers/examples/research_projects/wuerstchen | hf_public_repos/diffusers/examples/research_projects/wuerstchen/text_to_image/train_text_to_image_prior.py | # Copyright 2024 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 required by appl... |
0 | hf_public_repos/diffusers/examples/research_projects/wuerstchen | hf_public_repos/diffusers/examples/research_projects/wuerstchen/text_to_image/modeling_efficient_net_encoder.py | import torch.nn as nn
from torchvision.models import efficientnet_v2_l, efficientnet_v2_s
from diffusers.configuration_utils import ConfigMixin, register_to_config
from diffusers.models.modeling_utils import ModelMixin
class EfficientNetEncoder(ModelMixin, ConfigMixin):
@register_to_config
def __init__(self,... |
0 | hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/pixart/controlnet_pixart_alpha.py | from typing import Any, Dict, Optional
import torch
from torch import nn
from diffusers.configuration_utils import ConfigMixin, register_to_config
from diffusers.models import PixArtTransformer2DModel
from diffusers.models.attention import BasicTransformerBlock
from diffusers.models.modeling_outputs import Transforme... |
0 | hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/pixart/train_controlnet_hf_diffusers.sh | #!/bin/bash
# run
# accelerate config
# check with
# accelerate env
export MODEL_DIR="PixArt-alpha/PixArt-XL-2-512x512"
export OUTPUT_DIR="output/pixart-controlnet-hf-diffusers-test"
accelerate launch ./train_pixart_controlnet_hf.py --mixed_precision="fp16" \
--pretrained_model_name_or_path=$MODEL_DIR \
--output_... |
0 | hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/pixart/requirements.txt | transformers
SentencePiece
torchvision
controlnet-aux
datasets
# wandb |
0 | hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/pixart/run_pixart_alpha_controlnet_pipeline.py | import torch
import torchvision.transforms as T
from controlnet_aux import HEDdetector
from diffusers.utils import load_image
from examples.research_projects.pixart.controlnet_pixart_alpha import PixArtControlNetAdapterModel
from examples.research_projects.pixart.pipeline_pixart_alpha_controlnet import PixArtAlphaCont... |
0 | hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/pixart/train_pixart_controlnet_hf.py | # coding=utf-8
# Copyright 2023 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... |
0 | hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/pixart/pipeline_pixart_alpha_controlnet.py | # Copyright 2024 PixArt-Alpha 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
#
# Unl... |
0 | hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/promptdiffusion/convert_original_promptdiffusion_to_diffusers.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... |
0 | hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/promptdiffusion/README.md | # PromptDiffusion Pipeline
From the project [page](https://zhendong-wang.github.io/prompt-diffusion.github.io/)
"With a prompt consisting of a task-specific example pair of images and text guidance, and a new query image, Prompt Diffusion can comprehend the desired task and generate the corresponding output image on ... |
0 | hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/promptdiffusion/promptdiffusioncontrolnet.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... |
0 | hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/promptdiffusion/pipeline_prompt_diffusion.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... |
0 | hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/scheduled_huber_loss_training/README.md | # Scheduled Pseudo-Huber Loss for Diffusers
These are the modifications of to include the possibility of training text2image models with Scheduled Pseudo Huber loss, introduced in https://arxiv.org/abs/2403.16728. (https://github.com/kabachuha/SPHL-for-stable-diffusion)
## Why this might be useful?
- If you suspect ... |
0 | hf_public_repos/diffusers/examples/research_projects/scheduled_huber_loss_training | hf_public_repos/diffusers/examples/research_projects/scheduled_huber_loss_training/text_to_image/train_text_to_image_lora.py | #!/usr/bin/env python
# coding=utf-8
# Copyright 2024 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... |
0 | hf_public_repos/diffusers/examples/research_projects/scheduled_huber_loss_training | hf_public_repos/diffusers/examples/research_projects/scheduled_huber_loss_training/text_to_image/train_text_to_image.py | #!/usr/bin/env python
# coding=utf-8
# Copyright 2024 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... |
0 | hf_public_repos/diffusers/examples/research_projects/scheduled_huber_loss_training | hf_public_repos/diffusers/examples/research_projects/scheduled_huber_loss_training/text_to_image/train_text_to_image_lora_sdxl.py | #!/usr/bin/env python
# coding=utf-8
# Copyright 2024 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... |
0 | hf_public_repos/diffusers/examples/research_projects/scheduled_huber_loss_training | hf_public_repos/diffusers/examples/research_projects/scheduled_huber_loss_training/text_to_image/train_text_to_image_sdxl.py | #!/usr/bin/env python
# coding=utf-8
# Copyright 2024 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... |
0 | hf_public_repos/diffusers/examples/research_projects/scheduled_huber_loss_training | hf_public_repos/diffusers/examples/research_projects/scheduled_huber_loss_training/dreambooth/train_dreambooth_lora.py | #!/usr/bin/env python
# coding=utf-8
# Copyright 2024 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... |
0 | hf_public_repos/diffusers/examples/research_projects/scheduled_huber_loss_training | hf_public_repos/diffusers/examples/research_projects/scheduled_huber_loss_training/dreambooth/train_dreambooth_lora_sdxl.py | #!/usr/bin/env python
# coding=utf-8
# Copyright 2024 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... |
0 | hf_public_repos/diffusers/examples/research_projects/scheduled_huber_loss_training | hf_public_repos/diffusers/examples/research_projects/scheduled_huber_loss_training/dreambooth/train_dreambooth.py | #!/usr/bin/env python
# coding=utf-8
# Copyright 2024 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... |
0 | hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/pytorch_xla/train_text_to_image_xla.py | import argparse
import os
import random
import time
from pathlib import Path
import datasets
import numpy as np
import torch
import torch.nn.functional as F
import torch.utils.checkpoint
import torch_xla.core.xla_model as xm
import torch_xla.debug.profiler as xp
import torch_xla.distributed.parallel_loader as pl
impor... |
0 | hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/pytorch_xla/requirements.txt | accelerate>=0.16.0
torchvision
transformers>=4.25.1
datasets>=2.19.1
ftfy
tensorboard
Jinja2
peft==0.7.0
|
0 | hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/pytorch_xla/README.md | # Stable Diffusion text-to-image fine-tuning using PyTorch/XLA
The `train_text_to_image_xla.py` script shows how to fine-tune stable diffusion model on TPU devices using PyTorch/XLA.
It has been tested on v4 and v5p TPU versions. Training code has been tested on multi-host.
This script implements Distributed Data P... |
0 | hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/lora/train_text_to_image_lora.py | # coding=utf-8
# Copyright 2024 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... |
0 | hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/lora/requirements.txt | accelerate>=0.16.0
torchvision
transformers>=4.25.1
datasets
ftfy
tensorboard
Jinja2
git+https://github.com/huggingface/peft.git |
0 | hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/lora/README.md | # Stable Diffusion text-to-image fine-tuning
This extended LoRA training script was authored by [haofanwang](https://github.com/haofanwang).
This is an experimental LoRA extension of [this example](https://github.com/huggingface/diffusers/blob/main/examples/text_to_image/train_text_to_image_lora.py). We further support... |
0 | hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/ip_adapter/tutorial_train_faceid.py | import argparse
import itertools
import json
import os
import random
import time
from pathlib import Path
import torch
import torch.nn.functional as F
from accelerate import Accelerator
from accelerate.utils import ProjectConfiguration
from ip_adapter.attention_processor_faceid import LoRAAttnProcessor, LoRAIPAttnProc... |
0 | hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/ip_adapter/tutorial_train_ip-adapter.py | import argparse
import itertools
import json
import os
import random
import time
from pathlib import Path
import torch
import torch.nn.functional as F
from accelerate import Accelerator
from accelerate.utils import ProjectConfiguration
from ip_adapter.ip_adapter import ImageProjModel
from ip_adapter.utils import is_to... |
0 | hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/ip_adapter/requirements.txt | accelerate
torchvision
transformers>=4.25.1
ip_adapter
|
0 | hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/ip_adapter/README.md | # IP Adapter Training Example
[IP Adapter](https://arxiv.org/abs/2308.06721) is a novel approach designed to enhance text-to-image models such as Stable Diffusion by enabling them to generate images based on image prompts rather than text prompts alone. Unlike traditional methods that rely solely on complex text prom... |
0 | hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/ip_adapter/tutorial_train_plus.py | import argparse
import itertools
import json
import os
import random
import time
from pathlib import Path
import torch
import torch.nn.functional as F
from accelerate import Accelerator
from accelerate.utils import ProjectConfiguration
from ip_adapter.resampler import Resampler
from ip_adapter.utils import is_torch2_a... |
0 | hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/ip_adapter/tutorial_train_sdxl.py | import argparse
import itertools
import json
import os
import random
import time
from pathlib import Path
import numpy as np
import torch
import torch.nn.functional as F
from accelerate import Accelerator
from accelerate.utils import ProjectConfiguration
from ip_adapter.ip_adapter import ImageProjModel
from ip_adapter... |
0 | hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/onnxruntime/README.md | ## Diffusers examples with ONNXRuntime optimizations
**This research project is not actively maintained by the diffusers team. For any questions or comments, please contact Prathik Rao (prathikr), Sunghoon Choi (hanbitmyths), Ashwini Khade (askhade), or Peng Wang (pengwa) on github with any questions.**
This aims to ... |
0 | hf_public_repos/diffusers/examples/research_projects/onnxruntime | hf_public_repos/diffusers/examples/research_projects/onnxruntime/unconditional_image_generation/requirements.txt | accelerate>=0.16.0
torchvision
datasets
tensorboard |
0 | hf_public_repos/diffusers/examples/research_projects/onnxruntime | hf_public_repos/diffusers/examples/research_projects/onnxruntime/unconditional_image_generation/README.md | ## Training examples
Creating a training image set is [described in a different document](https://huggingface.co/docs/datasets/image_process#image-datasets).
### Installing the dependencies
Before running the scripts, make sure to install the library's training dependencies:
**Important**
To make sure you can succ... |
0 | hf_public_repos/diffusers/examples/research_projects/onnxruntime | hf_public_repos/diffusers/examples/research_projects/onnxruntime/unconditional_image_generation/train_unconditional.py | import argparse
import inspect
import logging
import math
import os
from pathlib import Path
import accelerate
import datasets
import torch
import torch.nn.functional as F
from accelerate import Accelerator
from accelerate.logging import get_logger
from accelerate.utils import ProjectConfiguration
from datasets import... |
0 | hf_public_repos/diffusers/examples/research_projects/onnxruntime | hf_public_repos/diffusers/examples/research_projects/onnxruntime/text_to_image/requirements.txt | accelerate>=0.16.0
torchvision
transformers>=4.25.1
datasets
ftfy
tensorboard
modelcards
|
0 | hf_public_repos/diffusers/examples/research_projects/onnxruntime | hf_public_repos/diffusers/examples/research_projects/onnxruntime/text_to_image/train_text_to_image.py | #!/usr/bin/env python
# coding=utf-8
# Copyright 2024 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... |
0 | hf_public_repos/diffusers/examples/research_projects/onnxruntime | hf_public_repos/diffusers/examples/research_projects/onnxruntime/text_to_image/README.md | # Stable Diffusion text-to-image fine-tuning
The `train_text_to_image.py` script shows how to fine-tune stable diffusion model on your own dataset.
___Note___:
___This script is experimental. The script fine-tunes the whole model and often times the model overfits and runs into issues like catastrophic forgetting. I... |
0 | hf_public_repos/diffusers/examples/research_projects/onnxruntime | hf_public_repos/diffusers/examples/research_projects/onnxruntime/textual_inversion/requirements.txt | accelerate>=0.16.0
torchvision
transformers>=4.25.1
ftfy
tensorboard
modelcards
|
0 | hf_public_repos/diffusers/examples/research_projects/onnxruntime | hf_public_repos/diffusers/examples/research_projects/onnxruntime/textual_inversion/README.md | ## Textual Inversion fine-tuning example
[Textual inversion](https://arxiv.org/abs/2208.01618) is a method to personalize text2image models like stable diffusion on your own images using just 3-5 examples.
The `textual_inversion.py` script shows how to implement the training procedure and adapt it for stable diffusion... |
0 | hf_public_repos/diffusers/examples/research_projects/onnxruntime | hf_public_repos/diffusers/examples/research_projects/onnxruntime/textual_inversion/textual_inversion.py | #!/usr/bin/env python
# coding=utf-8
# Copyright 2024 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... |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/unconditional_image_generation/requirements.txt | accelerate>=0.16.0
torchvision
datasets
|
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/unconditional_image_generation/README.md | ## Training an unconditional diffusion model
Creating a training image set is [described in a different document](https://huggingface.co/docs/datasets/image_process#image-datasets).
### Installing the dependencies
Before running the scripts, make sure to install the library's training dependencies:
**Important**
T... |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/unconditional_image_generation/train_unconditional.py | import argparse
import inspect
import logging
import math
import os
import shutil
from datetime import timedelta
from pathlib import Path
import accelerate
import datasets
import torch
import torch.nn.functional as F
from accelerate import Accelerator, InitProcessGroupKwargs
from accelerate.logging import get_logger
f... |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/unconditional_image_generation/test_unconditional.py | # coding=utf-8
# Copyright 2024 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... |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/text_to_image/README_sdxl.md | # Stable Diffusion XL text-to-image fine-tuning
The `train_text_to_image_sdxl.py` script shows how to fine-tune Stable Diffusion XL (SDXL) on your own dataset.
🚨 This script is experimental. The script fine-tunes the whole model and often times the model overfits and runs into issues like catastrophic forgetting. It... |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/text_to_image/test_text_to_image.py | #!/usr/bin/env python
# coding=utf-8
# Copyright 2024 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... |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/text_to_image/requirements_flax.txt | transformers>=4.25.1
datasets
flax
optax
torch
torchvision
ftfy
tensorboard
Jinja2
|
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/text_to_image/requirements_sdxl.txt | accelerate>=0.22.0
torchvision
transformers>=4.25.1
ftfy
tensorboard
Jinja2
datasets
peft==0.7.0 |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/text_to_image/train_text_to_image_lora.py | #!/usr/bin/env python
# coding=utf-8
# Copyright 2024 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... |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/text_to_image/requirements.txt | accelerate>=0.16.0
torchvision
transformers>=4.25.1
datasets>=2.19.1
ftfy
tensorboard
Jinja2
peft==0.7.0
|
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/text_to_image/train_text_to_image.py | #!/usr/bin/env python
# coding=utf-8
# Copyright 2024 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... |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/text_to_image/train_text_to_image_lora_sdxl.py | #!/usr/bin/env python
# coding=utf-8
# Copyright 2024 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... |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/text_to_image/README.md | # Stable Diffusion text-to-image fine-tuning
The `train_text_to_image.py` script shows how to fine-tune stable diffusion model on your own dataset.
___Note___:
___This script is experimental. The script fine-tunes the whole model and often times the model overfits and runs into issues like catastrophic forgetting. I... |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/text_to_image/test_text_to_image_lora.py | #!/usr/bin/env python
# coding=utf-8
# Copyright 2024 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... |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/text_to_image/train_text_to_image_flax.py | #!/usr/bin/env python
# coding=utf-8
# Copyright 2024 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... |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/text_to_image/train_text_to_image_sdxl.py | #!/usr/bin/env python
# coding=utf-8
# Copyright 2024 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... |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/custom_diffusion/train_custom_diffusion.py | #!/usr/bin/env python
# coding=utf-8
# Copyright 2024 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... |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/custom_diffusion/retrieve.py | # Copyright 2024 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... |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/custom_diffusion/requirements.txt | accelerate
torchvision
transformers>=4.25.1
ftfy
tensorboard
Jinja2
|
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/custom_diffusion/test_custom_diffusion.py | # coding=utf-8
# Copyright 2024 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... |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/custom_diffusion/README.md | # Custom Diffusion training example
[Custom Diffusion](https://arxiv.org/abs/2212.04488) is a method to customize text-to-image models like Stable Diffusion given just a few (4~5) images of a subject.
The `train_custom_diffusion.py` script shows how to implement the training procedure and adapt it for stable diffusion... |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/advanced_diffusion_training/README_flux.md | # Advanced diffusion training examples
## Train Dreambooth LoRA with Flux.1 Dev
> [!TIP]
> 💡 This example follows some of the techniques and recommended practices covered in the community derived guide we made for SDXL training: [LoRA training scripts of the world, unite!](https://huggingface.co/blog/sdxl_lora_advanc... |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/advanced_diffusion_training/requirements_flux.txt | accelerate>=0.31.0
torchvision
transformers>=4.41.2
ftfy
tensorboard
Jinja2
peft>=0.11.1
sentencepiece |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/advanced_diffusion_training/requirements.txt | accelerate>=0.16.0
torchvision
transformers>=4.25.1
ftfy
tensorboard
Jinja2
peft==0.7.0 |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/advanced_diffusion_training/test_dreambooth_lora_flux_advanced.py | # coding=utf-8
# Copyright 2024 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... |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/advanced_diffusion_training/train_dreambooth_lora_flux_advanced.py | #!/usr/bin/env python
# coding=utf-8
# Copyright 2024 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... |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/advanced_diffusion_training/README.md | # Advanced diffusion training examples
## Train Dreambooth LoRA with Stable Diffusion XL
> [!TIP]
> 💡 This example follows the techniques and recommended practices covered in the blog post: [LoRA training scripts of the world, unite!](https://huggingface.co/blog/sdxl_lora_advanced_script). Make sure to check it out b... |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/advanced_diffusion_training/train_dreambooth_lora_sdxl_advanced.py | #!/usr/bin/env python
# coding=utf-8
# Copyright 2024 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... |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/advanced_diffusion_training/train_dreambooth_lora_sd15_advanced.py | #!/usr/bin/env python
# coding=utf-8
# Copyright 2024 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... |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/reinforcement_learning/run_diffuser_locomotion.py | import d4rl # noqa
import gym
import tqdm
from diffusers.experimental import ValueGuidedRLPipeline
config = {
"n_samples": 64,
"horizon": 32,
"num_inference_steps": 20,
"n_guide_steps": 2, # can set to 0 for faster sampling, does not use value network
"scale_grad_by_std": True,
"scale": 0.1,... |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/reinforcement_learning/diffusion_policy.py | import numpy as np
import numpy.core.multiarray as multiarray
import torch
import torch.nn as nn
from huggingface_hub import hf_hub_download
from torch.serialization import add_safe_globals
from diffusers import DDPMScheduler, UNet1DModel
add_safe_globals(
[
multiarray._reconstruct,
np.ndarray,
... |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/reinforcement_learning/README.md |
## Diffusion-based Policy Learning for RL
`diffusion_policy` implements [Diffusion Policy](https://diffusion-policy.cs.columbia.edu/), a diffusion model that predicts robot action sequences in reinforcement learning tasks.
This example implements a robot control model for pushing a T-shaped block into a target area.... |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/amused/README.md | ## Amused training
Amused can be finetuned on simple datasets relatively cheaply and quickly. Using 8bit optimizers, lora, and gradient accumulation, amused can be finetuned with as little as 5.5 GB. Here are a set of examples for finetuning amused on some relatively simple datasets. These training recipies are aggres... |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/amused/train_amused.py | # coding=utf-8
# Copyright 2024 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... |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/dreambooth/README_flux.md | # DreamBooth training example for FLUX.1 [dev]
[DreamBooth](https://arxiv.org/abs/2208.12242) is a method to personalize text2image models like stable diffusion given just a few (3~5) images of a subject.
The `train_dreambooth_flux.py` script shows how to implement the training procedure and adapt it for [FLUX.1 [dev... |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/dreambooth/README_sd3.md | # DreamBooth training example for Stable Diffusion 3 (SD3)
[DreamBooth](https://arxiv.org/abs/2208.12242) is a method to personalize text2image models like stable diffusion given just a few (3~5) images of a subject.
The `train_dreambooth_sd3.py` script shows how to implement the training procedure and adapt it for [... |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/dreambooth/requirements_flux.txt | accelerate>=0.31.0
torchvision
transformers>=4.41.2
ftfy
tensorboard
Jinja2
peft>=0.11.1
sentencepiece |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/dreambooth/README_sdxl.md | # DreamBooth training example for Stable Diffusion XL (SDXL)
[DreamBooth](https://arxiv.org/abs/2208.12242) is a method to personalize text2image models like stable diffusion given just a few (3~5) images of a subject.
The `train_dreambooth_lora_sdxl.py` script shows how to implement the training procedure and adapt ... |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/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... |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/dreambooth/train_dreambooth_lora_flux.py | #!/usr/bin/env python
# coding=utf-8
# Copyright 2024 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... |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/dreambooth/requirements_flax.txt | transformers>=4.25.1
flax
optax
torch
torchvision
ftfy
tensorboard
Jinja2
|
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/dreambooth/requirements_sd3.txt | accelerate>=0.31.0
torchvision
transformers>=4.41.2
ftfy
tensorboard
Jinja2
peft==0.11.1
sentencepiece |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/dreambooth/requirements_sdxl.txt | accelerate>=0.16.0
torchvision
transformers>=4.25.1
ftfy
tensorboard
Jinja2
peft==0.7.0 |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/dreambooth/train_dreambooth_lora_sd3.py | #!/usr/bin/env python
# coding=utf-8
# Copyright 2024 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... |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/dreambooth/requirements.txt | accelerate>=0.16.0
torchvision
transformers>=4.25.1
ftfy
tensorboard
Jinja2
peft==0.7.0 |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/dreambooth/train_dreambooth_flux.py | #!/usr/bin/env python
# coding=utf-8
# Copyright 2024 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... |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/dreambooth/test_dreambooth_lora_edm.py | # coding=utf-8
# Copyright 2024 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... |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/dreambooth/test_dreambooth_lora_flux.py | # coding=utf-8
# Copyright 2024 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... |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/dreambooth/train_dreambooth_lora.py | #!/usr/bin/env python
# coding=utf-8
# Copyright 2024 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... |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/dreambooth/test_dreambooth.py | # coding=utf-8
# Copyright 2024 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... |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/dreambooth/README.md | # DreamBooth training example
[DreamBooth](https://arxiv.org/abs/2208.12242) is a method to personalize text2image models like stable diffusion given just a few(3~5) images of a subject.
The `train_dreambooth.py` script shows how to implement the training procedure and adapt it for stable diffusion.
## Running local... |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/dreambooth/test_dreambooth_sd3.py | # coding=utf-8
# Copyright 2024 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... |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/dreambooth/test_dreambooth_flux.py | # coding=utf-8
# Copyright 2024 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... |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/dreambooth/train_dreambooth_sd3.py | #!/usr/bin/env python
# coding=utf-8
# Copyright 2024 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... |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/dreambooth/train_dreambooth_lora_sdxl.py | #!/usr/bin/env python
# coding=utf-8
# Copyright 2024 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... |
0 | hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/dreambooth/test_dreambooth_lora_sd3.py | # coding=utf-8
# Copyright 2024 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.