Hammad712 commited on
Commit
c775375
·
verified ·
1 Parent(s): 65d2ca9

Update app/services/image_service.py

Browse files
Files changed (1) hide show
  1. 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-editing agent. Perform a high-fidelity virtual try-on using three inputs:
18
 
19
- - Input 1 (dress reference): the exact garment image to be transferred.
20
- - Input 2 (person): the target person who must wear the garment.
21
- - Input 3 (shoes reference): the footwear to be worn.
 
 
22
 
23
  Positive instructions (Do):
24
- 1. Produce exactly one photorealistic output image showing the person from Input 2 wearing BOTH the dress from Input 1 and the shoes from Input 3.
25
- 2. Preserve the person's face, facial features, expression, hair, gender, skin tone, and body proportions do NOT change identity.
26
- 3. Reproduce the dress design, color, pattern, fabric texture, and major details (buttons, seams, prints) faithfully.
27
- 4. Reproduce the shoes faithfully and ensure they fit the person's stance naturally (grounding, shadows).
28
- 5. Match lighting, shadows, perspective, and scale so all items appear naturally worn by the person in the original scene.
29
- 6. Also return a short text JSON summary with the form: {"success": true|false, "notes": "explain any limitations or changes"}.
30
 
31
  Negative instructions (Do NOT):
32
- 1. Do NOT modify the person's face, gender, or identifying features.
33
- 2. Do NOT change the dress/shoe color, pattern, or main texture.
34
- 3. Do NOT add extra clothing items, logos, watermarks, offensive symbols, or unrelated props.
35
- 4. Do NOT produce empty responses, placeholders, or images containing text overlays.
36
- 5. Do NOT blur, heavily distort, or crop important parts of the person, dress, or shoes.
37
 
38
  Output requirements:
39
- - Return a single photorealistic image (same orientation as the person image) and a short text JSON summary.
40
- - No collages, no multiple thumbnail images, no visible watermarks.
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