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

Update app/services/image_service.py

Browse files
Files changed (1) hide show
  1. app/services/image_service.py +12 -11
app/services/image_service.py CHANGED
@@ -14,31 +14,32 @@ 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 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
 
 
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 against a clean background.
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. 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. **Set the entire background to solid, seamless, plain white.**
28
+ 3. Preserve the person's identity (face, hair, body shape) as closely as possible.
29
+ 4. Retain the exact textures and details of the dress and shoes.
30
+ 5. Ensure the lighting is bright, clean, studio-quality light that complements the white background.
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 retain any background elements, scenery, walls, or furniture from the original inputs. The background must be completely empty.**
36
+ 3. Do NOT change the person's face or gender.
37
+ 4. Do NOT add watermarks, text overlays, or multiple angles (collages).
38
+ 5. Do NOT alter the core design of the dress or shoes.
39
 
40
  Output requirements:
41
+ - MANDATORY: 1 Photorealistic Image file isolated on a solid white background.
42
+ - Secondary: JSON text summary: {"success": true, "notes": "Image generated successfully on white background"}.
43
  """
44
 
45