Spaces:
Running
on
Zero
Running
on
Zero
Update inpainting_templates.py
Browse files- inpainting_templates.py +52 -70
inpainting_templates.py
CHANGED
|
@@ -85,9 +85,9 @@ class InpaintingTemplateManager:
|
|
| 85 |
"new design, different style, style change, "
|
| 86 |
"complex patterns, printed patterns, embroidery"
|
| 87 |
),
|
| 88 |
-
controlnet_conditioning_scale=0.
|
| 89 |
feather_radius=4, # Low: clean color boundaries
|
| 90 |
-
guidance_scale=
|
| 91 |
num_inference_steps=10, # Optimized for speed
|
| 92 |
strength=1.0, # Full repaint for color change
|
| 93 |
preferred_conditioning="canny", # Edge-based: preserves shape
|
|
@@ -95,40 +95,19 @@ class InpaintingTemplateManager:
|
|
| 95 |
enhance_prompt=False, # Disabled: use color prompt directly
|
| 96 |
difficulty="easy",
|
| 97 |
usage_tips=[
|
| 98 |
-
"π― Purpose:
|
| 99 |
"",
|
| 100 |
-
"
|
| 101 |
-
"
|
| 102 |
-
"
|
| 103 |
-
"
|
|
|
|
|
|
|
| 104 |
"",
|
| 105 |
-
"
|
| 106 |
-
" β’
|
| 107 |
-
" β’
|
| 108 |
-
" β’
|
| 109 |
-
" β’ Just type: 'deep purple' (not 'purple fabric')",
|
| 110 |
-
"",
|
| 111 |
-
"β WRONG - DON'T describe objects:",
|
| 112 |
-
" β’ β 'red shirt' β may change clothing style",
|
| 113 |
-
" β’ β 'blue wall' β may add wall texture",
|
| 114 |
-
" β’ β 'white car' β may replace with different object",
|
| 115 |
-
"",
|
| 116 |
-
"π¨ What happens behind the scenes:",
|
| 117 |
-
" β’ Your input 'red' β becomes 'repaint as red color, solid red only'",
|
| 118 |
-
" β’ Mask-aware ControlNet weakens edges in painted area",
|
| 119 |
-
" β’ High guidance (20.0) forces color transformation",
|
| 120 |
-
" β’ Preserves object shape while changing color completely",
|
| 121 |
-
"",
|
| 122 |
-
"β‘ OPTIMIZED FOR:",
|
| 123 |
-
" β’ Extreme color changes (blackβred on anime/illustration)",
|
| 124 |
-
" β’ Flat color transformations",
|
| 125 |
-
" β’ Works on clothes, walls, furniture, any solid object",
|
| 126 |
-
"",
|
| 127 |
-
"π‘ Pro Tips:",
|
| 128 |
-
" β’ For best results: paint the ENTIRE object area",
|
| 129 |
-
" β’ Use simple color words: 'red', 'blue', 'green', 'yellow'",
|
| 130 |
-
" β’ Can add brightness: 'bright red', 'dark blue', 'light pink'",
|
| 131 |
-
" β’ To refine style after: use 'Clothing Change' template next"
|
| 132 |
]
|
| 133 |
),
|
| 134 |
|
|
@@ -155,17 +134,19 @@ class InpaintingTemplateManager:
|
|
| 155 |
enhance_prompt=True, # Enabled: enriches clothing details
|
| 156 |
difficulty="easy",
|
| 157 |
usage_tips=[
|
| 158 |
-
"π― Purpose:
|
| 159 |
-
"
|
| 160 |
-
"
|
| 161 |
-
"
|
| 162 |
-
"
|
| 163 |
-
"
|
| 164 |
-
" β’ '
|
| 165 |
-
" β’ '
|
| 166 |
-
"
|
| 167 |
-
"
|
| 168 |
-
"
|
|
|
|
|
|
|
| 169 |
]
|
| 170 |
),
|
| 171 |
|
|
@@ -192,19 +173,19 @@ class InpaintingTemplateManager:
|
|
| 192 |
enhance_prompt=True, # Enabled: enriches object details
|
| 193 |
difficulty="medium",
|
| 194 |
usage_tips=[
|
| 195 |
-
"π― Purpose: Replace
|
| 196 |
-
"
|
| 197 |
-
"
|
| 198 |
-
"
|
| 199 |
-
"
|
| 200 |
-
"
|
| 201 |
-
" β’
|
| 202 |
-
" β’
|
| 203 |
-
"
|
| 204 |
-
"
|
| 205 |
-
" β’
|
| 206 |
-
" β’
|
| 207 |
-
"
|
| 208 |
]
|
| 209 |
),
|
| 210 |
|
|
@@ -231,18 +212,19 @@ class InpaintingTemplateManager:
|
|
| 231 |
enhance_prompt=False, # Disabled: avoid generating new objects
|
| 232 |
difficulty="medium",
|
| 233 |
usage_tips=[
|
| 234 |
-
"π― Purpose: Remove objects and fill with background",
|
| 235 |
-
"
|
| 236 |
-
"
|
| 237 |
-
"
|
| 238 |
-
"
|
| 239 |
-
"
|
| 240 |
-
" β’ '
|
| 241 |
-
" β’ '
|
| 242 |
-
"
|
| 243 |
-
"
|
| 244 |
-
" β’
|
| 245 |
-
"
|
|
|
|
| 246 |
]
|
| 247 |
),
|
| 248 |
}
|
|
|
|
| 85 |
"new design, different style, style change, "
|
| 86 |
"complex patterns, printed patterns, embroidery"
|
| 87 |
),
|
| 88 |
+
controlnet_conditioning_scale=0.5, # Medium: balance structure preservation and color freedom
|
| 89 |
feather_radius=4, # Low: clean color boundaries
|
| 90 |
+
guidance_scale=13.0, # High: follow color prompt strongly
|
| 91 |
num_inference_steps=10, # Optimized for speed
|
| 92 |
strength=1.0, # Full repaint for color change
|
| 93 |
preferred_conditioning="canny", # Edge-based: preserves shape
|
|
|
|
| 95 |
enhance_prompt=False, # Disabled: use color prompt directly
|
| 96 |
difficulty="easy",
|
| 97 |
usage_tips=[
|
| 98 |
+
"π― Purpose: Change the color while keeping the original shape and structure.",
|
| 99 |
"",
|
| 100 |
+
"π Example Prompts:",
|
| 101 |
+
" β’ 'vibrant red' - for a bold, saturated red color",
|
| 102 |
+
" β’ 'soft pastel pink' - for a gentle, light pink tone",
|
| 103 |
+
" β’ 'deep navy blue' - for a rich, dark blue shade",
|
| 104 |
+
" β’ 'bright yellow' - for an eye-catching yellow",
|
| 105 |
+
" β’ 'pure white' - for a clean, solid white",
|
| 106 |
"",
|
| 107 |
+
"π‘ Tips:",
|
| 108 |
+
" β’ Describe ONLY the color, not the object itself",
|
| 109 |
+
" β’ Paint the entire area you want to recolor",
|
| 110 |
+
" β’ Add modifiers like 'bright', 'dark', 'pastel' for better results"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 111 |
]
|
| 112 |
),
|
| 113 |
|
|
|
|
| 134 |
enhance_prompt=True, # Enabled: enriches clothing details
|
| 135 |
difficulty="easy",
|
| 136 |
usage_tips=[
|
| 137 |
+
"π― Purpose: Replace clothing with a completely different style or design.",
|
| 138 |
+
"",
|
| 139 |
+
"π Example Prompts:",
|
| 140 |
+
" β’ 'white polo shirt with collar' - casual business look",
|
| 141 |
+
" β’ 'formal black suit with tie' - professional attire",
|
| 142 |
+
" β’ 'cozy knit sweater in cream color' - warm casual style",
|
| 143 |
+
" β’ 'vintage denim jacket with patches' - retro fashion",
|
| 144 |
+
" β’ 'elegant silk blouse in emerald green' - sophisticated look",
|
| 145 |
+
"",
|
| 146 |
+
"π‘ Tips:",
|
| 147 |
+
" β’ Include both clothing type AND color for best results",
|
| 148 |
+
" β’ Add details like 'with buttons', 'v-neck', 'long sleeves' for specificity",
|
| 149 |
+
" β’ Body structure is preserved automatically"
|
| 150 |
]
|
| 151 |
),
|
| 152 |
|
|
|
|
| 173 |
enhance_prompt=True, # Enabled: enriches object details
|
| 174 |
difficulty="medium",
|
| 175 |
usage_tips=[
|
| 176 |
+
"π― Purpose: Replace an object in the scene with something completely different.",
|
| 177 |
+
"",
|
| 178 |
+
"π Example Prompts:",
|
| 179 |
+
" β’ 'ceramic vase with colorful flowers' - decorative item",
|
| 180 |
+
" β’ 'modern laptop on a stand' - tech gadget",
|
| 181 |
+
" β’ 'stack of vintage books' - classic decoration",
|
| 182 |
+
" β’ 'potted succulent plant' - natural element",
|
| 183 |
+
" β’ 'antique brass lamp' - lighting fixture",
|
| 184 |
+
"",
|
| 185 |
+
"π‘ Tips:",
|
| 186 |
+
" β’ Replace ONE object type at a time for best results",
|
| 187 |
+
" β’ Describe what you want, not what you're removing",
|
| 188 |
+
" β’ Include material and style details for realism"
|
| 189 |
]
|
| 190 |
),
|
| 191 |
|
|
|
|
| 212 |
enhance_prompt=False, # Disabled: avoid generating new objects
|
| 213 |
difficulty="medium",
|
| 214 |
usage_tips=[
|
| 215 |
+
"π― Purpose: Remove unwanted objects and fill the area with background.",
|
| 216 |
+
"",
|
| 217 |
+
"π Example Prompts:",
|
| 218 |
+
" β’ 'smooth wooden floor texture' - for indoor floors",
|
| 219 |
+
" β’ 'clean white painted wall' - for wall backgrounds",
|
| 220 |
+
" β’ 'natural green grass' - for outdoor lawn areas",
|
| 221 |
+
" β’ 'beige carpet texture' - for carpeted floors",
|
| 222 |
+
" β’ 'clear blue sky with clouds' - for sky backgrounds",
|
| 223 |
+
"",
|
| 224 |
+
"π‘ Tips:",
|
| 225 |
+
" β’ Describe the BACKGROUND, not the object being removed",
|
| 226 |
+
" β’ Leave empty to auto-match surrounding textures",
|
| 227 |
+
" β’ Works best with uniform, simple backgrounds"
|
| 228 |
]
|
| 229 |
),
|
| 230 |
}
|