ComfyUI/comfy
Jedrzej Kosinski e4f7ea105f
Added context window support to core sampling code (#9238)
* Added initial support for basic context windows - in progress

* Add prepare_sampling wrapper for context window to more accurately estimate latent memory requirements, fixed merging wrappers/callbacks dicts in prepare_model_patcher

* Made context windows compatible with different dimensions; works for WAN, but results are bad

* Fix comfy.patcher_extension.merge_nested_dicts calls in prepare_model_patcher in sampler_helpers.py

* Considering adding some callbacks to context window code to allow extensions of behavior without the need to rewrite code

* Made dim slicing cleaner

* Add Wan Context WIndows node for testing

* Made context schedule and fuse method functions be stored on the handler instead of needing to be registered in core code to be found

* Moved some code around between node_context_windows.py and context_windows.py

* Change manual context window nodes names/ids

* Added callbacks to IndexListContexHandler

* Adjusted default values for context_length and context_overlap, made schema.inputs definition for WAN Context Windows less annoying

* Make get_resized_cond more robust for various dim sizes

* Fix typo

* Another small fix
2025-08-13 21:33:05 -04:00
..
cldm Replace print with logging (#6138) 2024-12-20 16:24:55 -05:00
comfy_types LoRA Trainer: LoRA training node in weight adapter scheme (#8446) 2025-06-13 19:25:59 -04:00
extra_samplers Uni pc sampler now works with audio and video models. 2025-01-18 05:27:58 -05:00
image_encoders Fix for dino lowvram. (#7748) 2025-04-23 04:12:52 -04:00
k_diffusion Separate denoised and noise estimation in Euler CFG++ (#9008) 2025-07-23 19:47:05 -04:00
ldm Make last PR not crash comfy on old pytorch. (#9324) 2025-08-13 15:12:41 -04:00
sd1_tokenizer Silence clip tokenizer warning. (#8934) 2025-07-16 14:42:07 -04:00
t2i_adapter Controlnet refactor. 2024-06-27 18:43:11 -04:00
taesd Improvements to the TAESD3 implementation. 2024-06-16 02:04:24 -04:00
text_encoders Initial support for qwen image model. (#9179) 2025-08-04 22:53:25 -04:00
weight_adapter Fixed an issue where qwenLora could not be loaded properly. (#9208) 2025-08-06 13:23:11 -04:00
checkpoint_pickle.py Remove pytorch_lightning dependency. 2023-06-13 10:11:33 -04:00
cli_args.py Fix XPU iGPU regressions (#9322) 2025-08-13 19:13:35 -04:00
clip_config_bigg.json Fix potential issue with non clip text embeddings. 2024-07-30 14:41:13 -04:00
clip_model.py Support llava clip vision model. 2025-03-06 00:24:43 -05:00
clip_vision_config_g.json Add support for clip g vision model to CLIPVisionLoader. 2023-08-18 11:13:29 -04:00
clip_vision_config_h.json Add support for unCLIP SD2.x models. 2023-04-01 23:19:15 -04:00
clip_vision_config_vitl_336_llava.json Support llava clip vision model. 2025-03-06 00:24:43 -05:00
clip_vision_config_vitl_336.json support clip-vit-large-patch14-336 (#4042) 2024-07-17 13:12:50 -04:00
clip_vision_config_vitl.json Add support for unCLIP SD2.x models. 2023-04-01 23:19:15 -04:00
clip_vision_siglip_384.json Support new flux model variants. 2024-11-21 08:38:23 -05:00
clip_vision_siglip_512.json Support 512 siglip model. 2025-04-05 07:01:01 -04:00
clip_vision.py throw away alpha channel in clip vision preprocessor (#7769) 2025-04-23 21:28:36 -04:00
conds.py Add some warnings and prevent crash when cond devices don't match. (#9169) 2025-08-04 04:20:12 -04:00
context_windows.py Added context window support to core sampling code (#9238) 2025-08-13 21:33:05 -04:00
controlnet.py Fix broken controlnet from last PR. (#9167) 2025-08-04 03:28:12 -04:00
diffusers_convert.py Remove useless code. 2025-01-24 06:15:54 -05:00
diffusers_load.py load_unet -> load_diffusion_model with a model_options argument. 2024-08-12 23:20:57 -04:00
float.py Clamp output when rounding weight to prevent Nan. 2024-10-19 19:07:10 -04:00
gligen.py Remove some useless code. (#8812) 2025-07-06 07:07:39 -04:00
hooks.py Hooks Part 2 - TransformerOptionsHook and AdditionalModelsHook (#6377) 2025-01-11 12:20:23 -05:00
latent_formats.py Wan 2.2 support. (#9080) 2025-07-28 08:00:23 -04:00
lora_convert.py Support the wan fun reward loras. 2025-04-07 05:01:47 -04:00
lora.py Support SimpleTuner lycoris lora for Qwen-Image (#9280) 2025-08-11 16:56:16 -04:00
model_base.py Wan2.2 fun control support. (#9292) 2025-08-12 23:26:33 -04:00
model_detection.py Wan2.2 fun control support. (#9292) 2025-08-12 23:26:33 -04:00
model_management.py Fix XPU iGPU regressions (#9322) 2025-08-13 19:13:35 -04:00
model_patcher.py Initial code for new SLG node (#8759) 2025-07-02 20:13:43 -04:00
model_sampling.py Basic initial support for cosmos predict2 text to image 2B and 14B models. (#8517) 2025-06-13 07:05:23 -04:00
ops.py Make last PR not crash comfy on old pytorch. (#9324) 2025-08-13 15:12:41 -04:00
options.py Only parse command line args when main.py is called. 2023-09-13 11:38:20 -04:00
patcher_extension.py Add prepare_sampling wrapper allowing custom nodes to more accurately report noise_shape (#7500) 2025-04-09 09:43:35 -04:00
rmsnorm.py Fix issue with old pytorch RMSNorm. (#8095) 2025-05-13 07:54:28 -04:00
sample.py Auto reshape 2d to 3d latent for single image generation on video model. 2024-12-29 02:26:49 -05:00
sampler_helpers.py Added context window support to core sampling code (#9238) 2025-08-13 21:33:05 -04:00
samplers.py Added context window support to core sampling code (#9238) 2025-08-13 21:33:05 -04:00
sd1_clip_config.json Fix potential issue with non clip text embeddings. 2024-07-30 14:41:13 -04:00
sd1_clip.py Omnigen2 model implementation. (#8669) 2025-06-25 19:35:57 -04:00
sd.py Initial support for qwen image model. (#9179) 2025-08-04 22:53:25 -04:00
sdxl_clip.py Add a T5TokenizerOptions node to set options for the T5 tokenizer. (#7803) 2025-04-25 19:36:00 -04:00
supported_models_base.py Mixed precision diffusion models with scaled fp8. 2024-10-21 18:12:51 -04:00
supported_models.py Fix default shift and any latent size for qwen image model. (#9186) 2025-08-05 06:12:27 -04:00
utils.py Add WAN ATI support (#8874) 2025-07-24 20:59:19 -04:00