Update ddpm_edit.py

This commit is contained in:
Dalton 2024-03-19 14:44:31 -04:00 committed by GitHub
parent 51cb20ec39
commit 61f321756f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -9,6 +9,7 @@ https://github.com/CompVis/taming-transformers
# File modified by authors of InstructPix2Pix from original (https://github.com/CompVis/stable-diffusion). # File modified by authors of InstructPix2Pix from original (https://github.com/CompVis/stable-diffusion).
# See more details in LICENSE. # See more details in LICENSE.
import sys
import torch import torch
import torch.nn as nn import torch.nn as nn
import numpy as np import numpy as np
@ -19,6 +20,8 @@ from contextlib import contextmanager
from functools import partial from functools import partial
from tqdm import tqdm from tqdm import tqdm
from torchvision.utils import make_grid from torchvision.utils import make_grid
import pytorch_lightning.utilities.rank_zero
sys.modules['pytorch_lightning.utilities.distributed'] = sys.modules['pytorch_lightning.utilities.rank_zero']
from pytorch_lightning.utilities.rank_zero import rank_zero_only from pytorch_lightning.utilities.rank_zero import rank_zero_only
from ldm.util import log_txt_as_img, exists, default, ismap, isimage, mean_flat, count_params, instantiate_from_config from ldm.util import log_txt_as_img, exists, default, ismap, isimage, mean_flat, count_params, instantiate_from_config