Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: leejet/stable-diffusion.cpp
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: ZacxDev/stable-diffusion.cpp
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 14 commits
  • 15 files changed
  • 2 contributors

Commits on Feb 13, 2026

  1. fix: ignore model's alphas_cumprod to prevent black images

    Some models (e.g. hassakuXLIllustrious) embed alphas_cumprod tensors
    with F16 quantization that rounds the first value to 1.0 instead of
    0.99915. This causes sigma[0] = sqrt((1-1)/1) = 0, breaking the
    denoising process and producing completely black images.
    
    The fix always uses computed alphas_cumprod values instead of loading
    from model files. This is safe because:
    - All SD/SDXL models use the same standard noise schedule
    - Other scheduler tensors are already ignored in model.cpp
    - Computed F32 values avoid quantization artifacts
    
    Also adds Nix flake for reproducible builds with multiple backend
    variants (CPU, CUDA, Vulkan, OpenCL).
    
    🤖 Generated with [Claude Code](https://claude.com/claude-code)
    
    Co-Authored-By: Claude <[email protected]>
    ZacxDev and claude committed Feb 13, 2026
    Configuration menu
    Copy the full SHA
    0ebc1c3 View commit details
    Browse the repository at this point in the history
  2. feat: add DPM-Solver++(3M) SDE sampler

    Implement dpm++3m_sde sampling method based on k-diffusion reference:
    - Third-order multistep solver with two denoised history tensors
    - Phi functions (φ₂, φ₃) for exponential integrator accuracy
    - SDE noise injection controlled by eta parameter
    - Progressive order increase as history accumulates
    
    Recommended settings: exponential scheduler, 20-30 steps, eta=1.0
    
    Ref: https://github.com/crowsonkb/k-diffusion/blob/master/k_diffusion/sampling.py
    
    🤖 Generated with [Claude Code](https://claude.com/claude-code)
    
    Co-Authored-By: Claude Opus 4.5 <[email protected]>
    ZacxDev and claude committed Feb 13, 2026
    Configuration menu
    Copy the full SHA
    4ca6804 View commit details
    Browse the repository at this point in the history
  3. feat: add BrownianTree noise sampler for improved fine details in dpm…

    …++3m_sde
    
    Implements temporally-correlated Brownian motion sampling using a lazy
    binary tree with Brownian bridge interpolation, matching k-diffusion's
    BrownianTreeNoiseSampler approach.
    
    This improves fine detail quality (skin textures, etc.) compared to
    independent Gaussian noise by maintaining temporal consistency across
    the sampling trajectory.
    
    - Add brownian_tree.hpp with BrownianTree and BrownianTreeNoiseSampler classes
    - Integrate into DPMPP3M_SDE_SAMPLE_METHOD case in denoiser.hpp
    
    🤖 Generated with [Claude Code](https://claude.com/claude-code)
    
    Co-Authored-By: Claude Opus 4.5 <[email protected]>
    ZacxDev and claude committed Feb 13, 2026
    Configuration menu
    Copy the full SHA
    eed63e9 View commit details
    Browse the repository at this point in the history
  4. fix: preserve original image dimensions in standalone upscale mode

    Previously, when using -M upscale mode, input images were resized to
    the default dimensions (512x512) before upscaling. This fix ensures
    that upscale mode preserves the original image dimensions by passing
    0,0 to load_image_from_file (which skips resize) and properly setting
    init_image.width/height with the actual loaded dimensions.
    
    🤖 Generated with [Claude Code](https://claude.com/claude-code)
    
    Co-Authored-By: Claude Opus 4.5 <[email protected]>
    ZacxDev and claude committed Feb 13, 2026
    Configuration menu
    Copy the full SHA
    40d3a32 View commit details
    Browse the repository at this point in the history
  5. fix: free GPU buffer after get_learned_condition for CPU offload mode

    When using --offload-to-cpu, the LLM's GPU runtime buffer was not being
    freed before the diffusion model tried to allocate. This caused OOM on
    GPUs with less than 20GB VRAM (e.g., RTX 5080 with 16GB).
    
    Added free_compute_buffer() method to Conditioner interface and call it
    after get_learned_condition() to release the LLM's GPU memory before
    diffusion sampling starts.
    
    This enables sequential model loading:
    - LLM loads to GPU (~7GB), runs conditioning, frees GPU
    - Diffusion loads to GPU (~12.5GB), runs sampling
    - Peak VRAM reduced from ~20GB to ~14GB
    
    🤖 Generated with [Claude Code](https://claude.com/claude-code)
    
    Co-Authored-By: Claude Opus 4.5 <[email protected]>
    ZacxDev and claude committed Feb 13, 2026
    Configuration menu
    Copy the full SHA
    0e71433 View commit details
    Browse the repository at this point in the history
  6. fix: free GPU resources after encode_image for proper CPU offload mode

    Changed encode_image to use free_compute_buffer_immediately=true
    so that GPU resources are properly released after vision encoding.
    This ensures the subsequent LLM compute() call works correctly
    with CPU offload mode by allowing fresh GPU allocation.
    ZacxDev committed Feb 13, 2026
    Configuration menu
    Copy the full SHA
    9977134 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    ea7aeec View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    ce119ea View commit details
    Browse the repository at this point in the history
  9. debug: add CUDA memory diagnostics for OOM investigation

    Add log_cuda_memory() helper that calls cudaMemGetInfo to track actual
    GPU memory state at key points:
    - Before/after free_compute_buffer
    - Before attempting GPU allocation in offload_params_to_runtime_backend
    - After offloading params back to CPU
    
    This will help diagnose why OOM still occurs despite LLM offloading.
    
    🤖 Generated with [Claude Code](https://claude.com/claude-code)
    
    Co-Authored-By: Claude Opus 4.5 <[email protected]>
    ZacxDev and claude committed Feb 13, 2026
    Configuration menu
    Copy the full SHA
    9c2e609 View commit details
    Browse the repository at this point in the history
  10. fix: use ggml API for CUDA memory logging instead of cuda_runtime.h

    The cuda_runtime.h header is not available in the main build include
    path, causing compilation failures. Use ggml_backend_cuda_get_device_memory()
    instead which is properly exposed through ggml-cuda.h.
    
    🤖 Generated with [Claude Code](https://claude.com/claude-code)
    
    Co-Authored-By: Claude Opus 4.5 <[email protected]>
    ZacxDev and claude committed Feb 13, 2026
    Configuration menu
    Copy the full SHA
    bb91f85 View commit details
    Browse the repository at this point in the history
  11. fix: use fprintf instead of LOG_INFO for CUDA memory logging

    LOG_INFO macro is defined in util.h which is included after the CUDA
    section. Use fprintf(stderr, ...) instead for proper logging.
    
    🤖 Generated with [Claude Code](https://claude.com/claude-code)
    
    Co-Authored-By: Claude Opus 4.5 <[email protected]>
    ZacxDev and claude committed Feb 13, 2026
    Configuration menu
    Copy the full SHA
    ff4c51c View commit details
    Browse the repository at this point in the history
  12. fix: remove logging from free_compute_buffer to prevent crash

    The logging in free_compute_buffer and offload_params_to_params_backend
    was calling get_desc() which caused "pure virtual method called" crashes
    during LoRA application cleanup.
    
    Keep only the allocation logging in offload_params_to_runtime_backend
    which is what we need for OOM diagnosis.
    
    🤖 Generated with [Claude Code](https://claude.com/claude-code)
    
    Co-Authored-By: Claude Opus 4.5 <[email protected]>
    ZacxDev and claude committed Feb 13, 2026
    Configuration menu
    Copy the full SHA
    7b0e293 View commit details
    Browse the repository at this point in the history
  13. feat: add SRVGGNetCompact support for fast Real-ESRGAN upscaling

    Add support for SRVGGNetCompact-based models (realesr-animevideov3,
    realesr-general-x4v3) alongside existing RRDBNet models. Achieves ~10x
    speedup compared to RRDBNet while maintaining comparable quality.
    
    Changes:
    - Add PixelShuffle (depth-to-space) operation in ggml_extend.hpp
    - Add PReLU activation layer with learnable per-channel slopes
    - Create srvgg.hpp with SRVGGNetCompact architecture
    - Add automatic architecture detection from weight tensor names
    - Extend ESRGAN struct for dual-architecture support
    - Add --upscale-info CLI option to display model information
    - Add get_upscaler_desc() API function
    
    Supported models:
    - RRDBNet: RealESRGAN_x4plus, RealESRGAN_x4plus_anime_6B (~16M params)
    - SRVGGNet: realesr-animevideov3 (~1.5M), realesr-general-x4v3 (~3M)
    
    🤖 Generated with [Claude Code](https://claude.com/claude-code)
    
    Co-Authored-By: Claude Opus 4.5 <[email protected]>
    ZacxDev and claude committed Feb 13, 2026
    Configuration menu
    Copy the full SHA
    584c366 View commit details
    Browse the repository at this point in the history

Commits on Feb 14, 2026

  1. fix: move srvgg.hpp and brownian_tree.hpp to src/ to fix include paths

    These headers include "ggml_extend.hpp" and "rng.hpp" which live in src/,
    but they were placed in the root directory which is not in the include
    path for those headers. Moving them to src/ where all other internal
    headers reside fixes the build.
    
    Co-Authored-By: Claude Opus 4.6 <[email protected]>
    ZacxDev and claude committed Feb 14, 2026
    Configuration menu
    Copy the full SHA
    a304808 View commit details
    Browse the repository at this point in the history
Loading