Commit Graph

285 Commits

Author SHA1 Message Date
comfyanonymous 0490ce8244 Fix differential diffusion node for batches. 2024-03-04 00:43:09 -05:00
comfyanonymous b2e1744a16 Add a ThresholdMask node. 2024-03-04 00:31:59 -05:00
comfyanonymous 12c1080ebc Simplify differential diffusion code. 2024-03-03 15:34:42 -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 d46583ecec Playground V2.5 support with ModelSamplingContinuousEDM node.
Use ModelSamplingContinuousEDM with edm_playground_v2.5 selected.
2024-02-27 15:12:33 -05:00
comfyanonymous 877a8f7a3c Merge branch 'patch-1' of https://github.com/feffy380/ComfyUI 2024-02-22 16:23:50 -05:00
comfyanonymous 7faa4507ec ModelSamplingDiscrete: x0 model support that predict a denoised image. 2024-02-21 08:05:43 -05:00
feffy380 820807c8ed
Fix Perp-Neg math
adjust perp-neg implementation to match the paper
2024-02-21 10:33:03 +01:00
comfyanonymous a311524969 Node to make stable cascade image to image easier. 2024-02-19 13:36:20 -05:00
comfyanonymous dbe0979b3f Larger range for min/max compression for StableCascade_EmptyLatentImage. 2024-02-19 08:59:53 -05:00
comfyanonymous 8b60d33bb7 Add ModelSamplingStableCascade to control the shift sampling parameter.
shift is 2.0 by default on Stage C and 1.0 by default on Stage B.
2024-02-18 00:55:23 -05:00
comfyanonymous 667c92814e Stable Cascade Stage B. 2024-02-16 13:02:03 -05:00
comfyanonymous 0c9bc19768 Add ImageFromBatch. 2024-02-12 12:46:15 -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
FizzleDorf f2bae7463e
changed default of LatentBatchSeedBehavior to fixed 2024-02-02 18:31:35 +09:00
comfyanonymous 7f4725f6b3 Fix some issues with --gpu-only 2024-01-27 02:51:27 -05:00
comfyanonymous fc196aac80 Add a LatentBatchSeedBehavior node.
This lets you set it so the latents can use the same seed for the sampling
on every image in the batch.
2024-01-26 23:13:02 -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 f2d432f9a7 Fix potential turbo scheduler model patching issue. 2024-01-22 00:28:13 -05:00
comfyanonymous 9fff3c46b4 Move some nodes to model_patches section. 2024-01-18 15:57:35 -05:00
comfyanonymous d76a04b6ea Add unfinished ImageOnlyCheckpointSave node to save a SVD checkpoint.
This node is unfinished, SVD checkpoints saved with this node will
work with ComfyUI but not with anything else.
2024-01-17 19:46:21 -05:00
comfyanonymous d4edd9bfa8 Fix hypertile issue with high depths. 2024-01-11 15:13:38 -05:00
comfyanonymous b4e915e745 Skip SAG when latent is too small. 2024-01-10 04:08:43 -05:00
comfyanonymous 2c80d9acb9 Round up to nearest power of 2 in SAG node to fix some resolution issues. 2024-01-09 15:12:12 -05:00
comfyanonymous 7c9a0f7e0a Fix BasicScheduler issue with Loras. 2024-01-05 12:31:13 -05:00
comfyanonymous 35322a3766 StableZero123_Conditioning_Batched node.
This node lets you generate a batch of images with different elevations or
azimuths by setting the elevation_batch_increment and/or
azimuth_batch_increment.

