tchung1970 Claude commited on
Commit
ad87b2d
Β·
1 Parent(s): 8a326c2

Fix duplicate Picasso-style descriptors in prompt enhancement

Browse files

Prevent duplication of style descriptors when they already exist in the prompt,
eliminating repeated text in the Status box output.

πŸ€– Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -40,8 +40,12 @@ def generate_image(prompt, num_inference_steps=28, guidance_scale=3.5):
40
  return None, "πŸš€ Loading AI model... Please wait a moment and try again!"
41
 
42
  try:
43
- # Enhance prompt for Picasso style
44
- enhanced_prompt = f"{prompt}, in the style of Pablo Picasso, cubist painting, abstract art, geometric shapes, fragmented forms, bold colors"
 
 
 
 
45
 
46
  # Generate image with FLUX parameters
47
  image = model_pipe(
 
40
  return None, "πŸš€ Loading AI model... Please wait a moment and try again!"
41
 
42
  try:
43
+ # Enhance prompt for Picasso style (avoid duplication)
44
+ picasso_style = "in the style of Pablo Picasso, cubist painting, abstract art, geometric shapes, fragmented forms, bold colors"
45
+ if picasso_style not in prompt:
46
+ enhanced_prompt = f"{prompt}, {picasso_style}"
47
+ else:
48
+ enhanced_prompt = prompt
49
 
50
  # Generate image with FLUX parameters
51
  image = model_pipe(