Skip to content

Add sana sprint #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 4, 2025
Merged

Add sana sprint #15

merged 6 commits into from
Jun 4, 2025

Conversation

lawrence-cj
Copy link
Collaborator

Based on your git commits, here's a concise PR summary:

Add SCM (Smart Consistency Model) Sampler for SANA-Sprint

Summary

Implemented custom SCM sampler with CFG scale support for SANA models in ComfyUI.

Key Changes

  • Initial SCM Implementation: Added basic SANA-Sprint sampling code
  • Single-step Working: Fixed timestep=1, cfg=1 configuration
  • Multi-step Sampling: Extended to support N-step sampling with trigflow timesteps
  • CFG Scale Integration: Successfully implemented CFG scale passing to model forward method

Technical Details

  • Custom sample_scm() function with trigflow parameterization (1.57080 → 0)
  • ScmModelSampling node for CFG scale injection via transformer_options
  • Bypass ComfyUI's standard CFG mixing (KSampler cfg=1.0)
  • Direct CFG scale handling in SanaMSCM model

Evolution

  1. Started: Basic LCM-based implementation with poor results
  2. Fixed: Single-step sampling (timestep=1, cfg=1)
  3. Expanded: Multi-step sampling support
  4. Completed: Full CFG scale functionality

Usage

SanaCheckpointLoader → ScmModelSampling(cfg_scale=4.5) → KSampler(sampler="scm", cfg=1.0) → Output

Status

🎉 Fully Working - SCM sampling with configurable CFG scale now operational for SANA models.

@lawrence-cj lawrence-cj merged commit e3bce90 into main Jun 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant