Fix broken import in checkpoint_convert (#5635)

* Fix broken import in checkpoint_convert

* simplify the fix

---------

Co-authored-by: Lincoln Stein <lstein@gmail.com>
This commit is contained in:
Lincoln Stein 2024-02-04 07:56:51 -05:00 committed by GitHub
parent 3205371654
commit 8e500283b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -42,8 +42,7 @@ from diffusers.schedulers import (
PNDMScheduler,
UnCLIPScheduler,
)
from diffusers.utils import is_accelerate_available, is_omegaconf_available
from diffusers.utils.import_utils import BACKENDS_MAPPING
from diffusers.utils import is_accelerate_available
from picklescan.scanner import scan_file_path
from transformers import (
AutoFeatureExtractor,
@ -1211,9 +1210,6 @@ def download_from_original_stable_diffusion_ckpt(
if prediction_type == "v-prediction":
prediction_type = "v_prediction"
if not is_omegaconf_available():
raise ValueError(BACKENDS_MAPPING["omegaconf"][1])
if from_safetensors:
from safetensors.torch import load_file as safe_load
@ -1647,11 +1643,6 @@ def download_controlnet_from_original_ckpt(
cross_attention_dim: Optional[bool] = None,
scan_needed: bool = False,
) -> DiffusionPipeline:
if not is_omegaconf_available():
raise ValueError(BACKENDS_MAPPING["omegaconf"][1])
from omegaconf import OmegaConf
if from_safetensors:
from safetensors import safe_open