radames commited on
Commit
b0682bc
1 Parent(s): f419fcc
Files changed (2) hide show
  1. app-img2img.py +2 -2
  2. img2img/index.html +3 -3
app-img2img.py CHANGED
@@ -49,7 +49,7 @@ else:
49
  pipe.set_progress_bar_config(disable=True)
50
  pipe.to(torch_device="cuda", torch_dtype=torch.float32)
51
  pipe.unet.to(memory_format=torch.channels_last)
52
- # pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fullgraph=True)
53
  user_queue_map = {}
54
 
55
  # for torch.compile
@@ -145,7 +145,7 @@ async def stream(user_id: uuid.UUID):
145
  try:
146
  user_queue = user_queue_map[uid]
147
  queue = user_queue["queue"]
148
-
149
  async def generate():
150
  while True:
151
  data = await queue.get()
 
49
  pipe.set_progress_bar_config(disable=True)
50
  pipe.to(torch_device="cuda", torch_dtype=torch.float32)
51
  pipe.unet.to(memory_format=torch.channels_last)
52
+ pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fullgraph=True)
53
  user_queue_map = {}
54
 
55
  # for torch.compile
 
145
  try:
146
  user_queue = user_queue_map[uid]
147
  queue = user_queue["queue"]
148
+
149
  async def generate():
150
  while True:
151
  data = await queue.get()
img2img/index.html CHANGED
@@ -166,12 +166,12 @@
166
  </div>
167
  <main class="container mx-auto px-4 py-4 max-w-4xl flex flex-col gap-4">
168
  <article class="text-center max-w-xl mx-auto">
169
- <h1 class="text-3xl font-bold mb-4">Real-Time Latent Consistency Model</h1>
170
-
171
  <p class="text-sm">
172
  This demo showcases
173
  <a href="https://huggingface.co/SimianLuo/LCM_Dreamshaper_v7" target="_blank"
174
- class="text-blue-500 hover:underline">LCM</a>
175
  using
176
  <a href="https://github.com/huggingface/diffusers/tree/main/examples/community#latent-consistency-pipeline"
177
  target="_blank" class="text-blue-500 hover:underline">Diffusers</a> with a MJPEG
 
166
  </div>
167
  <main class="container mx-auto px-4 py-4 max-w-4xl flex flex-col gap-4">
168
  <article class="text-center max-w-xl mx-auto">
169
+ <h1 class="text-3xl font-bold">Real-Time Latent Consistency Model</h1>
170
+ <h2 class="text-2xl font-bold mb-4">Image to Image</h2>
171
  <p class="text-sm">
172
  This demo showcases
173
  <a href="https://huggingface.co/SimianLuo/LCM_Dreamshaper_v7" target="_blank"
174
+ class="text-blue-500 hover:underline">LCM</a> Image to Image pipeline
175
  using
176
  <a href="https://github.com/huggingface/diffusers/tree/main/examples/community#latent-consistency-pipeline"
177
  target="_blank" class="text-blue-500 hover:underline">Diffusers</a> with a MJPEG