3 Commits

Author SHA1 Message Date
copilot-swe-agent[bot]
d7577069e0 Add .gitignore to exclude Python cache files
Co-authored-by: jags111 <5968619+jags111@users.noreply.github.com>
2026-02-03 23:05:54 +00:00
copilot-swe-agent[bot]
040aea25a1 Fix cfg_denoiser AttributeError by calling register_hooks()
Co-authored-by: jags111 <5968619+jags111@users.noreply.github.com>
2026-02-03 23:05:38 +00:00
copilot-swe-agent[bot]
cd682e645f Initial plan 2026-02-03 22:59:59 +00:00
2 changed files with 2 additions and 34 deletions

18
.gitignore vendored
View File

@@ -1,4 +1,4 @@
# Python cache # Python cache files
__pycache__/ __pycache__/
*.py[cod] *.py[cod]
*$py.class *$py.class
@@ -21,19 +21,3 @@ wheels/
*.egg-info/ *.egg-info/
.installed.cfg .installed.cfg
*.egg *.egg
# Virtual environments
venv/
ENV/
env/
# IDEs
.vscode/
.idea/
*.swp
*.swo
*~
# OS
.DS_Store
Thumbs.db

View File

@@ -99,16 +99,6 @@ def encode_prompts(positive_prompt, negative_prompt, token_normalization, weight
elif return_type == "both": elif return_type == "both":
return positive_encoded, negative_encoded, clip, refiner_positive_encoded, refiner_negative_encoded, refiner_clip return positive_encoded, negative_encoded, clip, refiner_positive_encoded, refiner_negative_encoded, refiner_clip
########################################################################################################################
# Helper function for VAE error message
def get_missing_vae_error(ckpt_name):
"""Generate error message for checkpoints without embedded VAE"""
return (
f"Checkpoint '{ckpt_name}' does not contain an embedded VAE. "
f"This checkpoint (likely an AIO model) requires an external VAE. "
f"Please select a VAE file instead of 'Baked VAE'."
)
######################################################################################################################## ########################################################################################################################
# TSC Efficient Loader # TSC Efficient Loader
class TSC_EfficientLoader: class TSC_EfficientLoader:
@@ -176,9 +166,6 @@ class TSC_EfficientLoader:
f"{warning('Efficiency Nodes:')} Baked VAE not found in cache, loading checkpoint to extract VAE...") f"{warning('Efficiency Nodes:')} Baked VAE not found in cache, loading checkpoint to extract VAE...")
_, _, vae = load_checkpoint(ckpt_name, my_unique_id, output_vae=True, cache=ckpt_cache, _, _, vae = load_checkpoint(ckpt_name, my_unique_id, output_vae=True, cache=ckpt_cache,
cache_overwrite=True) cache_overwrite=True)
# Check if VAE extraction was successful
if vae is None:
raise ValueError(get_missing_vae_error(ckpt_name))
else: else:
model, clip, vae = load_checkpoint(ckpt_name, my_unique_id, cache=ckpt_cache, cache_overwrite=True) model, clip, vae = load_checkpoint(ckpt_name, my_unique_id, cache=ckpt_cache, cache_overwrite=True)
lora_params = None lora_params = None
@@ -208,9 +195,6 @@ class TSC_EfficientLoader:
# Check for custom VAE # Check for custom VAE
if vae_name != "Baked VAE": if vae_name != "Baked VAE":
vae = load_vae(vae_name, my_unique_id, cache=vae_cache, cache_overwrite=True) vae = load_vae(vae_name, my_unique_id, cache=vae_cache, cache_overwrite=True)
elif vae is None:
# If "Baked VAE" was selected but checkpoint has no embedded VAE
raise ValueError(get_missing_vae_error(ckpt_name))
# Data for XY Plot # Data for XY Plot
dependencies = (vae_name, ckpt_name, clip, clip_skip, refiner_name, refiner_clip, refiner_clip_skip, dependencies = (vae_name, ckpt_name, clip, clip_skip, refiner_name, refiner_clip, refiner_clip_skip,
@@ -522,7 +506,7 @@ class TSC_KSampler:
rng_source, cfg_denoiser, add_seed_noise, m_seed, m_weight = script["noise"] rng_source, cfg_denoiser, add_seed_noise, m_seed, m_weight = script["noise"]
smZ_rng_source.rng_rand_source(rng_source) # this function monkey patches comfy.sample.prepare_noise smZ_rng_source.rng_rand_source(rng_source) # this function monkey patches comfy.sample.prepare_noise
if cfg_denoiser: if cfg_denoiser:
comfy.samplers.KSampler = smZ_cfg_denoiser.SDKSampler smZ_cfg_denoiser.register_hooks()
if add_seed_noise: if add_seed_noise:
comfy.sample.prepare_noise = cg_mixed_seed_noise.get_mixed_noise_function(comfy.sample.prepare_noise, m_seed, m_weight) comfy.sample.prepare_noise = cg_mixed_seed_noise.get_mixed_noise_function(comfy.sample.prepare_noise, m_seed, m_weight)
else: else: