Spaces:
Runtime error
Runtime error
Update gradio_demo.py
Browse files- gradio_demo.py +6 -6
gradio_demo.py
CHANGED
@@ -107,15 +107,15 @@ def enable_efficient_attention():
|
|
107 |
print(f"Xformers error: {e}")
|
108 |
print("Falling back to sliced attention")
|
109 |
# Use sliced attention for RTX 2070
|
110 |
-
unet.set_attention_slice_size(4)
|
111 |
-
vae.set_attention_slice_size(4)
|
112 |
unet.set_attn_processor(AttnProcessor2_0())
|
113 |
vae.set_attn_processor(AttnProcessor2_0())
|
114 |
else:
|
115 |
# Fallback for when xformers is not available
|
116 |
print("Using sliced attention")
|
117 |
-
unet.set_attention_slice_size(4)
|
118 |
-
vae.set_attention_slice_size(4)
|
119 |
unet.set_attn_processor(AttnProcessor2_0())
|
120 |
vae.set_attn_processor(AttnProcessor2_0())
|
121 |
|
@@ -652,13 +652,13 @@ quick_subjects = [[x] for x in quick_subjects]
|
|
652 |
|
653 |
|
654 |
class BGSource(Enum):
|
655 |
-
UPLOAD = "Use Background Image"
|
656 |
-
UPLOAD_FLIP = "Use Flipped Background Image"
|
657 |
LEFT = "Left Light"
|
658 |
RIGHT = "Right Light"
|
659 |
TOP = "Top Light"
|
660 |
BOTTOM = "Bottom Light"
|
661 |
GREY = "Ambient"
|
|
|
|
|
662 |
|
663 |
# Add save function
|
664 |
def save_images(images, prefix="relight"):
|
|
|
107 |
print(f"Xformers error: {e}")
|
108 |
print("Falling back to sliced attention")
|
109 |
# Use sliced attention for RTX 2070
|
110 |
+
#unet.set_attention_slice_size(4)
|
111 |
+
#vae.set_attention_slice_size(4)
|
112 |
unet.set_attn_processor(AttnProcessor2_0())
|
113 |
vae.set_attn_processor(AttnProcessor2_0())
|
114 |
else:
|
115 |
# Fallback for when xformers is not available
|
116 |
print("Using sliced attention")
|
117 |
+
#unet.set_attention_slice_size(4)
|
118 |
+
#vae.set_attention_slice_size(4)
|
119 |
unet.set_attn_processor(AttnProcessor2_0())
|
120 |
vae.set_attn_processor(AttnProcessor2_0())
|
121 |
|
|
|
652 |
|
653 |
|
654 |
class BGSource(Enum):
|
|
|
|
|
655 |
LEFT = "Left Light"
|
656 |
RIGHT = "Right Light"
|
657 |
TOP = "Top Light"
|
658 |
BOTTOM = "Bottom Light"
|
659 |
GREY = "Ambient"
|
660 |
+
UPLOAD = "Use Background Image"
|
661 |
+
UPLOAD_FLIP = "Use Flipped Background Image"
|
662 |
|
663 |
# Add save function
|
664 |
def save_images(images, prefix="relight"):
|