Spaces:
Runtime error
Runtime error
Commit
·
85b7305
1
Parent(s):
2c80ba4
update app.py
Browse files
app.py
CHANGED
|
@@ -106,6 +106,36 @@ def prepare_pipeline(model_version, enable_realism, enable_anti_blur):
|
|
| 106 |
|
| 107 |
|
| 108 |
@spaces.GPU(duration=120)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
def generate_image(
|
| 110 |
input_image,
|
| 111 |
control_image,
|
|
@@ -128,7 +158,8 @@ def generate_image(
|
|
| 128 |
seed = torch.seed() & 0xFFFFFFFF
|
| 129 |
|
| 130 |
try:
|
| 131 |
-
image =
|
|
|
|
| 132 |
id_image=input_image,
|
| 133 |
prompt=prompt,
|
| 134 |
control_image=control_image,
|
|
|
|
| 106 |
|
| 107 |
|
| 108 |
@spaces.GPU(duration=120)
|
| 109 |
+
def generate_image_infer(
|
| 110 |
+
pipeline,
|
| 111 |
+
id_image,
|
| 112 |
+
prompt,
|
| 113 |
+
control_image,
|
| 114 |
+
seed,
|
| 115 |
+
width,
|
| 116 |
+
height,
|
| 117 |
+
guidance_scale,
|
| 118 |
+
num_steps,
|
| 119 |
+
infusenet_conditioning_scale,
|
| 120 |
+
infusenet_guidance_start,
|
| 121 |
+
infusenet_guidance_end,
|
| 122 |
+
):
|
| 123 |
+
image = pipeline(
|
| 124 |
+
id_image=id_image,
|
| 125 |
+
prompt=prompt,
|
| 126 |
+
control_image=control_image,
|
| 127 |
+
seed=seed,
|
| 128 |
+
width=width,
|
| 129 |
+
height=height,
|
| 130 |
+
guidance_scale=guidance_scale,
|
| 131 |
+
num_steps=num_steps,
|
| 132 |
+
infusenet_conditioning_scale=infusenet_conditioning_scale,
|
| 133 |
+
infusenet_guidance_start=infusenet_guidance_start,
|
| 134 |
+
infusenet_guidance_end=infusenet_guidance_end,
|
| 135 |
+
)
|
| 136 |
+
return image
|
| 137 |
+
|
| 138 |
+
|
| 139 |
def generate_image(
|
| 140 |
input_image,
|
| 141 |
control_image,
|
|
|
|
| 158 |
seed = torch.seed() & 0xFFFFFFFF
|
| 159 |
|
| 160 |
try:
|
| 161 |
+
image = generate_image_infer(
|
| 162 |
+
pipeline=pipeline,
|
| 163 |
id_image=input_image,
|
| 164 |
prompt=prompt,
|
| 165 |
control_image=control_image,
|