mirror of
https://github.com/Comfy-Org/ComfyUI.git
synced 2026-08-25 10:22:12 +08:00
Allow regular single image Empty Latent Image node to be used with H3. (#15677)
This commit is contained in:
@@ -45,7 +45,7 @@ def prepare_empty_noise(latent_image):
|
||||
def fix_empty_latent_channels(model, latent_image, downscale_ratio_spacial=None, downscale_ratio_temporal=None):
|
||||
if latent_image.is_nested:
|
||||
return latent_image
|
||||
latent_format = model.get_model_object("latent_format") #Resize the empty latent image so it has the right number of channels
|
||||
latent_format = model.get_model_object("latent_format")
|
||||
is_empty = torch.count_nonzero(latent_image) == 0
|
||||
if is_empty:
|
||||
if latent_format.latent_channels != latent_image.shape[1]:
|
||||
@@ -64,6 +64,9 @@ def fix_empty_latent_channels(model, latent_image, downscale_ratio_spacial=None,
|
||||
new_t = max(1, round(latent_image.shape[2] * ratio))
|
||||
latent_image = comfy.utils.repeat_to_batch_size(latent_image, new_t, dim=2)
|
||||
|
||||
if is_empty:
|
||||
latent_image = latent_format.fix_empty_latent(latent_image)
|
||||
|
||||
return latent_image
|
||||
|
||||
def prepare_sampling(model, noise_shape, positive, negative, noise_mask):
|
||||
|
||||
Reference in New Issue
Block a user