Kano001 commited on
Commit
c44ec11
1 Parent(s): 6f801f2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -19,12 +19,13 @@ from optimum.intel.openvino.modeling_diffusion import OVModelVaeDecoder, OVBaseM
19
 
20
  import os
21
  from tqdm import tqdm
 
22
 
23
  from concurrent.futures import ThreadPoolExecutor
24
  import uuid
25
 
26
  DESCRIPTION = '''# Latent Consistency Model OpenVino CPU
27
- Based on [Latency Consistency Model](https://huggingface.co/spaces/SimianLuo/Latent_Consistency_Model) HF space
28
 
29
  <p>Running on CPU 🥶.</p>
30
  '''
@@ -63,6 +64,7 @@ def randomize_seed_fn(seed: int, randomize_seed: bool) -> int:
63
  def save_image(img, profile: gr.OAuthProfile | None, metadata: dict):
64
  unique_name = str(uuid.uuid4()) + '.png'
65
  img.save(unique_name)
 
66
  return unique_name
67
 
68
  def save_images(image_array, profile: gr.OAuthProfile | None, metadata: dict):
@@ -153,6 +155,9 @@ with gr.Blocks(css="style.css") as demo:
153
  step=1,
154
  value=4,
155
  )
 
 
 
156
 
157
  gr.Examples(
158
  examples=examples,
 
19
 
20
  import os
21
  from tqdm import tqdm
22
+ import gradio_user_history as gr_user_history
23
 
24
  from concurrent.futures import ThreadPoolExecutor
25
  import uuid
26
 
27
  DESCRIPTION = '''# Latent Consistency Model OpenVino CPU
28
+ Based on [Latency Consistency Model](https://huggingface.co/spaces/SimianLuo/Latent_Consistency_Model) HF space
29
 
30
  <p>Running on CPU 🥶.</p>
31
  '''
 
64
  def save_image(img, profile: gr.OAuthProfile | None, metadata: dict):
65
  unique_name = str(uuid.uuid4()) + '.png'
66
  img.save(unique_name)
67
+ gr_user_history.save_image(label=metadata["prompt"], image=img, profile=profile, metadata=metadata)
68
  return unique_name
69
 
70
  def save_images(image_array, profile: gr.OAuthProfile | None, metadata: dict):
 
155
  step=1,
156
  value=4,
157
  )
158
+
159
+ #with gr.Accordion("Past generations", open=False):
160
+ #gr_user_history.render()
161
 
162
  gr.Examples(
163
  examples=examples,