It also sets the batch index for the latents so that the same init noise is
used on each frame.
2024-01-05 04:20:03 -05:00
comfyanonymous 8c6493578b Implement noise augmentation for SD 4X upscale model. 2024-01-03 14:27:11 -05:00
comfyanonymous ef4f6037cb Fix model patches not working in custom sampling scheduler nodes. 2024-01-03 12:16:30 -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 d1f3637a5a Add a denoise parameter to BasicScheduler node. 2023-12-31 15:37:20 -05:00
comfyanonymous 6781b181ef Fix potential tensor device issue with ImageCompositeMasked. 2023-12-21 02:35:01 -05:00
comfyanonymous 5f54614e7f Add a RebatchImages node. 2023-12-20 16:22:18 -05:00
comfyanonymous e82942cc29 Add a denoise parameter to the SDTurboScheduler. 2023-12-20 02:54:25 -05:00
comfyanonymous 571ea8cdcc Fix SAG not working with cfg 1.0 2023-12-18 17:03:32 -05:00
comfyanonymous d2f322902c Fix wrong Stable Zero123 node name. 2023-12-18 03:59:50 -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
comfyanonymous a036b94075 Move SaveAnimated nodes to image->animation. 2023-12-17 02:37:22 -05:00
comfyanonymous 574efd3782 Fix perpneg not working on SDXL. 2023-12-16 02:30:16 -05:00
comfyanonymous 172984db01 Fix SAG not working on certain resolutions. 2023-12-16 01:29:57 -05:00
comfyanonymous 6596654d47 Add a LatentBatch node. 2023-12-16 01:21:00 -05:00
comfyanonymous adc40e3d7b Forgot this. 2023-12-15 15:46:23 -05:00
comfyanonymous 014c8bf2f2 Refactor LCM to support more model types. 2023-12-15 15:26:12 -05:00
comfyanonymous 9cad2f06ff Make perp neg take a conditioning input instead of a CLIP one. 2023-12-15 14:40:57 -05:00
Hari 574363a8a6 Implement Perp-Neg 2023-12-16 00:28:16 +05:30
comfyanonymous a5056cfb1f Remove useless code. 2023-12-15 01:28:16 -05:00
comfyanonymous b12b48e170 cleanup. 2023-12-14 20:11:46 -05:00
comfyanonymous ba04a87d10 Refactor and improve the sag node.
Moved all the sag related code to comfy_extras/nodes_sag.py
2023-12-13 16:11:26 -05:00
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 cdff081023 Fix hypertile. 2023-12-07 15:22:35 -05:00
asagi4 03eadbb53c Make HyperTile deterministic 2023-12-06 21:17:56 +02:00
comfyanonymous 57d7f4464f Add SDTurboScheduler node. 2023-11-28 13:35:32 -05:00
comfyanonymous f30b992b18 .sigma and .timestep now return tensors on the same device as the input. 2023-11-27 16:41:33 -05:00
comfyanonymous 488de0b4df ModelSamplingDiscreteLCM -> ModelSamplingDiscreteDistilled 2023-11-27 16:32:03 -05:00
comfyanonymous e020ab61f9 Fix output APNG not working with ffmpeg. 2023-11-24 18:24:19 -05:00
comfyanonymous 8ad5d494d5 Fix APNG not working in ffmpeg. 2023-11-24 18:14:17 -05:00
comfyanonymous 916e9c998c Use same default fps as webp node. 2023-11-24 11:19:23 -05:00
comfyanonymous eff24ea6aa Add a node to save animated PNG files. These work in ffpmeg unlike webp. 2023-11-24 11:12:10 -05:00
comfyanonymous 02ffbb2de3 Fix typo. 2023-11-23 23:20:07 -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
comfyanonymous 871cc20e13 Support SVD img2vid model. 2023-11-23 19:41:33 -05:00
comfyanonymous 022033a0e7 Fix SaveAnimatedWEBP not working when metadata is disabled. 2023-11-23 15:39:35 -05:00
comfyanonymous a657f96c5c Add a node to save animated webp. 2023-11-23 14:28:41 -05:00
comfyanonymous c3ae99a749 Allow controlling downscale and upscale methods in PatchModelAddDownscale. 2023-11-22 03:23:16 -05:00
comfyanonymous 31c5ea7b2c Add LatentInterpolate to interpolate between latents. 2023-11-20 03:55:51 -05:00
comfyanonymous dba4f3b4fc Add a RepeatImageBatch node. 2023-11-19 06:09:01 -05:00
comfyanonymous d9d8702d8d percent_to_sigma now returns a float instead of a tensor. 2023-11-18 23:20:29 -05:00
comfyanonymous 8a451234b3 Add ImageCrop node. 2023-11-18 04:44:17 -05:00
comfyanonymous 7e3fe3ad28 Make deep shrink behave like it should. 2023-11-16 15:26:28 -05:00
comfyanonymous bd07ad1861 Add PatchModelAddDownscale (Kohya Deep Shrink) node.
By adding a downscale to the unet in the first timesteps this node lets
you generate images at higher resolutions with less consistency issues.
2023-11-16 13:25:46 -05:00
comfyanonymous dcec1047e6 Invert the start and end percentages in the code.
This doesn't affect how percentages behave in the frontend but breaks
things if you relied on them in the backend.

