concauu commited on
Commit
c53b6cb
·
verified ·
1 Parent(s): 283e092

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -11
app.py CHANGED
@@ -78,20 +78,19 @@ def generate_image(prompt):
78
  """Generates an image using the refined prompt."""
79
  # truncated_prompt = truncate_prompt(prompt)
80
  try:
81
- # image = pipe(
82
- # truncated_prompt,
83
- # height=1024,
84
- # width=1024,
85
- # guidance_scale=3.5,
86
- # num_inference_steps=50,
87
- # max_sequence_length=512,
88
- # generator=torch.Generator("cpu").manual_seed(0)
89
- image = pipe(truncated_prompt).images[0]
90
- # ).images[0]
91
  except Exception as e:
92
  # Optionally, handle errors (you can also return a default error image)
93
  image = None
94
- print("No image")
95
  return image
96
 
97
  with gr.Blocks(css=".gradio-container {background-color: #f9f9f9; padding: 20px;}") as demo:
 
78
  """Generates an image using the refined prompt."""
79
  # truncated_prompt = truncate_prompt(prompt)
80
  try:
81
+ image = pipe(
82
+ prompt,
83
+ height=1024,
84
+ width=1024,
85
+ guidance_scale=3.5,
86
+ num_inference_steps=50,
87
+ max_sequence_length=512,
88
+ generator=torch.Generator("cpu").manual_seed(0)
89
+ ).images[0]
 
90
  except Exception as e:
91
  # Optionally, handle errors (you can also return a default error image)
92
  image = None
93
+ print(e)
94
  return image
95
 
96
  with gr.Blocks(css=".gradio-container {background-color: #f9f9f9; padding: 20px;}") as demo: