daniel-dona commited on
Commit
60ddd89
·
verified ·
1 Parent(s): 120e997

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -109,15 +109,20 @@ def infer(
109
  num_inference_steps=50,
110
  progress=gr.Progress(track_tqdm=True),
111
  ):
 
 
112
 
113
  seed = sanitize_seed(seed)
114
 
115
  if seed == -1:
116
  seed = random.randint(0, MAX_SEED)
117
-
118
- width, height = aspect_ratios[aspect_ratio]
 
 
 
 
119
 
120
- print(f"Generating for prompt: \n\t{prompt}\n\t{seed}\n\t{aspect_ratio}\n\t{num_inference_steps}")
121
 
122
  image = pipe(
123
  prompt=prompt,
 
109
  num_inference_steps=50,
110
  progress=gr.Progress(track_tqdm=True),
111
  ):
112
+
113
+ print(f"Generating for prompt: \n\t{prompt}\n\t{seed}\n\t{aspect_ratio}\n\t{num_inference_steps}")
114
 
115
  seed = sanitize_seed(seed)
116
 
117
  if seed == -1:
118
  seed = random.randint(0, MAX_SEED)
119
+
120
+ try:
121
+ width, height = aspect_ratios[aspect_ratio]
122
+ except:
123
+ width, height = (640, 480)
124
+
125
 
 
126
 
127
  image = pipe(
128
  prompt=prompt,