Spaces:
Sleeping
Sleeping
Update server.py
Browse files
server.py
CHANGED
|
@@ -15,6 +15,7 @@ from pathlib import Path
|
|
| 15 |
import subprocess
|
| 16 |
import sys
|
| 17 |
import requests
|
|
|
|
| 18 |
from PIL import Image
|
| 19 |
from io import BytesIO
|
| 20 |
from huggingface_hub import HfApi, login
|
|
@@ -609,7 +610,19 @@ async def generate_from_prompt(request: PromptRequest):
|
|
| 609 |
scene_dir.mkdir(parents=True, exist_ok=True)
|
| 610 |
|
| 611 |
try:
|
| 612 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 613 |
|
| 614 |
img_response = requests.post(
|
| 615 |
f"{image_server}/scrape",
|
|
|
|
| 15 |
import subprocess
|
| 16 |
import sys
|
| 17 |
import requests
|
| 18 |
+
import random
|
| 19 |
from PIL import Image
|
| 20 |
from io import BytesIO
|
| 21 |
from huggingface_hub import HfApi, login
|
|
|
|
| 610 |
scene_dir.mkdir(parents=True, exist_ok=True)
|
| 611 |
|
| 612 |
try:
|
| 613 |
+
# Random aesthetic query for title images (rich/luxury vibes)
|
| 614 |
+
title_queries = [
|
| 615 |
+
"rich girl luxury aesthetic",
|
| 616 |
+
"pretty girl aesthetic",
|
| 617 |
+
"luxury lifestyle photography",
|
| 618 |
+
"elegant aesthetic woman",
|
| 619 |
+
"high fashion editorial",
|
| 620 |
+
"luxury aesthetic girl",
|
| 621 |
+
"sophisticated woman fashion",
|
| 622 |
+
"premium aesthetic lifestyle",
|
| 623 |
+
]
|
| 624 |
+
title_image_query = random.choice(title_queries)
|
| 625 |
+
payload = {"keyword": title_image_query, "count": images_per_scene}
|
| 626 |
|
| 627 |
img_response = requests.post(
|
| 628 |
f"{image_server}/scrape",
|