Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -262,26 +262,26 @@ def inference(
|
|
| 262 |
if invert_init_image and init_image is not None:
|
| 263 |
init_image = invert_image(init_image)
|
| 264 |
|
| 265 |
-
#
|
| 266 |
-
prompt_chunks = split_prompt(prompt)
|
| 267 |
-
negative_prompt_chunks = split_prompt(negative_prompt)
|
| 268 |
|
| 269 |
final_image = None
|
| 270 |
-
for prompt_chunk, negative_prompt_chunk in zip(prompt_chunks, negative_prompt_chunks):
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
|
| 286 |
if invert_final_image:
|
| 287 |
final_image = invert_image(final_image)
|
|
|
|
| 262 |
if invert_init_image and init_image is not None:
|
| 263 |
init_image = invert_image(init_image)
|
| 264 |
|
| 265 |
+
# Commenting out the prompt splitting
|
| 266 |
+
# prompt_chunks = split_prompt(prompt)
|
| 267 |
+
# negative_prompt_chunks = split_prompt(negative_prompt)
|
| 268 |
|
| 269 |
final_image = None
|
| 270 |
+
# for prompt_chunk, negative_prompt_chunk in zip(prompt_chunks, negative_prompt_chunks):
|
| 271 |
+
out = pipe(
|
| 272 |
+
prompt=prompt, # Use the full prompt
|
| 273 |
+
negative_prompt=negative_prompt, # Use the full negative prompt
|
| 274 |
+
image=init_image,
|
| 275 |
+
control_image=control_image,
|
| 276 |
+
width=1024,
|
| 277 |
+
height=1024,
|
| 278 |
+
guidance_scale=float(guidance_scale),
|
| 279 |
+
controlnet_conditioning_scale=float(controlnet_conditioning_scale),
|
| 280 |
+
generator=generator,
|
| 281 |
+
strength=float(strength),
|
| 282 |
+
num_inference_steps=20,
|
| 283 |
+
)
|
| 284 |
+
final_image = out.images[0] if final_image is None else final_image
|
| 285 |
|
| 286 |
if invert_final_image:
|
| 287 |
final_image = invert_image(final_image)
|