lionelgarnier commited on
Commit
67b0366
·
1 Parent(s): a196f30

update default system prompt to English and simplify examples format

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -18,13 +18,13 @@ MAX_IMAGE_SIZE = 2048
18
  PRELOAD_MODELS = False
19
 
20
  # Default system prompt for text generation
21
- DEFAULT_SYSTEM_PROMPT = """Vous êtes un designer produit avec de solides connaissances dans la génération de texte en image. Vous recevrez une demande de produit sous forme de description succincte, et votre mission sera d'imaginer un nouveau design de produit répondant à ce besoin.
22
 
23
- Le livrable (réponse générée) sera exclusivement un texte de prompt pour l'IA de texte to image FLUX.1-schnell.
24
 
25
- Ce prompt devra inclure une description visuelle de l'objet mentionnant explicitement les aspects indispensables de sa fonction.
26
- A coté de ça vous devez aussi explicitement mentionner dans ce prompt les caractéristiques esthétiques/photo du rendu image (ex : photoréaliste, haute qualité, focale, grain, etc.), sachant que l'image sera l'image principale de cet objet dans le catalogue produit. Le fond de l'image générée doit être entièrement blanc.
27
- Le prompt doit être sans narration, peut être long mais ne doit pas dépasser 77 jetons."""
28
 
29
  # Default Flux parameters
30
  DEFAULT_SEED = 42
@@ -172,9 +172,9 @@ def infer(prompt, seed=DEFAULT_SEED,
172
 
173
  # Format: [prompt, system_prompt]
174
  examples = [
175
- ["a backpack for kids, flower style", DEFAULT_SYSTEM_PROMPT],
176
- ["medieval flip flops", DEFAULT_SYSTEM_PROMPT],
177
- ["cat shaped cake mold", DEFAULT_SYSTEM_PROMPT],
178
  ]
179
 
180
  css="""
@@ -292,7 +292,7 @@ def create_interface():
292
  gr.Examples(
293
  examples=examples, # Now just a list of prompts
294
  fn=process_example_pipeline,
295
- inputs=[prompt, system_prompt], # Add system_prompt as input
296
  outputs=[prompt, refined_prompt, error_box], # Don't output image
297
  cache_examples=True,
298
  )
 
18
  PRELOAD_MODELS = False
19
 
20
  # Default system prompt for text generation
21
+ DEFAULT_SYSTEM_PROMPT = """You are a product designer with strong knowledge in text-to-image generation. You will receive a product request in the form of a brief description, and your mission will be to imagine a new product design that meets this need.
22
 
23
+ The deliverable (generated response) will be exclusively a text prompt for the FLUX.1-schnell text-to-image AI.
24
 
25
+ This prompt should include a visual description of the object explicitly mentioning the essential aspects of its function.
26
+ Additionally, you should explicitly mention in this prompt the aesthetic/photo characteristics of the image rendering (e.g., photorealistic, high quality, focal length, grain, etc.), knowing that the image will be the main image of this object in the product catalog. The background of the generated image must be entirely white.
27
+ The prompt should be without narration, can be long but must not exceed 77 tokens."""
28
 
29
  # Default Flux parameters
30
  DEFAULT_SEED = 42
 
172
 
173
  # Format: [prompt, system_prompt]
174
  examples = [
175
+ "a backpack for kids, flower style",
176
+ "medieval flip flops",
177
+ "cat shaped cake mold",
178
  ]
179
 
180
  css="""
 
292
  gr.Examples(
293
  examples=examples, # Now just a list of prompts
294
  fn=process_example_pipeline,
295
+ inputs=[prompt], # Add system_prompt as input
296
  outputs=[prompt, refined_prompt, error_box], # Don't output image
297
  cache_examples=True,
298
  )