Spaces:
Sleeping
Sleeping
Bobby
commited on
Commit
·
9234160
1
Parent(s):
97a87f4
print prompt
Browse files
app.py
CHANGED
|
@@ -453,25 +453,24 @@ def process_image(
|
|
| 453 |
).images[0]
|
| 454 |
|
| 455 |
# Randomly choose whether to add furniture and which type
|
| 456 |
-
furniture_types = ["
|
| 457 |
furniture_type = random.choice(furniture_types)
|
| 458 |
|
| 459 |
-
|
| 460 |
-
|
| 461 |
-
|
| 462 |
-
|
| 463 |
-
|
| 464 |
-
|
| 465 |
-
|
| 466 |
-
|
| 467 |
-
|
| 468 |
-
|
| 469 |
-
|
| 470 |
-
|
| 471 |
-
|
| 472 |
-
|
| 473 |
-
|
| 474 |
-
final_result = initial_result
|
| 475 |
|
| 476 |
# Save and upload results
|
| 477 |
timestamp = int(time.time())
|
|
|
|
| 453 |
).images[0]
|
| 454 |
|
| 455 |
# Randomly choose whether to add furniture and which type
|
| 456 |
+
furniture_types = ["sofa", "table", "chair", "dresser", "bookshelf", "desk", "coffee table"]
|
| 457 |
furniture_type = random.choice(furniture_types)
|
| 458 |
|
| 459 |
+
|
| 460 |
+
furniture_mask = generate_furniture_mask(initial_result, furniture_type)
|
| 461 |
+
furniture_prompt = f"{prompt}, with a {furniture_type} in the style of {style_selection}"
|
| 462 |
+
print(furniture_prompt)
|
| 463 |
+
|
| 464 |
+
# Use the inpainting pipeline to add furniture
|
| 465 |
+
final_result = inpaint_pipe(
|
| 466 |
+
prompt=furniture_prompt,
|
| 467 |
+
image=initial_result,
|
| 468 |
+
mask_image=furniture_mask,
|
| 469 |
+
negative_prompt=negative_prompt,
|
| 470 |
+
num_inference_steps=num_steps,
|
| 471 |
+
guidance_scale=guidance_scale,
|
| 472 |
+
generator=generator,
|
| 473 |
+
).images[0]
|
|
|
|
| 474 |
|
| 475 |
# Save and upload results
|
| 476 |
timestamp = int(time.time())
|