percent_to_sigma goes from 0 to 1.0 instead of 1.0 to 0 for less confusion.

Make percent 0 return an extremely large sigma and percent 1.0 return a
zero one to fix imprecision.
2023-11-16 04:23:44 -05:00
comfyanonymous 420beeeb05 Clean up and refactor sampler code.
This should make it much easier to write custom nodes with kdiffusion type
samplers.
2023-11-14 00:39:34 -05:00
comfyanonymous 8509bd58b4 Reorganize custom_sampling nodes. 2023-11-13 21:45:23 -05:00
comfyanonymous 61112c81b9 Add a node to flip the sigmas for unsampling. 2023-11-13 21:45:08 -05:00
comfyanonymous ca2812bae0 Fix RescaleCFG for batch size > 1. 2023-11-10 22:05:25 -05:00
comfyanonymous 58d5d71a93 Working RescaleCFG node.
This was broken because of recent changes so I fixed it and moved it from
the experiments repo.
2023-11-10 20:52:10 -05:00
comfyanonymous 002aefa382 Support lcm models.
Use the "lcm" sampler to sample them, you also have to use the
ModelSamplingDiscrete node to set them as lcm models to use them properly.
2023-11-09 18:30:22 -05:00
comfyanonymous ca71e542d2 Lower cfg step to 0.1 in sampler nodes. 2023-11-09 17:35:17 -05:00
comfyanonymous 844dbf97a7 Add: advanced->model->ModelSamplingDiscrete node.
This allows changing the sampling parameters of the model (eps or vpred)
or set the model to use zsnr.
2023-11-07 03:28:53 -05:00
matt3o 4acfc11a80 add difference blend mode 2023-11-05 19:00:23 +01:00
comfyanonymous ee74ef5c9e Increase maximum batch size in LatentRebatch. 2023-11-02 13:07:41 -04:00
tsone 23c5d17837 Added Bayer dithering to Quantize node. 2023-10-31 22:22:40 +01:00
comfyanonymous 1443caf373 HyperTile node, can be found in: _for_testing->HyperTile 2023-10-21 05:16:38 -04:00
comfyanonymous c2bb34d865 Implement updated FreeU as _for_testing->FreeU_V2 node 2023-10-18 02:06:49 -04:00
comfyanonymous f8caa24bcc Support hypernetwork with mish activation function and layer norm. 2023-10-17 12:08:03 -04:00
Jairo Correa b5fa3d28d7 Fix MaskComposite 2023-10-13 13:40:53 -03:00
Jairo Correa 87097a11c3 Fix FeatherMask 2023-10-13 12:26:54 -03:00
comfyanonymous 20d3852aa1 Pull some small changes from the other repo. 2023-10-11 20:38:48 -04:00
comfyanonymous 877553843f Add a CLIPSave node to save CLIP model weights. 2023-10-10 01:24:49 -04:00
comfyanonymous 7bb9f6b7e8 Add a VAESave node. 2023-10-09 01:42:15 -04:00
comfyanonymous c16f5744e3 Fix SplitImageWithAlpha and JoinImageWithAlpha. 2023-10-08 15:52:10 -04:00
comfyanonymous 69a824e9a4 Move _for_testing/custom_sampling nodes to sampling/custom_sampling. 2023-10-08 03:20:35 -04:00
comfyanonymous 0e763e880f JoinImageWithAlpha now works with any mask shape. 2023-10-04 15:54:34 -04:00
comfyanonymous 9212bea87c Change a few things in #1578. 2023-10-04 15:43:41 -04:00
MoonRide303 214ca7197e Corrected joining images with alpha (for RGBA input), and checking scaling conditions 2023-10-04 19:04:52 +02:00
MoonRide303 585fb0475b Adding default alpha when splitting RGB images 2023-10-04 19:04:52 +02:00
MoonRide303 ece69bf28c Change channel type to MASK (reduced redundancy, increased usability) 2023-10-04 19:04:52 +02:00
MoonRide303 d06cd2805d Added support for Porter-Duff image compositing 2023-10-04 19:04:48 +02:00
comfyanonymous 2ef459b1d4 Add VPScheduler node 2023-10-01 03:48:07 -04:00
comfyanonymous 8ab49dc0a4 DPMPP_SDE node. 2023-09-30 01:51:22 -04:00
comfyanonymous 213976f8c3 Add ExponentialScheduler and PolyexponentialScheduler nodes. 2023-09-29 09:05:30 -04:00
Jukka Seppänen 1c8ae9dbb2
Allow GrowMask node to work with batches (for AnimateDiff) (#1623)
* Allow mask batches

This allows LatentCompositeMasked -node to work with AnimateDiff. I tried to keep old functionality too, unsure if it's correct, but both single mask and batch of masks seems to work with this change.

* Update nodes_mask.py
2023-09-28 22:01:19 -04:00
comfyanonymous 66756de100 Add SamplerDPMPP_2M_SDE node. 2023-09-28 21:56:23 -04:00
comfyanonymous 26b7372805 Fix SplitSigmas. 2023-09-28 01:11:22 -04:00
comfyanonymous 76e0f8fc8f Add function to split sigmas. 2023-09-28 00:40:09 -04:00
comfyanonymous 2bf051fda8 Add a basic node to generate sigmas from scheduler. 2023-09-28 00:30:45 -04:00
comfyanonymous d234ca558a Add missing samplers to KSamplerSelect. 2023-09-28 00:17:03 -04:00
comfyanonymous 1d7dfc07d5 Make add_noise in SamplerCustom a boolean. 2023-09-27 22:42:23 -04:00
comfyanonymous 1adcc4c3a2 Add a SamplerCustom Node.
This node takes a list of sigmas and a sampler object as input.

This lets people easily implement custom schedulers and samplers as nodes.

More nodes will be added to it in the future.
2023-09-27 22:21:18 -04:00
comfyanonymous 1d36dfb9fe GrowMask now works with mask batches. 2023-09-26 02:53:57 -04:00
comfyanonymous d76d71de3f GrowMask can now be used with negative numbers to erode it. 2023-09-26 02:45:31 -04:00
comfyanonymous d2cec6cdbf Make mask functions work with batches of masks and images. 2023-09-25 16:19:37 -04:00
comfyanonymous 046b4fe0ee Support batches of masks in mask composite nodes. 2023-09-25 16:02:21 -04:00
comfyanonymous f00471cdc8 Do FreeU fft on CPU if the device doesn't support fft functions. 2023-09-24 18:09:44 -04:00
comfyanonymous 05e661e5ef FreeU now works with the refiner. 2023-09-23 12:19:08 -04:00
comfyanonymous fd93c759e2 Implement FreeU: Free Lunch in Diffusion U-Net node.
_for_testing->FreeU
2023-09-23 00:56:09 -04:00
comfyanonymous 29ccf9f471 Fix typo. 2023-09-22 01:33:46 -04:00
comfyanonymous 422d16c027 Add some nodes to add, subtract and multiply latents. 2023-09-21 22:23:01 -04:00
MoonRide303 2b6b178173 Added support for lanczos scaling 2023-09-19 10:40:38 +02:00
comfyanonymous 0665749b1a Move ModelSubtract and ModelAdd to advanced/model_merging 2023-09-17 02:10:06 -04:00
comfyanonymous 30de95e4b4 Add some nodes to subtract and add model weights. 2023-09-13 01:10:31 -04:00
comfyanonymous 8be46438be Support DiffBIR SwinIR models. 2023-09-07 03:31:43 -04:00
comfyanonymous 766c7b3815 Update upscale model code to latest Chainner model code.
Don't add SRFormer because the code license is incompatible with the GPL.

Remove MAT because it's unused and the license is incompatible with GPL.
2023-09-02 22:27:40 -04:00
comfyanonymous d70b0bc43c Use the GPU for the canny preprocessor when available. 2023-08-29 17:58:40 -04:00
comfyanonymous 81d9200e18 Add node to convert a specific colour in an image to a mask. 2023-08-29 17:55:42 -04:00
comfyanonymous fc99fa56a9 Add node to scale image to a total amount of pixels keeping aspect. 2023-08-18 02:32:39 -04:00
Corey 18e86a4010 add a node to allow growing of masks through dilation 2023-08-16 10:57:14 -04:00
comfyanonymous 6dc02c7bac Add a "resize_source" option to Image and Latent CompositeMasked. 2023-08-15 17:51:52 -04:00
comfyanonymous 94fceb8700 Make Blur node use the image device for processing. 2023-08-14 21:08:45 -04:00
comfyanonymous 8c730dc4a7 Add an ImageCompositeMasked node. 2023-08-12 01:02:36 -04:00
comfyanonymous 1141029a4a Add --disable-metadata argument to disable saving metadata in files. 2023-07-28 12:31:41 -04:00
comfyanonymous 5e3ac1928a Implement modelspec metadata in CheckpointSave for SDXL and refiner. 2023-07-25 22:02:34 -04:00
comfyanonymous a51f33ee49 Use bigger tiles when upscaling with model and fallback on OOM. 2023-07-24 19:47:32 -04:00
comfyanonymous 91ed2815d5 Add a node to merge CLIP models. 2023-07-14 02:41:18 -04:00
comfyanonymous bdba394290 Add a canny preprocessor node. 2023-07-13 13:26:48 -04:00
comfyanonymous a9a4ba7574 Fix merging not working when model2 of model merge node was a merge. 2023-07-08 22:31:10 -04:00
comfyanonymous 2c9d98f3e6 CLIPTextEncodeSDXL now works when prompts are of very different sizes. 2023-07-06 23:23:54 -04:00
comfyanonymous c02f3baeaf Now the model merge blocks node will use the longest match. 2023-07-04 00:51:17 -04:00
comfyanonymous d94ddd8548 Add text encode nodes to control the extra parameters in SDXL. 2023-07-03 19:11:36 -04:00
comfyanonymous 9f2986318f Move model merging nodes to advanced and add to readme. 2023-06-30 15:21:55 -04:00
comfyanonymous 9b93b920be Add CheckpointSave node to save checkpoints.
The created checkpoints contain workflow metadata that can be loaded by
dragging them on top of the UI or loading them with the "Load" button.

Checkpoints will be saved in fp16 or fp32 depending on the format ComfyUI
is using for inference on your hardware. To force fp32 use: --force-fp32

Anything that patches the model weights like merging or loras will be
saved.

The output directory is currently set to: output/checkpoints but that might
change in the future.
2023-06-26 12:22:27 -04:00
comfyanonymous 05676942b7 Add some more transformer hooks and move tomesd to comfy_extras.
Tomesd now uses q instead of x to decide which tokens to merge because
it seems to give better results.
2023-06-24 03:30:22 -04:00
comfyanonymous 51581dbfa9 Fix last commits causing an issue with the text encoder lora. 2023-06-20 19:44:39 -04:00
comfyanonymous bf3f271775 Add some nodes for basic model merging. 2023-06-20 19:17:03 -04:00
comfyanonymous 8883cb0f67 Add a way to set patches that modify the attn2 output.
Change the transformer patches function format to be more future proof.
2023-06-18 22:58:22 -04:00
comfyanonymous f3ac938b4a Round the mask values for bitwise operations. 2023-05-28 00:42:53 -04:00
space-nuko 00646b0813 Bitwise operations for masks 2023-05-27 21:48:49 -05:00
comfyanonymous 7310290f17 Pull in latest upscale model code from chainner. 2023-05-23 22:26:50 -04:00
comfyanonymous 71666f248f Fix padding in Blur. 2023-05-20 10:08:47 -04:00
BlenderNeko 36af98d755 improve sharpen and blur nodes 2023-05-20 15:23:28 +02:00