lionelgarnier commited on
Commit
3dd2ec3
·
1 Parent(s): f17d614

update system prompt and interface labels for clarity and consistency

Browse files
Files changed (1) hide show
  1. app.py +10 -5
app.py CHANGED
@@ -31,11 +31,11 @@ PRELOAD_MODELS = False
31
  # Default system prompt for text generation
32
  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.
33
 
34
- The deliverable (generated response) will be exclusively a text prompt for the FLUX.1-schnell text-to-image AI.
35
 
36
  This prompt should include a visual description of the object explicitly mentioning the essential aspects of its function.
37
  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.
38
- The prompt should be without narration, can be long but must not exceed 77 tokens."""
39
 
40
  # Default Flux parameters
41
  DEFAULT_SEED = 42
@@ -402,7 +402,7 @@ def create_interface():
402
  output_state = gr.State(None)
403
 
404
  with gr.Column(elem_id="col-container"):
405
- gr.Markdown("# Text to Product\nUsing Mistral-7B + FLUX.1-dev + Trellis")
406
 
407
  prompt = gr.Text(
408
  show_label=False,
@@ -486,10 +486,15 @@ def create_interface():
486
 
487
  gr.Examples(
488
  examples=examples,
489
- fn=process_example_pipeline,
490
- inputs=[prompt],
 
491
  outputs=[refined_prompt, message_box],
492
  cache_examples=True,
 
 
 
 
493
  )
494
 
495
  gr.on(
 
31
  # Default system prompt for text generation
32
  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.
33
 
34
+ The deliverable (generated response) will be exclusively a text prompt for the FLUX.1-dev text-to-image AI.
35
 
36
  This prompt should include a visual description of the object explicitly mentioning the essential aspects of its function.
37
  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.
38
+ The prompt should be without narration."""
39
 
40
  # Default Flux parameters
41
  DEFAULT_SEED = 42
 
402
  output_state = gr.State(None)
403
 
404
  with gr.Column(elem_id="col-container"):
405
+ gr.Markdown("# Text to 3D\nFocusing on product creation\nUsing Mistral-7B + FLUX.1-dev + Trellis")
406
 
407
  prompt = gr.Text(
408
  show_label=False,
 
486
 
487
  gr.Examples(
488
  examples=examples,
489
+ # fn=process_example_pipeline,
490
+ fn=refine_prompt,
491
+ inputs=[prompt, system_prompt],
492
  outputs=[refined_prompt, message_box],
493
  cache_examples=True,
494
+ ).then(
495
+ fn=generate_image,
496
+ inputs=[refined_prompt, flux_seed, flux_randomize_seed, width, height, num_inference_steps],
497
+ outputs=[generated_image, message_box]
498
  )
499
 
500
  gr.on(