asp2131 commited on
Commit
1db1c5f
Β·
1 Parent(s): 32a3ae6

Adjust ControlNet parameters and update default prompts for improved generation quality

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -78,7 +78,7 @@ def generate(
78
  control_image=control_image,
79
  controlnet_conditioning_scale=float(controlnet_scale),
80
  control_guidance_start=0.0,
81
- control_guidance_end=0.85,
82
  num_inference_steps=int(num_steps),
83
  guidance_scale=float(guidance_scale),
84
  height=768,
@@ -95,12 +95,13 @@ DEFAULT_PROMPT = (
95
  "oversized t-shirt, baggy pants, chunky round shoes, "
96
  "bold clean ink outlines, apricot warm glowing skin tone, "
97
  "rosy cheeks, large expressive eyes, soft pastel colors, "
 
98
  "Ponyo 2008 Miyazaki character design sheet, white background, "
99
  "three views front side portrait"
100
  )
101
  DEFAULT_NEG = (
102
  "blurry, dark skin, umber brown, muddy colors, soft edges, "
103
- "no outlines, photorealistic, 3d render, ugly, deformed, "
104
  "extra limbs, watermark, signature"
105
  )
106
 
@@ -256,7 +257,7 @@ with gr.Blocks(title="Ghibli Character Studio") as demo:
256
  with gr.Accordion("βš™οΈ Advanced Controls", open=False):
257
  with gr.Row():
258
  controlnet_scale = gr.Slider(
259
- 0.3, 1.0, value=0.7, step=0.05,
260
  label="ControlNet Strength",
261
  info="Higher = follows your sketch more strictly"
262
  )
@@ -276,7 +277,7 @@ with gr.Blocks(title="Ghibli Character Studio") as demo:
276
  info="Change for variation"
277
  )
278
  with gr.Row():
279
- canny_low = gr.Slider(50, 150, value=100, step=5, label="Canny Low Threshold")
280
  canny_high = gr.Slider(100, 300, value=200, step=10, label="Canny High Threshold")
281
 
282
  generate_btn = gr.Button("✨ Generate Ponyo Style", variant="primary", size="lg")
@@ -298,7 +299,7 @@ with gr.Blocks(title="Ghibli Character Studio") as demo:
298
  # ── Tips ───────────────────────────────────────────────────────────────────
299
  with gr.Accordion("πŸ’‘ Tips for best results", open=False):
300
  gr.Markdown("""
301
- - **ControlNet Strength 0.6–0.75** gives the best balance between your character's shape and Ghibli style
302
  - **Canny thresholds** β€” if the edge map looks too noisy, raise the low threshold. If too sparse, lower it.
303
  - **Seed** β€” lock a seed you like, then only change the prompt to iterate consistently
304
  - For a **character sheet with 3 views**, make sure your image shows front + side + face clearly before uploading
 
78
  control_image=control_image,
79
  controlnet_conditioning_scale=float(controlnet_scale),
80
  control_guidance_start=0.0,
81
+ control_guidance_end=0.65,
82
  num_inference_steps=int(num_steps),
83
  guidance_scale=float(guidance_scale),
84
  height=768,
 
95
  "oversized t-shirt, baggy pants, chunky round shoes, "
96
  "bold clean ink outlines, apricot warm glowing skin tone, "
97
  "rosy cheeks, large expressive eyes, soft pastel colors, "
98
+ "2d hand-drawn, cel animation, flat colors, "
99
  "Ponyo 2008 Miyazaki character design sheet, white background, "
100
  "three views front side portrait"
101
  )
102
  DEFAULT_NEG = (
103
  "blurry, dark skin, umber brown, muddy colors, soft edges, "
104
+ "no outlines, photorealistic, 3d render, CG, chibi, ugly, deformed, "
105
  "extra limbs, watermark, signature"
106
  )
107
 
 
257
  with gr.Accordion("βš™οΈ Advanced Controls", open=False):
258
  with gr.Row():
259
  controlnet_scale = gr.Slider(
260
+ 0.3, 1.0, value=0.55, step=0.05,
261
  label="ControlNet Strength",
262
  info="Higher = follows your sketch more strictly"
263
  )
 
277
  info="Change for variation"
278
  )
279
  with gr.Row():
280
+ canny_low = gr.Slider(50, 150, value=120, step=5, label="Canny Low Threshold")
281
  canny_high = gr.Slider(100, 300, value=200, step=10, label="Canny High Threshold")
282
 
283
  generate_btn = gr.Button("✨ Generate Ponyo Style", variant="primary", size="lg")
 
299
  # ── Tips ───────────────────────────────────────────────────────────────────
300
  with gr.Accordion("πŸ’‘ Tips for best results", open=False):
301
  gr.Markdown("""
302
+ - **ControlNet Strength 0.45–0.6** gives the best balance between your character's shape and Ghibli style
303
  - **Canny thresholds** β€” if the edge map looks too noisy, raise the low threshold. If too sparse, lower it.
304
  - **Seed** β€” lock a seed you like, then only change the prompt to iterate consistently
305
  - For a **character sheet with 3 views**, make sure your image shows front + side + face clearly before uploading