Conversation
… Token Merging (ToMe) support - Add documentation pages for CFG-Free sampling and Token Merging (docs/cfg-free-sampling.md, docs/tome.md) and register in mkdocs.yml - Implement CFG-Free scheduling: CFG.CFGGuider supports cfg-free params, sigmas tracking and dynamic CFG reduction; sampling APIs and KSampler propagate cfg_free_enabled / cfg_free_start_percent - Add Token Merging (ToMe) integration: ModelPatcher imports tomesd, provides apply_tome/remove_tome and named_modules compatibility for tomesd - Wire pipeline/server/UI: accept cfg-free and tome parameters (settings, pages, generation, server, pipeline) and propagate to sampling/model patching; apply and remove ToMe around generation paths - Update defaults and settings to expose CFG-Free and ToMe options in the UI - Minor import/order cleanup and logging/console messages for activation/failure cases
…ons (batched CFG, dynamic rescaling, adaptive noise) - Add docs/advanced-cfg-optimizations.md describing batched CFG, dynamic CFG rescaling, and adaptive noise scheduling. - Extend CFGGuider with dynamic rescaling and adaptive noise scheduling: - implement _apply_dynamic_cfg_rescaling and _calculate_complexity_metric - integrate dynamic rescaling into cfg_function and sampling flow - collect complexity metrics and adjust sigma schedule - Expose new options across sampling API: batched_cfg, dynamic_cfg_rescaling, dynamic_cfg_method, dynamic_cfg_percentile, dynamic_cfg_target_scale, adaptive_noise_enabled, adaptive_noise_method. - Thread options through sample/sample1/common_ksampler/KSampler and model_options; default batched_cfg=True. - Surface controls and defaults in UI: ui/pages, ui/generation and ui/settings; accept params in server GenerateRequest and user pipeline. - Add logging/debug messages and clamp bounds for stability.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds comprehensive documentation for several advanced performance and quality optimizations in the LightDiffusion-Next project. It introduces new guides for CFG-Free Sampling, Token Merging (ToMe), and advanced Classifier-Free Guidance (CFG) techniques, and updates the documentation navigation to include these new resources. These changes help users understand, configure, and troubleshoot cutting-edge optimizations for image generation.
New Optimization Documentation
Classifier-Free Guidance (CFG) Techniques
advanced-cfg-optimizations.mddetailing three advanced CFG optimizations: Batched CFG Computation (speed), Dynamic CFG Rescaling (quality), and Adaptive Noise Scheduling (quality & speed). Each section includes explanations, configuration examples, usage scenarios, troubleshooting, and credits.CFG-Free Sampling
cfg-free-sampling.mdexplaining CFG-Free Sampling, which gradually reduces guidance strength during late denoising steps to improve photorealism and detail. The guide covers theoretical background, configuration, usage via UI/API/Python, quality analysis, troubleshooting, and implementation details.Token Merging (ToMe)
tome.mddescribing Token Merging, a performance optimization that speeds up attention computation by merging similar tokens. The document includes configuration advice, usage instructions, troubleshooting, technical implementation, algorithm details, and compatibility notes.Documentation Navigation Update
mkdocs Navigation
mkdocs.ymlto add the new guides (cfg-free-sampling.md,tome.md, andadvanced-cfg-optimizations.md) under the "Performance Optimizations" section, improving discoverability and organization of advanced optimization topics.