Commit
·
c2c4f84
1
Parent(s):
3936786
fix(space): pin diffusers/transformers/hf-hub versions and avoid FromOriginalControlnetMixin import
Browse files- ref_encoder/latent_controlnet.py +4 -0
- requirements.txt +5 -8
ref_encoder/latent_controlnet.py
CHANGED
|
@@ -37,6 +37,10 @@ from diffusers.models.unet_2d_blocks import (
|
|
| 37 |
get_down_block,
|
| 38 |
)
|
| 39 |
from diffusers.models.unet_2d_condition import UNet2DConditionModel
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
|
| 41 |
|
| 42 |
logger = logging.get_logger(__name__) # pylint: disable=invalid-name
|
|
|
|
| 37 |
get_down_block,
|
| 38 |
)
|
| 39 |
from diffusers.models.unet_2d_condition import UNet2DConditionModel
|
| 40 |
+
from diffusers.models import ControlNetModel # fallback import if loaders mixin unavailable
|
| 41 |
+
|
| 42 |
+
# If the project expects a custom ControlNetModel, keep existing implementation below.
|
| 43 |
+
# This line ensures import doesn't fail on Spaces with different diffusers versions.
|
| 44 |
|
| 45 |
|
| 46 |
logger = logging.get_logger(__name__) # pylint: disable=invalid-name
|
requirements.txt
CHANGED
|
@@ -1,18 +1,15 @@
|
|
| 1 |
torch>=2.0.0
|
| 2 |
torchvision
|
| 3 |
torchaudio
|
| 4 |
-
diffusers
|
| 5 |
-
transformers
|
| 6 |
-
|
| 7 |
-
omegaconf
|
| 8 |
opencv-python
|
| 9 |
pillow
|
| 10 |
-
gradio>=4.0.0
|
| 11 |
numpy
|
| 12 |
scipy
|
| 13 |
-
huggingface-hub
|
| 14 |
-
|
| 15 |
-
controlnet-aux
|
| 16 |
safetensors
|
| 17 |
einops
|
| 18 |
kornia
|
|
|
|
| 1 |
torch>=2.0.0
|
| 2 |
torchvision
|
| 3 |
torchaudio
|
| 4 |
+
diffusers==0.23.0
|
| 5 |
+
transformers==4.30.2
|
| 6 |
+
omegaconf==2.3.0
|
|
|
|
| 7 |
opencv-python
|
| 8 |
pillow
|
|
|
|
| 9 |
numpy
|
| 10 |
scipy
|
| 11 |
+
huggingface-hub==0.17.3
|
| 12 |
+
controlnet-aux==0.0.10
|
|
|
|
| 13 |
safetensors
|
| 14 |
einops
|
| 15 |
kornia
|