From e44f18a2c19b32f8e08c280556e8b4ad0d88ef8a Mon Sep 17 00:00:00 2001 From: ssit Date: Fri, 1 Sep 2023 16:06:28 -0400 Subject: [PATCH] Fix for ComfyUI commit 1c012d6 --- README.md | 2 ++ fabric/fabric.py | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fb3a1ae..b8cfe0b 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,8 @@ SD Web UI Extension: https://github.com/dvruette/sd-webui-fabric ## Installation +This has been tested for ComfyUI with commit [c335fdf2000d2e45640c01c4e89ef88c131dda53](https://github.com/comfyanonymous/ComfyUI/commit/7931ff0fd95c1842b0c8e7f5cc3a2ce5d3b88b3b) + Navigate to `ComfyUI/custom_nodes/` and run the following command: ``` git clone https://github.com/ssitu/ComfyUI_fabric diff --git a/fabric/fabric.py b/fabric/fabric.py index b310924..1404f93 100644 --- a/fabric/fabric.py +++ b/fabric/fabric.py @@ -49,7 +49,8 @@ def fabric_sample(model, add_noise, noise_seed, steps, cfg, sampler_name, schedu pos_shape_mismatch = pos_latents.shape[1:] != latent_image['samples'].shape[1:] neg_shape_mismatch = neg_latents.shape[1:] != latent_image['samples'].shape[1:] if pos_shape_mismatch or neg_shape_mismatch: - warnings.warn(f"\n[FABRIC] Latents have different sizes (input: {latent_image['samples'].shape}, pos: {pos_latents.shape}, neg: {neg_latents.shape}). Resizing latents to the same size as input latent. It is recommended to resize the latents beforehand in pixel space or using a model to resize the latent.") + warnings.warn( + f"\n[FABRIC] Latents have different sizes (input: {latent_image['samples'].shape}, pos: {pos_latents.shape}, neg: {neg_latents.shape}). Resizing latents to the same size as input latent. It is recommended to resize the latents beforehand in pixel space or using a model to resize the latent.") if pos_shape_mismatch: pos_latents = comfy.utils.common_upscale( pos_latents, latent_image['samples'].shape[3], latent_image['samples'].shape[2], "bilinear", "center") @@ -197,7 +198,7 @@ def fabric_sample(model, add_noise, noise_seed, steps, cfg, sampler_name, schedu batch_latents = all_zs[a:b] c_null_batch = c_null[a:b] c_null_dict = { - 'c_crossattn': [c_null_batch], + 'c_crossattn': c_null_batch, 'transformer_options': c['transformer_options'] } batch_ts = broadcast_tensor(current_ts, len(batch_latents))