-
Notifications
You must be signed in to change notification settings - Fork 705
Comparing changes
Open a pull request
base repository: leejet/stable-diffusion.cpp
base: master
head repository: ZacxDev/stable-diffusion.cpp
compare: master
- 14 commits
- 15 files changed
- 2 contributors
Commits on Feb 13, 2026
-
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]>
Configuration menu - View commit details
-
Copy full SHA for 0ebc1c3 - Browse repository at this point
Copy the full SHA 0ebc1c3View commit details -
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]>
Configuration menu - View commit details
-
Copy full SHA for 4ca6804 - Browse repository at this point
Copy the full SHA 4ca6804View commit details -
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]>
Configuration menu - View commit details
-
Copy full SHA for eed63e9 - Browse repository at this point
Copy the full SHA eed63e9View commit details -
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]>
Configuration menu - View commit details
-
Copy full SHA for 40d3a32 - Browse repository at this point
Copy the full SHA 40d3a32View commit details -
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]>
Configuration menu - View commit details
-
Copy full SHA for 0e71433 - Browse repository at this point
Copy the full SHA 0e71433View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 9977134 - Browse repository at this point
Copy the full SHA 9977134View commit details -
Configuration menu - View commit details
-
Copy full SHA for ea7aeec - Browse repository at this point
Copy the full SHA ea7aeecView commit details -
fix: add ggml_backend_synchronize to ensure GPU memory is freed befor…
…e next allocation
Configuration menu - View commit details
-
Copy full SHA for ce119ea - Browse repository at this point
Copy the full SHA ce119eaView commit details -
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]>
Configuration menu - View commit details
-
Copy full SHA for 9c2e609 - Browse repository at this point
Copy the full SHA 9c2e609View commit details -
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]>
Configuration menu - View commit details
-
Copy full SHA for bb91f85 - Browse repository at this point
Copy the full SHA bb91f85View commit details -
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]>
Configuration menu - View commit details
-
Copy full SHA for ff4c51c - Browse repository at this point
Copy the full SHA ff4c51cView commit details -
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]>
Configuration menu - View commit details
-
Copy full SHA for 7b0e293 - Browse repository at this point
Copy the full SHA 7b0e293View commit details -
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]>
Configuration menu - View commit details
-
Copy full SHA for 584c366 - Browse repository at this point
Copy the full SHA 584c366View commit details
Commits on Feb 14, 2026
-
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]>
Configuration menu - View commit details
-
Copy full SHA for a304808 - Browse repository at this point
Copy the full SHA a304808View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff master...master