repo_id stringlengths 15 89 | file_path stringlengths 27 180 | content stringlengths 1 2.23M | __index_level_0__ int64 0 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/test_unconditional.py | # coding=utf-8
# Copyright 2023 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/instruct_pix2pix/requirements.txt | accelerate>=0.16.0
torchvision
transformers>=4.25.1
datasets
ftfy
tensorboard | 0 |
hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/instruct_pix2pix/test_instruct_pix2pix.py | # coding=utf-8
# Copyright 2023 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/instruct_pix2pix/README_sdxl.md | # InstructPix2Pix SDXL training example
***This is based on the original InstructPix2Pix training example.***
[Stable Diffusion XL](https://huggingface.co/papers/2307.01952) (or SDXL) is the latest image generation model that is tailored towards more photorealistic outputs with more detailed imagery and composition c... | 0 |
hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/instruct_pix2pix/train_instruct_pix2pix.py | #!/usr/bin/env python
# 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/LI... | 0 |
hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/instruct_pix2pix/README.md | # InstructPix2Pix training example
[InstructPix2Pix](https://arxiv.org/abs/2211.09800) is a method to fine-tune text-conditioned diffusion models such that they can follow an edit instruction for an input image. Models fine-tuned using this method take the following as inputs:
<p align="center">
<img src="https:/... | 0 |
hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/instruct_pix2pix/train_instruct_pix2pix_sdxl.py | #!/usr/bin/env python
# coding=utf-8
# Copyright 2023 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.... | 0 |
hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/controlnet/train_controlnet_flax.py | #!/usr/bin/env python
# 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/LI... | 0 |
hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/controlnet/train_controlnet_sdxl.py | #!/usr/bin/env python
# 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/LI... | 0 |
hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/controlnet/requirements.txt | accelerate>=0.16.0
torchvision
transformers>=4.25.1
ftfy
tensorboard
datasets
| 0 |
hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/controlnet/README_sdxl.md | # ControlNet training example for Stable Diffusion XL (SDXL)
The `train_controlnet_sdxl.py` script shows how to implement the ControlNet training procedure and adapt it for [Stable Diffusion XL](https://huggingface.co/papers/2307.01952).
## Running locally with PyTorch
### Installing the dependencies
Before running... | 0 |
hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/controlnet/README.md | # ControlNet training example
[Adding Conditional Control to Text-to-Image Diffusion Models](https://arxiv.org/abs/2302.05543) by Lvmin Zhang and Maneesh Agrawala.
This example is based on the [training example in the original ControlNet repository](https://github.com/lllyasviel/ControlNet/blob/main/docs/train.md). I... | 0 |
hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/controlnet/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/controlnet/train_controlnet.py | #!/usr/bin/env python
# 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/LI... | 0 |
hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/controlnet/requirements_sdxl.txt | accelerate>=0.16.0
torchvision
transformers>=4.25.1
ftfy
tensorboard
Jinja2
datasets
wandb
| 0 |
hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/controlnet/test_controlnet.py | # coding=utf-8
# Copyright 2023 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/kandinsky2_2 | hf_public_repos/diffusers/examples/kandinsky2_2/text_to_image/requirements.txt | accelerate>=0.16.0
torchvision
transformers>=4.25.1
datasets
ftfy
tensorboard
Jinja2
| 0 |
hf_public_repos/diffusers/examples/kandinsky2_2 | hf_public_repos/diffusers/examples/kandinsky2_2/text_to_image/train_text_to_image_prior.py | #!/usr/bin/env python
# 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/LI... | 0 |
hf_public_repos/diffusers/examples/kandinsky2_2 | hf_public_repos/diffusers/examples/kandinsky2_2/text_to_image/train_text_to_image_decoder.py | #!/usr/bin/env python
# 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/LI... | 0 |
hf_public_repos/diffusers/examples/kandinsky2_2 | hf_public_repos/diffusers/examples/kandinsky2_2/text_to_image/README.md | # Kandinsky2.2 text-to-image fine-tuning
Kandinsky 2.2 includes a prior pipeline that generates image embeddings from text prompts, and a decoder pipeline that generates the output image based on the image embeddings. We provide `train_text_to_image_prior.py` and `train_text_to_image_decoder.py` scripts to show you ho... | 0 |
hf_public_repos/diffusers/examples/kandinsky2_2 | hf_public_repos/diffusers/examples/kandinsky2_2/text_to_image/train_text_to_image_lora_prior.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/kandinsky2_2 | hf_public_repos/diffusers/examples/kandinsky2_2/text_to_image/train_text_to_image_lora_decoder.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 | hf_public_repos/diffusers/examples/t2i_adapter/requirements.txt | transformers>=4.25.1
accelerate>=0.16.0
safetensors
datasets
torchvision
ftfy
tensorboard
wandb | 0 |
hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/t2i_adapter/test_t2i_adapter.py | # coding=utf-8
# Copyright 2023 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/t2i_adapter/train_t2i_adapter_sdxl.py | #!/usr/bin/env python
# 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/LI... | 0 |
hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/t2i_adapter/README_sdxl.md | # T2I-Adapter training example for Stable Diffusion XL (SDXL)
The `train_t2i_adapter_sdxl.py` script shows how to implement the [T2I-Adapter training procedure](https://hf.co/papers/2302.08453) for [Stable Diffusion XL](https://huggingface.co/papers/2307.01952).
## Running locally with PyTorch
### Installing the dep... | 0 |
hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/t2i_adapter/README.md | We don't yet support training T2I-Adapters on Stable Diffusion yet. For training T2I-Adapters on Stable Diffusion XL, refer [here](./README_sdxl.md). | 0 |
hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/research_projects/README.md | # Research projects
This folder contains various research projects using 🧨 Diffusers.
They are not really maintained by the core maintainers of this library and often require a specific version of Diffusers that is indicated in the requirements file of each folder.
Updating them to the most recent version of the li... | 0 |
hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/controlnet/train_controlnet_webdataset.py | #!/usr/bin/env python
# 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/LI... | 0 |
hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/dreambooth_inpaint/train_dreambooth_inpaint_lora.py | import argparse
import math
import os
import random
from pathlib import Path
import numpy as np
import torch
import torch.nn.functional as F
import torch.utils.checkpoint
from accelerate import Accelerator
from accelerate.logging import get_logger
from accelerate.utils import ProjectConfiguration, set_seed
from huggin... | 0 |
hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/dreambooth_inpaint/requirements.txt | diffusers==0.9.0
accelerate>=0.16.0
torchvision
transformers>=4.21.0
ftfy
tensorboard
Jinja2
| 0 |
hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/dreambooth_inpaint/README.md | # Dreambooth for the inpainting model
This script was added by @thedarkzeno .
Please note that this script is not actively maintained, you can open an issue and tag @thedarkzeno or @patil-suraj though.
```bash
export MODEL_NAME="runwayml/stable-diffusion-inpainting"
export INSTANCE_DIR="path-to-instance-images"
expo... | 0 |
hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/dreambooth_inpaint/train_dreambooth_inpaint.py | import argparse
import itertools
import math
import os
import random
from pathlib import Path
import numpy as np
import torch
import torch.nn.functional as F
import torch.utils.checkpoint
from accelerate import Accelerator
from accelerate.logging import get_logger
from accelerate.utils import ProjectConfiguration, set... | 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/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/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/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/textual_inversion.py | #!/usr/bin/env python
# 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/LI... | 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/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/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/text_to_image/train_text_to_image.py | #!/usr/bin/env python
# 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/LI... | 0 |
hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/realfill/requirements.txt | diffusers==0.20.1
accelerate==0.23.0
transformers==4.34.0
peft==0.5.0
torch==2.0.1
torchvision>=0.16
ftfy==6.1.1
tensorboard==2.14.0
Jinja2==3.1.2
| 0 |
hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/realfill/README.md | # RealFill
[RealFill](https://arxiv.org/abs/2309.16668) is a method to personalize text2image inpainting models like stable diffusion inpainting given just a few(1~5) images of a scene.
The `train_realfill.py` script shows how to implement the training procedure for stable diffusion inpainting.
## Running locally wi... | 0 |
hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/realfill/train_realfill.py | import argparse
import copy
import itertools
import logging
import math
import os
import random
import shutil
from pathlib import Path
import numpy as np
import torch
import torch.nn.functional as F
import torch.utils.checkpoint
import torchvision.transforms.v2 as transforms_v2
import transformers
from accelerate impo... | 0 |
hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/realfill/infer.py | import argparse
import os
import torch
from PIL import Image, ImageFilter
from transformers import CLIPTextModel
from diffusers import DPMSolverMultistepScheduler, StableDiffusionInpaintPipeline, UNet2DConditionModel
parser = argparse.ArgumentParser(description="Inference")
parser.add_argument(
"--model_path",
... | 0 |
hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/rdm/retriever.py | import os
from typing import List
import faiss
import numpy as np
import torch
from datasets import Dataset, load_dataset
from PIL import Image
from transformers import CLIPFeatureExtractor, CLIPModel, PretrainedConfig
from diffusers import logging
logger = logging.get_logger(__name__) # pylint: disable=invalid-na... | 0 |
hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/rdm/pipeline_rdm.py | import inspect
from typing import Callable, List, Optional, Union
import torch
from PIL import Image
from retriever import Retriever, normalize_images, preprocess_images
from transformers import CLIPFeatureExtractor, CLIPModel, CLIPTokenizer
from diffusers import (
AutoencoderKL,
DDIMScheduler,
DiffusionP... | 0 |
hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/rdm/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 Isamu Isozaki(isamu-isozaki) on github with any questions.**
The aim of this project is to provide retrieval augmented diffusion models to diffus... | 0 |
hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/mulit_token_textual_inversion/requirements.txt | accelerate>=0.16.0
torchvision
transformers>=4.25.1
ftfy
tensorboard
Jinja2
| 0 |
hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/mulit_token_textual_inversion/textual_inversion.py | #!/usr/bin/env python
# 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/LI... | 0 |
hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/mulit_token_textual_inversion/multi_token_clip.py | """
The main idea for this code is to provide a way for users to not need to bother with the hassle of multiple tokens for a concept by typing
a photo of <concept>_0 <concept>_1 ... and so on
and instead just do
a photo of <concept>
which gets translated to the above. This needs to work for both inference and training.... | 0 |
hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/mulit_token_textual_inversion/README.md | ## [Deprecated] Multi Token Textual Inversion
**IMPORTART: This research project is deprecated. Multi Token Textual Inversion is now supported natively in [the officail textual inversion example](https://github.com/huggingface/diffusers/tree/main/examples/textual_inversion#running-locally-with-pytorch).**
The author ... | 0 |
hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/mulit_token_textual_inversion/requirements_flax.txt | transformers>=4.25.1
flax
optax
torch
torchvision
ftfy
tensorboard
Jinja2
| 0 |
hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/mulit_token_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... | 0 |
hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/multi_subject_dreambooth/requirements.txt | accelerate>=0.16.0
torchvision
transformers>=4.25.1
ftfy
tensorboard
Jinja2 | 0 |
hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/multi_subject_dreambooth/train_multi_subject_dreambooth.py | import argparse
import itertools
import json
import logging
import math
import uuid
import warnings
from os import environ, listdir, makedirs
from os.path import basename, join
from pathlib import Path
from typing import List
import datasets
import numpy as np
import torch
import torch.nn.functional as F
import torch.... | 0 |
hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/multi_subject_dreambooth/README.md | # Multi Subject DreamBooth training
[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.
This `train_multi_subject_dreambooth.py` script shows how to implement the training procedure for one or more subjects and ada... | 0 |
hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/colossalai/README.md | # [DreamBooth](https://github.com/huggingface/diffusers/tree/main/examples/dreambooth) by [colossalai](https://github.com/hpcaitech/ColossalAI.git)
[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_dre... | 0 |
hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/colossalai/requirement.txt | diffusers
torch
torchvision
ftfy
tensorboard
Jinja2
transformers | 0 |
hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/colossalai/inference.py | import torch
from diffusers import StableDiffusionPipeline
model_id = "path-to-your-trained-model"
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16).to("cuda")
prompt = "A photo of sks dog in a bucket"
image = pipe(prompt, num_inference_steps=50, guidance_scale=7.5).images[0]
imag... | 0 |
hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/colossalai/train_dreambooth_colossalai.py | import argparse
import math
import os
from pathlib import Path
import colossalai
import torch
import torch.nn.functional as F
import torch.utils.checkpoint
from colossalai.context.parallel_mode import ParallelMode
from colossalai.core import global_context as gpc
from colossalai.logging import disable_existing_loggers... | 0 |
hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/intel_opts/README.md | ## Diffusers examples with Intel optimizations
**This research project is not actively maintained by the diffusers team. For any questions or comments, please make sure to tag @hshen14 .**
This aims to provide diffusers examples with Intel optimizations such as Bfloat16 for training/fine-tuning acceleration and 8-bit... | 0 |
hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/intel_opts/inference_bf16.py | import argparse
import intel_extension_for_pytorch as ipex
import torch
from diffusers import DPMSolverMultistepScheduler, StableDiffusionPipeline
parser = argparse.ArgumentParser("Stable Diffusion script with intel optimization", add_help=False)
parser.add_argument("--dpm", action="store_true", help="Enable DPMSol... | 0 |
hf_public_repos/diffusers/examples/research_projects/intel_opts | hf_public_repos/diffusers/examples/research_projects/intel_opts/textual_inversion_dfq/requirements.txt | accelerate
torchvision
transformers>=4.25.0
ftfy
tensorboard
modelcards
neural-compressor | 0 |
hf_public_repos/diffusers/examples/research_projects/intel_opts | hf_public_repos/diffusers/examples/research_projects/intel_opts/textual_inversion_dfq/textual_inversion.py | import argparse
import itertools
import math
import os
import random
from pathlib import Path
from typing import Iterable
import numpy as np
import PIL
import torch
import torch.nn.functional as F
import torch.utils.checkpoint
from accelerate import Accelerator
from accelerate.utils import ProjectConfiguration, set_se... | 0 |
hf_public_repos/diffusers/examples/research_projects/intel_opts | hf_public_repos/diffusers/examples/research_projects/intel_opts/textual_inversion_dfq/README.md | # Distillation for quantization on Textual Inversion models to personalize text2image
[Textual inversion](https://arxiv.org/abs/2208.01618) is a method to personalize text2image models like stable diffusion on your own images._By using just 3-5 images new concepts can be taught to Stable Diffusion and the model person... | 0 |
hf_public_repos/diffusers/examples/research_projects/intel_opts | hf_public_repos/diffusers/examples/research_projects/intel_opts/textual_inversion_dfq/text2images.py | import argparse
import math
import os
import torch
from neural_compressor.utils.pytorch import load
from PIL import Image
from transformers import CLIPTextModel, CLIPTokenizer
from diffusers import AutoencoderKL, StableDiffusionPipeline, UNet2DConditionModel
def parse_args():
parser = argparse.ArgumentParser()
... | 0 |
hf_public_repos/diffusers/examples/research_projects/intel_opts | hf_public_repos/diffusers/examples/research_projects/intel_opts/textual_inversion/requirements.txt | accelerate>=0.16.0
torchvision
transformers>=4.21.0
ftfy
tensorboard
Jinja2
intel_extension_for_pytorch>=1.13
| 0 |
hf_public_repos/diffusers/examples/research_projects/intel_opts | hf_public_repos/diffusers/examples/research_projects/intel_opts/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/intel_opts | hf_public_repos/diffusers/examples/research_projects/intel_opts/textual_inversion/textual_inversion_bf16.py | import argparse
import itertools
import math
import os
import random
from pathlib import Path
import intel_extension_for_pytorch as ipex
import numpy as np
import PIL
import torch
import torch.nn.functional as F
import torch.utils.checkpoint
from accelerate import Accelerator
from accelerate.logging import get_logger
... | 0 |
hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/sdxl_flax/sdxl_single_aot.py | import time
import jax
import jax.numpy as jnp
import numpy as np
from flax.jax_utils import replicate
from jax import pmap
# Let's cache the model compilation, so that it doesn't take as long the next time around.
from jax.experimental.compilation_cache import compilation_cache as cc
from diffusers import FlaxStabl... | 0 |
hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/sdxl_flax/README.md | # Stable Diffusion XL for JAX + TPUv5e
[TPU v5e](https://cloud.google.com/blog/products/compute/how-cloud-tpu-v5e-accelerates-large-scale-ai-inference) is a new generation of TPUs from Google Cloud. It is the most cost-effective, versatile, and scalable Cloud TPU to date. This makes them ideal for serving and scaling ... | 0 |
hf_public_repos/diffusers/examples/research_projects | hf_public_repos/diffusers/examples/research_projects/sdxl_flax/sdxl_single.py | # Show best practices for SDXL JAX
import time
import jax
import jax.numpy as jnp
import numpy as np
from flax.jax_utils import replicate
# Let's cache the model compilation, so that it doesn't take as long the next time around.
from jax.experimental.compilation_cache import compilation_cache as cc
from diffusers im... | 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/lora/train_text_to_image_lora.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/wuerstchen | hf_public_repos/diffusers/examples/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/wuerstchen | hf_public_repos/diffusers/examples/wuerstchen/text_to_image/requirements.txt | accelerate>=0.16.0
torchvision
transformers>=4.25.1
wandb
huggingface-cli
bitsandbytes
deepspeed
peft>=0.6.0
| 0 |
hf_public_repos/diffusers/examples/wuerstchen | hf_public_repos/diffusers/examples/wuerstchen/text_to_image/train_text_to_image_prior.py | # 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 required by appl... | 0 |
hf_public_repos/diffusers/examples/wuerstchen | hf_public_repos/diffusers/examples/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/wuerstchen | hf_public_repos/diffusers/examples/wuerstchen/text_to_image/train_text_to_image_lora_prior.py | # 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 required by appl... | 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 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/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/README.md | # Overview
These examples show how to run [Diffuser](https://arxiv.org/abs/2205.09991) in Diffusers.
There are two ways to use the script, `run_diffuser_locomotion.py`.
The key option is a change of the variable `n_guide_steps`.
When `n_guide_steps=0`, the trajectories are sampled from the diffusion model, but not ... | 0 |
hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/consistency_distillation/train_lcm_distill_sd_wds.py | #!/usr/bin/env python
# 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/LI... | 0 |
hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/consistency_distillation/requirements.txt | accelerate>=0.16.0
torchvision
transformers>=4.25.1
ftfy
tensorboard
Jinja2
webdataset | 0 |
hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/consistency_distillation/README_sdxl.md | # Latent Consistency Distillation Example:
[Latent Consistency Models (LCMs)](https://arxiv.org/abs/2310.04378) is a method to distill a latent diffusion model to enable swift inference with minimal steps. This example demonstrates how to use latent consistency distillation to distill SDXL for inference with few times... | 0 |
hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/consistency_distillation/train_lcm_distill_lora_sd_wds.py | #!/usr/bin/env python
# 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/LI... | 0 |
hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/consistency_distillation/README.md | # Latent Consistency Distillation Example:
[Latent Consistency Models (LCMs)](https://arxiv.org/abs/2310.04378) is a method to distill a latent diffusion model to enable swift inference with minimal steps. This example demonstrates how to use latent consistency distillation to distill stable-diffusion-v1.5 for inferen... | 0 |
hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/consistency_distillation/train_lcm_distill_lora_sdxl_wds.py | #!/usr/bin/env python
# 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/LI... | 0 |
hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/consistency_distillation/train_lcm_distill_sdxl_wds.py | #!/usr/bin/env python
# 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/LI... | 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/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 diffusio... | 0 |
hf_public_repos/diffusers/examples | hf_public_repos/diffusers/examples/custom_diffusion/test_custom_diffusion.py | # coding=utf-8
# Copyright 2023 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/retrieve.py | # Copyright 2023 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/train_custom_diffusion.py | #!/usr/bin/env python
# coding=utf-8
# Copyright 2023 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/textual_inversion/requirements.txt | accelerate>=0.16.0
torchvision
transformers>=4.25.1
ftfy
tensorboard
Jinja2
| 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.