Skip to content

Commit

Permalink
Refactoring the SD 2.x and SDXL trainers to be more in-line: fix logg…
Browse files Browse the repository at this point in the history
…ing for SDXL
  • Loading branch information
bghira committed Sep 14, 2023
1 parent 06a2348 commit f41cae6
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions train_sdxl.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,30 +60,14 @@
# Less important logs.
filelock_logger.setLevel("WARNING")
connection_logger.setLevel("WARNING")

logger.info("Import accelerate")
import accelerate

logger.info("Import datasets")
import datasets

logger.info("Import numpy")
import numpy as np
import PIL

logger.info("Import pytorch")
import torch

logger.info("Import torch.nn")
import torch.nn as nn

logger.info("Import torch.nn.functional")
import torch.nn.functional as F

logger.info("Import torch.utils.checkpoint")
import torch.utils.checkpoint

logger.info("Import transformers")
import transformers
from accelerate import Accelerator
from accelerate.logging import get_logger
Expand All @@ -94,11 +78,7 @@
from torchvision import transforms
from tqdm.auto import tqdm
from transformers import AutoTokenizer, PretrainedConfig

logger.info("Import diffusers")
import diffusers

logger.info("Import pooplines.")
from diffusers import AutoencoderKL, DDPMScheduler, UNet2DConditionModel, DDIMScheduler
from diffusers.optimization import get_scheduler
from diffusers.pipelines.stable_diffusion_xl.pipeline_stable_diffusion_xl import (
Expand All @@ -112,7 +92,6 @@
# Convert PIL Image to PyTorch Tensor
to_tensor = ToTensor()


# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.20.0.dev0")

Expand Down

0 comments on commit f41cae6

Please sign in to comment.