Jedrzej Kosinski and Amp
8c277d92bd
fix: update cast_bias_weight usage and fix motion model dtype loading
...
- Fix #572 : Use offloadable=True with cast_bias_weight in groupnorm_mm_forward
to match ComfyUI's updated 3-return-value API, and call uncast_bias_weight
after use for proper async-offload support.
- Fix #569 : Move .to(dtype) call after load_state_dict across all model loading
functions. Previously, the dtype cast was done before load_state_dict, which
overwrote weights with the original float32 values from disk, causing Half vs
Float mismatches at runtime when the UNet runs in float16. Affected functions:
load_motion_module_gen1, load_motion_module_gen2, create_fresh_motion_module,
create_fresh_encoder_only_model, inject_img_encoder_into_model,
inject_pia_conv_in_into_model, inject_camera_encoder_into_model,
load_hmreferenceadapter.
Co-authored-by: Amp <amp@ampcode.com >
Amp-Thread-ID: https://ampcode.com/threads/T-019d3bef-9580-7798-aec3-7a009a0f62a4
2026-03-29 18:37:59 -07:00
Jedrzej Kosinski
466f5636dc
Add create_prepare_sampling_wrapper to interface with new prepare_sampling wrapper
2025-04-05 09:30:00 -05:00
Jedrzej Kosinski
599b71807d
Added overlap-linear fuse method, marked some fuse methods as experimental to make the dropdown less overwhelming, made sigma-related fuse methods work with View Options
2025-03-08 23:36:52 -06:00
Jedrzej Kosinski
6fda3ae9c9
Fix backwards compatibility for perform_special_model_features code
2025-03-08 20:30:25 -06:00
Jedrzej Kosinski
59b6fa6fe6
Guarantee proper execution interruption when using MultiGPU context work units
2025-02-24 17:11:02 -06:00
Jedrzej Kosinski
a69c1d7ae2
Cast transformer_options to device for multigpu in _handle_context_batch
2025-02-18 22:51:10 -06:00
Jedrzej Kosinski
37e7ab8921
Made controlnets work with context splitting, allow NaiveReuse to permit context splitting
2025-02-02 05:23:58 -06:00
Jedrzej Kosinski
c1df1cee06
Fix recursive prepare_control_objects call
2025-01-30 14:47:26 -06:00
Jedrzej Kosinski
faab900799
Implement multigpu acceleration via context splitting
2025-01-29 11:11:49 -06:00
Jedrzej Kosinski
d167f18f79
Added multigpu support to a bunch of core AnimateDiff features via refactor
2025-01-29 09:13:53 -06:00
Jedrzej Kosinski
d317bc6976
Merge branch 'main' into multigpu
2025-01-29 06:28:54 -06:00
Jedrzej Kosinski
6c01970d51
Add initial Ancestral Options onto Sample Settings to control seed used for the additional noise generated by ancestral samplers
2025-01-29 06:24:22 -06:00
Jedrzej Kosinski
814180996e
Fix allow_multigpu_contexts check
2025-01-29 01:23:15 -06:00
Jedrzej Kosinski
cf4bc49b58
Beginning restructuring sliding_calc_cond_batch to support multigpu for context splits
2025-01-27 06:34:59 -06:00
Jedrzej Kosinski
ad935663b4
Extract NaiveReuse code from sliding_calc_cond_batch into NaiveReuseHandler
2025-01-26 07:27:23 -06:00
Jedrzej Kosinski
99525ac852
Refactored sliding_calc_cond_batch to extract prepare_control_objects/get_resized_cond as well as ContextRef implementation
2025-01-26 06:57:49 -06:00
Jedrzej Kosinski
06e41b1ad6
Make ContextRef be backwards compatible with previous versions of Advanced-ControlNet (DinkLink versioning coming in clutch)
2025-01-04 00:38:42 -06:00
Jedrzej Kosinski
d6d5a9241c
Fix ContextRef for newest Advanced-ControlNet
2025-01-04 00:27:03 -06:00
Jedrzej Kosinski
856d850437
Fixed keyframes not working as expected when sampling is spread across multiple nodes/calls, removed conditioning.py since most of the code there was already deprecated in favor of vanilla ComfyUI after my PR was merged in early December
2024-12-30 23:32:47 -06:00
Jedrzej Kosinski
93cafde180
Got MotionCtrl's camere control working, fixed frame_length affecting CameraCtrl Pose speed; still need to fix CameraCtrl Poses not adding to each other as expected
2024-12-29 14:42:54 -06:00
Jedrzej Kosinski
ebb5496001
Technically initial support for HelloMeme RefNet; it needs more work, but after some more testing with the diffusers repo, it does not seem like something that can be extended well. Will continue to explore
2024-12-26 07:41:53 -06:00
Jedrzej Kosinski
8b1afceebb
Fix some calls for PIA, FancyVideo, AnimateLCM-I2V, and CameraControl not being refactored properly in PR
2024-12-03 12:43:59 -06:00
Jedrzej Kosinski
28b841f083
Fixed special model features not being changed to use attachment from refactored MotionModelPatchers
2024-11-29 02:04:40 -06:00
Jedrzej Kosinski
d06a40877a
Adjusted spacing
2024-11-17 09:08:16 -06:00
Jedrzej Kosinski
066bb23b43
Clean up perform_image_injection, as backwards compatible code no longer needed
2024-11-17 09:01:40 -06:00
Jedrzej Kosinski
054418df0e
Replace apply_model_factory with special_model_apply_model_wrapper that uses built-in ComfyUI wrapper for apply_model
2024-11-17 08:59:41 -06:00
Jedrzej Kosinski
844b4e4488
Make diffusion_model_groupnormed hack use built-in diffusion_model wrapper instead to fix weird issue with ContextRef + ImageInjection
2024-11-17 08:35:45 -06:00
Jedrzej Kosinski
0fb102e4c0
Modified FunctionInjectionHolder to work more smoothily with new ComfyUI memory management system
2024-11-11 07:30:05 -06:00
Jedrzej Kosinski
959fd3fd45
Match changes in patch_hooks_improved_memory ComfyUI branch
2024-11-02 22:21:45 -05:00
Jedrzej Kosinski
0b01ea1b27
Refactored ADGS to be a variable stored within transformer_options instead of a global variable
2024-10-24 22:24:32 -05:00
Jedrzej Kosinski
3e93f152b0
Removed no longer needed code from sampling.py, removed ContextRefInjector as upcoming ComfyUI/ACN changes will make its use obsolete
2024-10-08 17:48:47 -05:00
Jedrzej Kosinski
1698f9f4aa
Fixed device mismatch issue in perform_image_injection (Image Injection) code after code refactor
2024-10-07 11:00:24 -05:00
Kosinkadink
b960317e42
Refactored outer_sample_wrapper to work with my changes in in-progress ComfyUI branch
2024-09-27 12:15:47 +09:00
Kosinkadink
f003299708
Adapted sliding_calc_cond_batch and forward_timestep_embed to use new ModelPatcher wrappers/patches, removed no-longer used code, removed model_name from InjectionParams
2024-09-24 14:05:46 +09:00
Kosinkadink
a1b03d6851
Ported Gen1 nodes to use upcoming ComfyUI features, refactored some code to match ComfyUI changes
2024-09-22 16:38:57 +09:00
Kosinkadink
3e3d29729f
Fixed FreeInit for new implementation
2024-09-21 21:48:24 +09:00
Kosinkadink
e6a9638cef
Started porting over code to use upcoming ModelPatcher features in ComfyUI to get rid of a bunch of hacky code (and to enable hookable patches)
2024-09-21 16:33:05 +09:00
Jedrzej Kosinski
1a9d70ee4c
Progress on FancyVideo support
2024-09-03 15:37:14 -05:00
Jedrzej Kosinski
6a1d498ce0
Started work on NoiseCalibration implementation (pain)
2024-09-01 12:34:07 -05:00
Jedrzej Kosinski
5e018612ba
Remove no longer needed backwards compatibility code
2024-08-20 02:35:05 -05:00
Jedrzej Kosinski
ecbd4ff362
Added check for Advanced-ControlNet cooperation and matching errors to throw
2024-08-08 02:49:25 -05:00
Jedrzej Kosinski
ee3409f30e
Added support for ContextRef mode_replace and tune_replace
2024-08-07 02:36:22 -05:00
Jedrzej Kosinski
62061995c2
Merge branch 'main' into develop
2024-08-06 17:26:30 -05:00
Jedrzej Kosinski
c1c3bbc583
Remove current_device param from ModelPatcher init call to match latest ComfyUI
2024-08-06 17:25:04 -05:00
Jedrzej Kosinski
0f6aa7c251
Added ContextRef Keyframes, made strength_multival for ContextRef functional, removed redundant version of NaiveReuse Keyframe node, and instead mult_multival is on the normal node
2024-08-06 05:34:16 -05:00
Jedrzej Kosinski
f051ca9944
Workflows can be cancelled between context window execution, instead of only per-step
2024-08-04 22:00:10 -05:00
Jedrzej Kosinski
9dee45bc22
Remove pointless batched_conds calculations in sliding_calc_conds_batch; this is a wrapper around cond batching, so there never is any batching in this layer
2024-08-04 21:28:52 -05:00
Jedrzej Kosinski
4256412352
Add ContextRef Mode - Indexes node
2024-08-04 21:11:29 -05:00
Jedrzej Kosinski
0ba022c775
Added ContextRef Tune nodes to modify values of underlying ReferenceAdvanced ACN object
2024-08-02 17:18:00 -05:00
Jedrzej Kosinski
11252fc34f
Added sliding reference window mode for ContextRef + ContextRef Mode nodes
2024-07-31 06:31:21 -05:00