Update src/core.py
Browse files- 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
|
| 28 |
-
"
|
| 29 |
-
"
|
| 30 |
-
"MASK RULE (MANDATORY):\n"
|
| 31 |
-
"
|
| 32 |
-
"
|
| 33 |
-
"PRIMARY OBJECTIVE:\n"
|
| 34 |
-
"
|
| 35 |
-
"The object in the white region must be
|
| 36 |
-
"
|
| 37 |
-
"
|
| 38 |
-
"
|
| 39 |
-
"
|
| 40 |
-
"Extend nearby
|
| 41 |
-
"Match lighting
|
| 42 |
-
"
|
| 43 |
-
"
|
| 44 |
-
"
|
| 45 |
-
"
|
| 46 |
-
"
|
| 47 |
-
"
|
| 48 |
-
"
|
| 49 |
-
"
|
| 50 |
-
"
|
| 51 |
-
"QUALITY REQUIREMENTS:\n"
|
| 52 |
-
"
|
| 53 |
-
"
|
| 54 |
-
"
|
| 55 |
-
"
|
| 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
|