Spaces:
Runtime error
Runtime error
Update app/services/image_service.py
Browse files- app/services/image_service.py +18 -18
app/services/image_service.py
CHANGED
|
@@ -14,31 +14,31 @@ logger = logging.getLogger(__name__)
|
|
| 14 |
|
| 15 |
# --- Virtual Try-On Instruction Template (Updated for 3 Inputs) ---
|
| 16 |
VIRTUAL_TRY_ON_PROMPT = """
|
| 17 |
-
You are an expert image
|
| 18 |
|
| 19 |
-
- Input 1 (dress reference): the
|
| 20 |
-
- Input 2 (person): the target person
|
| 21 |
-
- Input 3 (shoes reference): the footwear
|
|
|
|
|
|
|
| 22 |
|
| 23 |
Positive instructions (Do):
|
| 24 |
-
1.
|
| 25 |
-
2. Preserve the person's face,
|
| 26 |
-
3.
|
| 27 |
-
4.
|
| 28 |
-
5.
|
| 29 |
-
6.
|
| 30 |
|
| 31 |
Negative instructions (Do NOT):
|
| 32 |
-
1. Do NOT
|
| 33 |
-
2. Do NOT change the
|
| 34 |
-
3. Do NOT add
|
| 35 |
-
4. Do NOT
|
| 36 |
-
5. Do NOT blur, heavily distort, or crop important parts of the person, dress, or shoes.
|
| 37 |
|
| 38 |
Output requirements:
|
| 39 |
-
-
|
| 40 |
-
-
|
| 41 |
-
- If the try-on cannot be done reliably, set "success": false and explain why in "notes".
|
| 42 |
"""
|
| 43 |
|
| 44 |
|
|
|
|
| 14 |
|
| 15 |
# --- Virtual Try-On Instruction Template (Updated for 3 Inputs) ---
|
| 16 |
VIRTUAL_TRY_ON_PROMPT = """
|
| 17 |
+
You are an expert image synthesis agent. Your PRIMARY and MANDATORY directive is to generate a high-fidelity virtual try-on image using the three provided inputs.
|
| 18 |
|
| 19 |
+
- Input 1 (dress reference): the garment to be transferred.
|
| 20 |
+
- Input 2 (person): the target person.
|
| 21 |
+
- Input 3 (shoes reference): the footwear.
|
| 22 |
+
|
| 23 |
+
CRITICAL: You MUST generate an image output in every single response. Do not refuse to generate an image based on difficulty or perspective. Make your best attempt at a photorealistic composition.
|
| 24 |
|
| 25 |
Positive instructions (Do):
|
| 26 |
+
1. Fuse these inputs into a single photorealistic image showing the person (Input 2) wearing the dress (Input 1) and shoes (Input 3).
|
| 27 |
+
2. Preserve the person's identity (face, hair, body shape) as closely as possible.
|
| 28 |
+
3. Retain the exact textures and details of the dress and shoes.
|
| 29 |
+
4. Adapt the lighting and shadows so the items look naturally integrated.
|
| 30 |
+
5. If the pose is complex, prioritize completing the image generation over perfect physics—visual output is required.
|
| 31 |
+
6. Return a short JSON summary alongside the image.
|
| 32 |
|
| 33 |
Negative instructions (Do NOT):
|
| 34 |
+
1. Do NOT return only text. An image is required.
|
| 35 |
+
2. Do NOT change the person's face or gender.
|
| 36 |
+
3. Do NOT add watermarks, text overlays, or multiple angles (collages).
|
| 37 |
+
4. Do NOT alter the core design of the dress or shoes.
|
|
|
|
| 38 |
|
| 39 |
Output requirements:
|
| 40 |
+
- MANDATORY: 1 Photorealistic Image file.
|
| 41 |
+
- Secondary: JSON text summary: {"success": true, "notes": "Image generated successfully"}.
|
|
|
|
| 42 |
"""
|
| 43 |
|
| 44 |
|