diff --git a/README.md b/README.md index 362b0ed..ac4eaa4 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,13 @@ You can see blurred and broken text after inpainting in the first image and how +## Notes + +Unfortunately, due to the nature of ComfyUI code some nodes are not compatible with these, since we are trying to patch the same ComfyUI's functions. + +List of known uncompartible nodes. + +- [WASasquatch's FreeU_Advanced](https://github.com/WASasquatch/FreeU_Advanced/tree/main) ## Credits diff --git a/brushnet/brushnet.py b/brushnet/brushnet.py index 0d9fb8d..705e02d 100644 --- a/brushnet/brushnet.py +++ b/brushnet/brushnet.py @@ -818,7 +818,7 @@ class BrushNetModel(ModelMixin, ConfigMixin): # 2. pre-process if sample.shape[2] != brushnet_cond.shape[2] or sample.shape[3] != brushnet_cond.shape[3]: - raise Exception("Image and latent should be the same size") + raise Exception("Image "+ str(brushnet_cond.shape) +" and latent " + str(sample.shape) + " should be the same size") brushnet_cond=torch.concat([sample,brushnet_cond],1) sample = self.conv_in_condition(brushnet_cond) diff --git a/brushnet_nodes.py b/brushnet_nodes.py index 94f841a..eddb3f4 100644 --- a/brushnet_nodes.py +++ b/brushnet_nodes.py @@ -254,7 +254,7 @@ class BrushNet: for i, j in output_blocks: add_model_patch(model, apply_brushnet, ('output', i), (j, 'after')) - latent = torch.zeros([1, 4, height // 8, width // 8], device=brushnet['brushnet'].device) + latent = torch.zeros([1, 4, conditioning_latents.shape[2], conditioning_latents.shape[3]], device=brushnet['brushnet'].device) return (model, {"samples":latent},) @@ -324,7 +324,7 @@ class TestNode: -# Unfortunately, ModelPatcher does not have necessary hooks to patch, so we have to patch code instead +# Unfortunately, ModelPatcher does not have necessary hooks to patch, so we have to patch the code instead def modified_forward_timestep_embed(block, x, emb, context=None, transformer_options={}, output_shape=None, time_context=None, num_video_frames=None, image_only_indicator=None):