Commit Graph

329 Commits

Author SHA1 Message Date
shawnington 22edd3add5
Fix to LoadImage Node for #3416 HDR images loading additional smaller… (#3454)
* Fix to LoadImage Node for #3416 HDR images loading additional smaller images. 

Added a blocking if statement  in the ImageSequence.Iterator that checks if subsequent images after the first match dimensionally, and prevent them from being appended to output_images if they do not match. 

This does not fix or change current behavior for PIL 10.2.0 where the images are loaded at the same size, but it does for 10.3.0 where they are loaded at their correct smaller sizes.

* added list of excluded formats that should return 1 image

added an explicit check for the image format so that additional formats can be added to the list that have problematic behavior.
2024-05-12 07:07:38 -04:00
shawnington 0fecfd2b1a
Added generic wrapper function node_helpers.pillow to fix PIL issues #4472 and #2445 (#3422)
* Update node_helpers.py to use generic pillow wrapper to resolve multiple meta-data related issues.

replaced open_image function with a generic pillow function that takes Pil functions as a dependency injection and applies the ImageFile.LOAD_TRUNCATED_IMAGES try except fix to them. 

This provides an extensible function to handle related errors that can wrap offending functions when discovered without the need to repeat code.

* Update a few Pil functions to use node_helpers.pillow wrapper

Update a Pil function calls in a few locations to use the generic node_helpers.pillow wrapper that takes the function as a dependency injection and uses the try except method with ImageFIle.LOAD_TRUNCATED_IMAGES solution

* Corrected comment in issue #s fixed.

* Update node_helpers.py to remove import of Image from PIL

