DawnC commited on
Commit
1684f62
Β·
verified Β·
1 Parent(s): b98067e

Update inpainting_templates.py

Browse files
Files changed (1) hide show
  1. 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.6, # Medium-high: preserve structure/shape from edges
89
  feather_radius=4, # Low: clean color boundaries
90
- guidance_scale=12.0, # High: follow color prompt
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: Pure color transformation (any object type)",
99
  "",
100
- "πŸ“– HOW TO USE:",
101
- "1️⃣ Use the brush tool to paint over the area you want to change",
102
- "2️⃣ Enter ONLY the target color in the prompt box",
103
- "3️⃣ Click Generate",
 
 
104
  "",
105
- "βœ… CORRECT Prompt Examples:",
106
- " β€’ Just type: 'red' (not 'red shirt')",
107
- " β€’ Just type: 'bright blue' (not 'blue clothing')",
108
- " β€’ Just type: 'pure white' (not 'white polo')",
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: Change clothing style, material, or design",
159
- "βœ… Describe clothing type: 'white polo shirt', 'formal black suit', 'denim jacket'",
160
- "βœ… Can include color: 'red polo shirt with collar'",
161
- "βœ… Can describe details: 'casual shirt with buttons and pockets'",
162
- "βœ… Preserves body structure and natural fit",
163
- "πŸ“ Example prompts:",
164
- " β€’ 'white polo shirt with clean collar'",
165
- " β€’ 'formal business suit with tie'",
166
- " β€’ 'casual denim jacket with pockets'",
167
- " β€’ 'red t-shirt with simple design'",
168
- "πŸ’‘ Use after 'Change Color' if you want to refine style details"
 
 
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 objects with new ones",
196
- "⚠️ IMPORTANT: One object type at a time only!",
197
- "⚠️ All masked areas become the SAME object",
198
- "βœ… Describe target object: 'ceramic vase with flowers', 'wooden chair'",
199
- "βœ… Can add details: 'modern glass table with metal legs'",
200
- "πŸ“ Example workflow:",
201
- " β€’ Step 1: Mask position A β†’ prompt 'red vase' β†’ Generate",
202
- " β€’ Step 2: Mask position B β†’ prompt 'wooden chair' β†’ Generate",
203
- "πŸ“ Example prompts:",
204
- " β€’ 'white ceramic vase with fresh flowers'",
205
- " β€’ 'modern wooden chair with cushion'",
206
- " β€’ 'elegant glass bottle with cork'",
207
- "πŸ’‘ For multiple object types, do it in batches (one type per generation)"
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
- "βœ… Describe the BACKGROUND material: 'wooden floor', 'white wall', 'grass field'",
236
- "❌ DON'T describe the object to remove",
237
- "❌ Leave prompt EMPTY if you want to match surrounding automatically",
238
- "βœ… Mask should completely cover the object to remove",
239
- "πŸ“ Example prompts:",
240
- " β€’ 'wooden floor texture'",
241
- " β€’ 'white painted wall'",
242
- " β€’ 'green grass field'",
243
- " β€’ 'concrete pavement'",
244
- " β€’ '' (empty - auto match surrounding)",
245
- "πŸ’‘ Works best with simple, uniform backgrounds"
 
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
  }