evalstate HF Staff commited on
Commit
3c74019
·
verified ·
1 Parent(s): 1e16f76

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -163,7 +163,7 @@ def get_image_size(aspect_ratio):
163
 
164
  # --- Main Inference Function (with hardcoded negative prompt) ---
165
  @spaces.GPU(duration=60)
166
- def infer(
167
  prompt,
168
  seed=42,
169
  randomize_seed=False,
@@ -176,7 +176,7 @@ def infer(
176
  Generates an image based on a text prompt using the Qwen-Image-Lightning model.
177
 
178
  Args:
179
- prompt (str): The text prompt to generate the image from.
180
  seed (int): The seed for the random number generator for reproducibility.
181
  randomize_seed (bool): If True, a random seed is used.
182
  aspect_ratio (str): The desired aspect ratio of the output image.
@@ -306,11 +306,11 @@ with gr.Blocks(css=css) as demo:
306
  value=8,
307
  )
308
 
309
- gr.Examples(examples=examples, inputs=[prompt], outputs=[result, seed], fn=infer, cache_examples=False)
310
 
311
  gr.on(
312
  triggers=[run_button.click, prompt.submit],
313
- fn=infer,
314
  inputs=[
315
  prompt,
316
  seed,
 
163
 
164
  # --- Main Inference Function (with hardcoded negative prompt) ---
165
  @spaces.GPU(duration=60)
166
+ def generate_image(
167
  prompt,
168
  seed=42,
169
  randomize_seed=False,
 
176
  Generates an image based on a text prompt using the Qwen-Image-Lightning model.
177
 
178
  Args:
179
+ prompt (str): Detailed Prompt that clearly describe your desired image, including subject characteristics, visual style, composition, and spatial relationships. If you want specific text to appear in the image, put it in "quotation marks" and specify where it should be placed (e.g.,top-left corner) and its style. Choose a specific visual style that matches your intent (e.g., realistic photography, watercolor, anime), and keep your prompt under 200 words for best results.
180
  seed (int): The seed for the random number generator for reproducibility.
181
  randomize_seed (bool): If True, a random seed is used.
182
  aspect_ratio (str): The desired aspect ratio of the output image.
 
306
  value=8,
307
  )
308
 
309
+ gr.Examples(examples=examples, inputs=[prompt], outputs=[result, seed], fn=generate_image, cache_examples=False)
310
 
311
  gr.on(
312
  triggers=[run_button.click, prompt.submit],
313
+ fn=generate_image,
314
  inputs=[
315
  prompt,
316
  seed,