import of Image is no longer required as functions are Injected
2024-05-09 05:38:00 -04:00
comfyanonymous c33412288f Fix issue with loading some JPG: #3416 2024-05-07 05:41:06 -04:00
shawnington 0d45efb7d6
Fixed Issue with LoadImage node when loading PNG files with embedded ICC profiles. (#3316)
* Fix issue with how PIL loads small PNG files nodes.py

Added flag to prevent ValueError: Decompressed Data Too Large
when loading PNG images with large meta data such as large embedded color profiles

* Update LoadImage node to fix error when loading PNG's in nodes.py

Fixed Value Error: Decompressed Data Too Large thrown by PIL when attempting to opening PNG files with large embedded ICC colorspaces by setting the follow flag to true when loading png images:  ImageFile.LOAD_TRUNCATED_IMAGES = True

* Update node_helpers.py to include open_image helper function

open_image includes try except to catch Pillow Value Errors that occur when large ICC profiles are embedded in images.

* Update LoadImage node to use open_image helper function inplace of Image.open

open_image helper function in node_helpers.py  fixes a Pillow error when attempting to open images with large embedded ICC profiles by adding an exception handler to load the image with truncated meta data if regular loading is not possible.
2024-05-04 03:32:41 -04:00
comfyanonymous eecd69b53a Add a SamplerLCMUpscale node.
This sampler is an LCM sampler that upscales the latent during sampling.

It can be used to generate at a higher resolution with an LCM model very
quickly.

To try it use it with a basic 5 step LCM workflow with scale_ratio 1.5 or
2.0
2024-04-29 20:00:47 -04:00
comfyanonymous 059773a6df Add some nodes to multiply the attention in UNet and Clip models. 2024-04-28 13:03:43 -04:00
comfyanonymous 27d5808fc4 Increase max lora strength to 100.0 2024-04-23 13:07:39 -04:00
comfyanonymous 644a3ae58d Implement Align Your Steps as a AlignYourStepsScheduler node. 2024-04-20 04:34:12 -04:00
comfyanonymous 719fb2c81d Add basic PAG node. 2024-04-14 23:49:50 -04:00
comfyanonymous 744ac944db Don't make dynamicPrompts the default on multiline string inputs.
This should be less confusing to those who want to use multiline input
without them.
2024-04-13 16:18:00 -04:00
comfyanonymous 4201181b35 Add ModelMergeSD1, ModelMergeSD2 and ModelMergeSDXL. 2024-04-09 04:31:14 -04:00
comfyanonymous d644b6bcd8 Cleanup some more conditioning nodes. 2024-04-07 14:40:43 -04:00
comfyanonymous 80bda6c163 Cleanup a few conditioning nodes. 2024-04-07 14:27:40 -04:00
comfyanonymous 1f8d8e6c77 Add InstructPixToPixConditioning node. 2024-04-04 15:06:17 -04:00
comfyanonymous 96b4c757cf Add log to debug custom nodes that hang when imported. 2024-03-30 11:52:11 -04:00
comfyanonymous 11838e60f4 Increase the max resolution. 2024-03-26 04:00:53 -04:00
comfyanonymous d14bdb1896 Revert, NOTE: this will be removed again soon please fix your nodes. 2024-03-19 11:17:49 -04:00
comfyanonymous 0c55f16c9e Remove code that should be useless now. 2024-03-19 09:47:14 -04:00
comfyanonymous 2a813c3b09 Switch some more prints to logging. 2024-03-11 16:34:58 -04:00
comfyanonymous 0ed72befe1 Change log levels.
Logging level now defaults to info. --verbose sets it to debug.
2024-03-11 13:54:56 -04:00
comfyanonymous 03f4cfb7cd Replace more prints with logging. 2024-03-11 00:58:49 -04:00
comfyanonymous 0a4675266e Make message about missing dependencies more clear. 2024-03-08 18:43:13 -05:00
comfyanonymous a38b9b3ac1 Add debugging info for when comfy_extra nodes fail to import. 2024-03-04 13:24:08 -05:00
Dmytro Mishkin 6d8834f08f
Add Morphology nodes from kornia (#2781)
* import kornia

* Added morphology nodexs

* Add kornia to requirements

* fix choices

* options, also move to postprocessors

* fix placing and step
2024-03-04 12:50:28 -05:00
Shiimizu 727021bdea
Implement Differential Diffusion (#2876)
* Implement Differential Diffusion

* Cleanup.

* Fix.

* Masks should be applied at full strength.

* Fix colors.

* Register the node.

* Cleaner code.

* Fix issue with getting unipc sampler.

* Adjust thresholds.

* Switch to linear thresholds.

* Only calculate nearest_idx on valid thresholds.
2024-03-03 15:34:13 -05:00
comfyanonymous c2cb8e889b Always return unprojected pooled output for gligen. 2024-02-25 07:33:13 -05:00
comfyanonymous 3b2e579926 Support loading the Stable Cascade effnet and previewer as a VAE.
The effnet can be used to encode images for img2img with Stage C.
2024-02-19 04:10:01 -05:00
comfyanonymous 97d03ae04a StableCascade CLIP model support. 2024-02-16 13:29:04 -05:00
comfyanonymous 667c92814e Stable Cascade Stage B. 2024-02-16 13:02:03 -05:00
comfyanonymous c2c885261a Merge branch 'batch-number-in-filename' of https://github.com/freakabcd/ComfyUI 2024-02-16 05:45:48 -05:00
comfyanonymous 20e3da6b31 Add a node to give the controlnet a prompt different from the unet. 2024-02-10 08:27:05 -05:00
Imran Azeez 2ccc0be28f Add batch number to filename with %batch_num%
Allow configurable addition of batch number to output file name.
2024-02-08 22:03:11 +10:00
comfyanonymous 9321198da6 Add node to set only the conditioning area strength. 2024-01-29 00:24:53 -05:00
comfyanonymous d1533d9c0f Add experimental photomaker nodes.
Put the model file in models/photomaker and use PhotoMakerLoader.

Then use PhotoMakerEncode with the keyword "photomaker" to apply the image
2024-01-24 09:51:42 -05:00
comfyanonymous 10f2609fdd Add InpaintModelConditioning node.
This is an alternative to VAE Encode for inpaint that should work with
lower denoise.

This is a different take on #2501
2024-01-11 03:15:27 -05:00
comfyanonymous b3b5ddb07a Support I mode images in LoadImageMask. 2024-01-08 17:08:17 -05:00
comfyanonymous 6a10640f0d Support properly loading images with mode I. 2024-01-08 03:46:36 -05:00
comfyanonymous a7874d1a8b Add support for the stable diffusion x4 upscaling model.
This is an old model.

Load the checkpoint like a regular one and use the new
SD_4XUpscale_Conditioning node.
2024-01-03 03:37:56 -05:00
comfyanonymous 04b713dda1 Fix VALIDATE_INPUTS getting called multiple times.
Allow VALIDATE_INPUTS to only validate specific inputs.
2023-12-29 17:36:40 -05:00
comfyanonymous a1e1c69f7d LoadImage now loads all the frames from animated images as a batch. 2023-12-20 16:39:09 -05:00
comfyanonymous 2258f85159 Support stable zero 123 model.
To use it use the ImageOnlyCheckpointLoader to load the checkpoint and
the new Stable_Zero123 node.
2023-12-18 03:48:04 -05:00
Hari 574363a8a6 Implement Perp-Neg 2023-12-16 00:28:16 +05:30
Rafie Walker 6761233e9d
Implement Self-Attention Guidance (#2201)
* First SAG test

* need to put extra options on the model instead of patcher

* no errors and results seem not-broken

* Use @ashen-uncensored formula, which works better!!!

* Fix a crash when using weird resolutions. Remove an unnecessary UNet call

* Improve comments, optimize memory in blur routine

* SAG works with sampler_cfg_function
2023-12-13 15:52:11 -05:00
comfyanonymous 9ac0b487ac Make --gpu-only put intermediate values in GPU memory instead of cpu. 2023-12-08 02:35:45 -05:00
comfyanonymous d19de2753e Merge branch 'fix_folders_handling' of https://github.com/fazo96/ComfyUI 2023-11-29 14:10:30 -05:00
comfyanonymous 798a34d009 Lower compress level for image preview. 2023-11-28 04:57:59 -05:00
comfyanonymous 5b37270d3a Add a lora loader node for models with no CLIP. 2023-11-25 02:26:50 -05:00
comfyanonymous 42dfae6331 Nodes to properly use the SDV img2vid checkpoint.
The img2vid model is conditioned on clip vision output only which means
there's no CLIP model which is why I added a ImageOnlyCheckpointLoader to
load it. Note that the unClipCheckpointLoader can also load it because it
also has a CLIP_VISION output.

SDV_img2vid_Conditioning is the node used to pass the right conditioning
to the img2vid model.

VideoLinearCFGGuidance applies a linearly decreasing CFG scale to each
video frame from the cfg set in the sampler node to min_cfg.

SDV_img2vid_Conditioning can be found in conditioning->video_models
ImageOnlyCheckpointLoader can be found in loaders->video_models
VideoLinearCFGGuidance can be found in sampling->video_models
2023-11-23 19:48:49 -05:00
Enrico Fasoli 1964bf1e78 fix: folder handling issues 2023-11-23 22:24:58 +01:00
comfyanonymous cd4fc77d5f Add taesd and taesdxl to VAELoader node.
They will show up if both the taesd_encoder and taesd_decoder or taesdxl
model files are present in the models/vae_approx directory.
2023-11-21 12:54:19 -05:00