Re-enable user history

#11
by Wauplin HF staff - opened
Files changed (2) hide show
  1. README.md +1 -0
  2. app.py +8 -11
README.md CHANGED
@@ -8,6 +8,7 @@ sdk_version: 3.44.2
8
  app_file: app.py
9
  pinned: false
10
  license: mit
 
11
  ---
12
 
13
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
8
  app_file: app.py
9
  pinned: false
10
  license: mit
11
+ hf_oauth: true
12
  ---
13
 
14
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
app.py CHANGED
@@ -10,7 +10,7 @@ from diffusers import WuerstchenDecoderPipeline, WuerstchenPriorPipeline
10
  from diffusers.pipelines.wuerstchen import DEFAULT_STAGE_C_TIMESTEPS
11
  from previewer.modules import Previewer
12
 
13
- #from gallery_history import fetch_gallery_history, show_gallery_history
14
 
15
  os.environ['TOKENIZERS_PARALLELISM'] = 'false'
16
 
@@ -213,7 +213,7 @@ with gr.Blocks(css="style.css") as demo:
213
  cache_examples=CACHE_EXAMPLES,
214
  )
215
 
216
- #history = show_gallery_history()
217
 
218
  inputs = [
219
  prompt,
@@ -240,10 +240,9 @@ with gr.Blocks(css="style.css") as demo:
240
  inputs=inputs,
241
  outputs=result,
242
  api_name="run",
 
 
243
  )
244
- #.then(
245
- # fn=fetch_gallery_history, inputs=[prompt, result], outputs=history
246
- #)
247
  negative_prompt.submit(
248
  fn=randomize_seed_fn,
249
  inputs=[seed, randomize_seed],
@@ -255,10 +254,9 @@ with gr.Blocks(css="style.css") as demo:
255
  inputs=inputs,
256
  outputs=result,
257
  api_name=False,
 
 
258
  )
259
- #.then(
260
- # fn=fetch_gallery_history, inputs=[prompt, result], outputs=history
261
- #)
262
  run_button.click(
263
  fn=randomize_seed_fn,
264
  inputs=[seed, randomize_seed],
@@ -270,10 +268,9 @@ with gr.Blocks(css="style.css") as demo:
270
  inputs=inputs,
271
  outputs=result,
272
  api_name=False,
 
 
273
  )
274
- #.then(
275
- # fn=fetch_gallery_history, inputs=[prompt, result], outputs=history
276
- #)
277
 
278
  if __name__ == "__main__":
279
  demo.queue(max_size=20).launch()
 
10
  from diffusers.pipelines.wuerstchen import DEFAULT_STAGE_C_TIMESTEPS
11
  from previewer.modules import Previewer
12
 
13
+ from gallery_history import fetch_gallery_history, show_gallery_history
14
 
15
  os.environ['TOKENIZERS_PARALLELISM'] = 'false'
16
 
 
213
  cache_examples=CACHE_EXAMPLES,
214
  )
215
 
216
+ history = show_gallery_history()
217
 
218
  inputs = [
219
  prompt,
 
240
  inputs=inputs,
241
  outputs=result,
242
  api_name="run",
243
+ ).then(
244
+ fn=fetch_gallery_history, inputs=[prompt, result], outputs=history
245
  )
 
 
 
246
  negative_prompt.submit(
247
  fn=randomize_seed_fn,
248
  inputs=[seed, randomize_seed],
 
254
  inputs=inputs,
255
  outputs=result,
256
  api_name=False,
257
+ ).then(
258
+ fn=fetch_gallery_history, inputs=[prompt, result], outputs=history
259
  )
 
 
 
260
  run_button.click(
261
  fn=randomize_seed_fn,
262
  inputs=[seed, randomize_seed],
 
268
  inputs=inputs,
269
  outputs=result,
270
  api_name=False,
271
+ ).then(
272
+ fn=fetch_gallery_history, inputs=[prompt, result], outputs=history
273
  )
 
 
 
274
 
275
  if __name__ == "__main__":
276
  demo.queue(max_size=20).launch()