Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
import torch
|
| 2 |
from diffusers.utils import load_image
|
| 3 |
from diffusers import FluxControlNetPipeline, FluxControlNetModel, FluxMultiControlNetModel
|
|
@@ -24,18 +25,18 @@ control_modes = [
|
|
| 24 |
]
|
| 25 |
|
| 26 |
@spaces.GPU
|
| 27 |
-
def generate_image(prompt, control_image_depth,
|
| 28 |
control_images = []
|
| 29 |
control_modes = []
|
| 30 |
conditioning_scales = []
|
| 31 |
|
| 32 |
if use_depth:
|
| 33 |
control_images.append(control_image_depth)
|
| 34 |
-
control_modes.append(
|
| 35 |
conditioning_scales.append(0.2)
|
| 36 |
|
| 37 |
control_images.append(control_image_canny)
|
| 38 |
-
control_modes.append(
|
| 39 |
conditioning_scales.append(0.4)
|
| 40 |
|
| 41 |
width, height = control_image_canny.size
|
|
|
|
| 1 |
+
|
| 2 |
import torch
|
| 3 |
from diffusers.utils import load_image
|
| 4 |
from diffusers import FluxControlNetPipeline, FluxControlNetModel, FluxMultiControlNetModel
|
|
|
|
| 25 |
]
|
| 26 |
|
| 27 |
@spaces.GPU
|
| 28 |
+
def generate_image(prompt, control_image_depth, control_mode_depth, use_depth, control_image_canny, control_mode_canny):
|
| 29 |
control_images = []
|
| 30 |
control_modes = []
|
| 31 |
conditioning_scales = []
|
| 32 |
|
| 33 |
if use_depth:
|
| 34 |
control_images.append(control_image_depth)
|
| 35 |
+
control_modes.append(control_modes.index(control_mode_depth))
|
| 36 |
conditioning_scales.append(0.2)
|
| 37 |
|
| 38 |
control_images.append(control_image_canny)
|
| 39 |
+
control_modes.append(control_modes.index(control_mode_canny))
|
| 40 |
conditioning_scales.append(0.4)
|
| 41 |
|
| 42 |
width, height = control_image_canny.size
|