mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-05-25 16:37:23 +08:00
Compare commits
5 Commits
6849438789
...
d8bdb5e41d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d8bdb5e41d | ||
|
|
6bcd8b96ab | ||
|
|
9c34f5f36a | ||
|
|
0388ac4309 | ||
|
|
2beca418ad |
@ -1006,8 +1006,19 @@ class CFGGuider:
|
||||
return latent_image
|
||||
|
||||
if latent_image.is_nested:
|
||||
latent_image, latent_shapes = comfy.utils.pack_latents(latent_image.unbind())
|
||||
noise, _ = comfy.utils.pack_latents(noise.unbind())
|
||||
li_tensors = latent_image.unbind()
|
||||
if noise.is_nested:
|
||||
# Truncate extra noise components, pad missing ones with zeros
|
||||
n_tensors = list(noise.unbind()[:len(li_tensors)])
|
||||
for i in range(len(n_tensors), len(li_tensors)):
|
||||
n_tensors.append(torch.zeros_like(li_tensors[i]))
|
||||
else:
|
||||
# Noise only covers video -- pad remaining components (audio) with zeros
|
||||
n_tensors = [noise]
|
||||
for i in range(1, len(li_tensors)):
|
||||
n_tensors.append(torch.zeros_like(li_tensors[i]))
|
||||
latent_image, latent_shapes = comfy.utils.pack_latents(li_tensors)
|
||||
noise, _ = comfy.utils.pack_latents(n_tensors)
|
||||
else:
|
||||
latent_shapes = [latent_image.shape]
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
comfyui-frontend-package==1.42.15
|
||||
comfyui-frontend-package==1.43.17
|
||||
comfyui-workflow-templates==0.9.69
|
||||
comfyui-embedded-docs==0.4.4
|
||||
torch
|
||||
|
||||
@ -560,7 +560,7 @@ class PromptServer():
|
||||
buffer.seek(0)
|
||||
|
||||
return web.Response(body=buffer.read(), content_type=f'image/{image_format}',
|
||||
headers={"Content-Disposition": f"attachment; filename=\"{filename}\""})
|
||||
headers={"Content-Disposition": f"filename=\"{filename}\""})
|
||||
|
||||
if 'channel' not in request.rel_url.query:
|
||||
channel = 'rgba'
|
||||
@ -580,7 +580,7 @@ class PromptServer():
|
||||
buffer.seek(0)
|
||||
|
||||
return web.Response(body=buffer.read(), content_type='image/png',
|
||||
headers={"Content-Disposition": f"attachment; filename=\"{filename}\""})
|
||||
headers={"Content-Disposition": f"filename=\"{filename}\""})
|
||||
|
||||
elif channel == 'a':
|
||||
with Image.open(file) as img:
|
||||
@ -597,7 +597,7 @@ class PromptServer():
|
||||
alpha_buffer.seek(0)
|
||||
|
||||
return web.Response(body=alpha_buffer.read(), content_type='image/png',
|
||||
headers={"Content-Disposition": f"attachment; filename=\"{filename}\""})
|
||||
headers={"Content-Disposition": f"filename=\"{filename}\""})
|
||||
else:
|
||||
# Use the content type from asset resolution if available,
|
||||
# otherwise guess from the filename.
|
||||
@ -614,7 +614,7 @@ class PromptServer():
|
||||
return web.FileResponse(
|
||||
file,
|
||||
headers={
|
||||
"Content-Disposition": f"attachment; filename=\"{filename}\"",
|
||||
"Content-Disposition": f"filename=\"{filename}\"",
|
||||
"Content-Type": content_type
|
||||
}
|
||||
)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user