KingNish commited on
Commit
c322453
·
verified ·
1 Parent(s): 10a3e2d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -1
app.py CHANGED
@@ -17,7 +17,16 @@ MAX_SEED = np.iinfo(np.int32).max
17
  MAX_IMAGE_SIZE = 4096
18
 
19
  @spaces.GPU(duration=120,queue=False)
20
- def infer(prompt, negative_prompt, seed, randomize_seed, width, height, guidance_scale, num_inference_steps, progress=gr.Progress(track_tqdm=True)):
 
 
 
 
 
 
 
 
 
21
  if randomize_seed:
22
  seed = random.randint(0, MAX_SEED)
23
  generator = torch.Generator().manual_seed(seed)
@@ -126,6 +135,9 @@ with gr.Blocks(title="SDXL Flash", css=css) as demo:
126
  gr.Examples(
127
  examples = examples,
128
  inputs = prompt,
 
 
 
129
  )
130
 
131
  run_button.click(
 
17
  MAX_IMAGE_SIZE = 4096
18
 
19
  @spaces.GPU(duration=120,queue=False)
20
+ def infer(
21
+ prompt: str,
22
+ negative_prompt: str = "",
23
+ seed: int = 24,
24
+ randomize_seed: bool = False,
25
+ width: int = 1024,
26
+ height: int = 1024,
27
+ guidance_scale = 3,
28
+ num_inference_steps: int = 9,
29
+ progress=gr.Progress(track_tqdm=True)):
30
  if randomize_seed:
31
  seed = random.randint(0, MAX_SEED)
32
  generator = torch.Generator().manual_seed(seed)
 
135
  gr.Examples(
136
  examples = examples,
137
  inputs = prompt,
138
+ outputs = result,
139
+ fn=infer,
140
+ cache_examples=True
141
  )
142
 
143
  run_button.click(