LogicGoInfotechSpaces commited on
Commit
e3ec294
·
verified ·
1 Parent(s): ae866cf

Update src/core.py

Browse files
Files changed (1) hide show
  1. src/core.py +29 -32
src/core.py CHANGED
@@ -24,38 +24,35 @@ DEFAULT_PROMPT = os.environ.get(
24
  "GEMINI_IMAGE_PROMPT",
25
  (
26
  "TASK TYPE: STRICT IMAGE INPAINTING — OBJECT REMOVAL ONLY\n\n"
27
- "You are given:\n"
28
- "1) An original image\n"
29
- "2) A binary mask image\n\n"
30
- "MASK RULE (MANDATORY):\n"
31
- "White pixels (#FFFFFF) indicate the exact region to be REMOVED.\n"
32
- "Black pixels (#000000) indicate regions that MUST remain completely unchanged.\n\n"
33
- "PRIMARY OBJECTIVE:\n"
34
- "Completely delete everything inside the white masked area.\n"
35
- "The object in the white region must be fully removed with no visible remnants,\n"
36
- "no partial shapes, no outlines, no shadows, and no color traces.\n\n"
37
- "INPAINTING INSTRUCTIONS:\n"
38
- "Ignore the content of the white masked area entirely.\n"
39
- "Reconstruct that region using ONLY surrounding background information.\n"
40
- "Extend nearby background textures, patterns, and structures naturally.\n"
41
- "Match lighting direction, brightness, contrast, color temperature, and noise.\n"
42
- "Continue edges, lines, and surfaces realistically across the removed area.\n"
43
- "Blend boundaries smoothly so the edit is visually undetectable.\n\n"
44
- "Return only the edited image.\n\n"
45
- "STRICT CONSTRAINTS:\n"
46
- "Do NOT generate or keep any part of the removed object.\n"
47
- "Do NOT invent new objects or details.\n"
48
- " Do NOT repaint, modify, blur, or enhance any black (unmasked) area.\n"
49
- " Do NOT change the original image composition.\n"
50
- " Do NOT change camera angle, perspective, or scale.\n\n"
51
- "QUALITY REQUIREMENTS:\n"
52
- " No ghosting or transparent object remains.\n"
53
- "No edge halos or smearing.\n"
54
- " No repeated textures or patchy fills.\n"
55
- " Result must look like the object never existed.\n\n"
56
- "FAILURE CONDITIONS (MUST BE AVOIDED):\n"
57
- "If any object fragment, outline, shadow, or color from the removed object\n"
58
- "is still visible, the result is incorrect and must be re-generated."
59
  ),
60
  )
61
  _GENAI_MODEL: genai.GenerativeModel | None = None
 
24
  "GEMINI_IMAGE_PROMPT",
25
  (
26
  "TASK TYPE: STRICT IMAGE INPAINTING — OBJECT REMOVAL ONLY\n\n"
27
+ "You are provided with two images:\n\n"
28
+ "The original image (Image A).\n\n"
29
+ "The binary mask image (Image B).\n\n"
30
+ "MASK RULE (MANDATORY):\n\n"
31
+ "White pixels (#FFFFFF) in the mask image represent the areas to be removed from the original image.\n"
32
+ "Black pixels (#000000) indicate regions that must remain unchanged and should not be modified.\n\n"
33
+ "PRIMARY OBJECTIVE:\n\n"
34
+ "Your task is to remove everything inside the white-masked area of the original image (Image A). "
35
+ "The object in the white region must be completely erased with no visible remnants, no partial outlines, "
36
+ "and no color traces remaining.\n\n"
37
+ "The area should be inpainted by reconstructing the surrounding background content to seamlessly fill the removed region.\n\n"
38
+ "INPAINTING INSTRUCTIONS:\n\n"
39
+ "Use only the surrounding background of the original image to fill the white-masked area.\n"
40
+ "Extend nearby textures, patterns, and structures naturally.\n"
41
+ "Match the lighting, brightness, contrast, and color temperature of the surrounding areas.\n"
42
+ "Ensure that edges, lines, and surfaces continue across the removed area naturally and smoothly.\n"
43
+ "The boundary of the inpainted region should blend seamlessly with the original background, and the edit should be visually undetectable.\n\n"
44
+ "STRICT CONSTRAINTS:\n\n"
45
+ "Do NOT generate or retain any part of the removed object.\n"
46
+ "Do NOT modify or enhance the unmasked areas (black regions).\n"
47
+ "Do NOT alter the original composition or camera angle of the image.\n\n"
48
+ "FAILURE CONDITIONS:\n\n"
49
+ "If any outline, shadow, or color fragment from the removed object is still visible in the final result, "
50
+ "the edit is incorrect and needs to be regenerated.\n\n"
51
+ "QUALITY REQUIREMENTS:\n\n"
52
+ "The result must look like the object never existed in the original image.\n"
53
+ "No ghosting, halo effects, or smearing should be present.\n"
54
+ "The final image should have natural and realistic inpainting, without patchy fills or repeated textures.\n\n"
55
+ "Please ensure that all conditions are followed strictly for accurate and flawless object removal."
 
 
 
56
  ),
57
  )
58
  _GENAI_MODEL: genai.GenerativeModel | None = None