diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5586e734f2..b717e56d9e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -451,8 +451,8 @@ jobs: runs-on: windows-2022 env: - ROCM_VERSION: "7.14.0" - GPU_TARGETS: "gfx1010;gfx1011;gfx1012;gfx1030;gfx1031;gfx1032;gfx1033;gfx1034;gfx1035;gfx1036;gfx1100;gfx1101;gfx1102;gfx1103;gfx1150;gfx1151;gfx1152;gfx1153;gfx1200;gfx1201" + ROCM_VERSION: "10.1.0" + gpu_targets: "gfx1010;gfx1011;gfx1012;gfx1030;gfx1031;gfx1032;gfx1033;gfx1034;gfx1035;gfx1036;gfx1100;gfx1101;gfx1102;gfx1103;gfx1150;gfx1151;gfx1152;gfx1153;gfx1200;gfx1201" steps: - uses: actions/checkout@v3 @@ -498,7 +498,7 @@ jobs: write-host "Installing ROCm wheels for multi-arch support" # Install ROCm wheels for multi-arch support (this may take several minutes) - python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ "rocm[libraries,devel]==${{env.ROCM_VERSION}}" + python -m pip install --index-url https://stable.repo.amd.com/rocm/whl-next/ "rocm[libraries,devel]==${{env.ROCM_VERSION}}" # Pre-expand the devel tree so it is included in the cache write-host "Initializing ROCm devel tree" @@ -594,9 +594,9 @@ jobs: strategy: matrix: include: - - ROCM_VERSION: "7.14.0" + - ROCM_VERSION: "10.1.0" gpu_targets: "gfx900;gfx906;gfx908;gfx90a;gfx90c;gfx942;gfx950;gfx1010;gfx1011;gfx1012;gfx1030;gfx1031;gfx1032;gfx1033;gfx1034;gfx1035;gfx1036;gfx1100;gfx1101;gfx1102;gfx1103;gfx1150;gfx1151;gfx1152;gfx1153;gfx1200;gfx1201" - build: x64 + build: 'x64' steps: - name: Clone @@ -610,6 +610,16 @@ jobs: with: key: ubuntu-rocm-cmake-${{ matrix.ROCM_VERSION }}-${{ matrix.build }} evict-old-files: 1d + max-size: "2G" + + - name: Tune ccache for reinstalled ROCm toolchain + run: | + # ROCm is pip-installed fresh each run, so the clang binary's mtime + # changes every time. With the default compiler_check=mtime that + # invalidates the cache; hash compiler contents instead so warm + # builds hit. + ccache --set-config=compiler_check=content + ccache --set-config=sloppiness=time_macros,include_file_mtime,include_file_ctime - name: Dependencies id: depends @@ -646,7 +656,7 @@ jobs: # libraries = HIP runtime and CMake configs needed for linking # devel = compilers, headers, static libs python -m pip install --upgrade pip - python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ "rocm[libraries,devel]==${{matrix.ROCM_VERSION}}" + python -m pip install --index-url https://stable.repo.amd.com/rocm/whl-next/ "rocm[libraries,devel]==${{matrix.ROCM_VERSION}}" # Get ROCm installation paths using the rocm-sdk CLI tool ROCM_PATH=$(rocm-sdk path --root) diff --git a/CMakeLists.txt b/CMakeLists.txt index 134719ca47..bd7c6d9e90 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -225,6 +225,8 @@ file(GLOB SD_LIB_SOURCES CONFIGURE_DEPENDS "src/core/*.h" "src/core/*.cpp" "src/core/*.hpp" + "src/core/probe/*.h" + "src/core/probe/*.cpp" "src/extensions/*.h" "src/extensions/*.cpp" "src/extensions/*.hpp" @@ -342,6 +344,14 @@ if (SD_CUDA) target_link_libraries(${SD_LIB} PUBLIC CUDA::cuda_driver) set_property(SOURCE src/core/ggml_extend_backend.cpp APPEND PROPERTY COMPILE_DEFINITIONS SD_USE_CUDA) endif() +if (SD_HIPBLAS) + find_package(hip REQUIRED CONFIG HINTS "$ENV{ROCM_PATH}" /opt/rocm) + target_link_libraries(${SD_LIB} PRIVATE hip::host) + set_property(SOURCE src/core/ggml_extend_backend.cpp APPEND PROPERTY COMPILE_DEFINITIONS SD_USE_HIP) + if (GGML_HIP_MMQ_MFMA) + set_property(SOURCE src/core/ggml_extend_backend.cpp APPEND PROPERTY COMPILE_DEFINITIONS SD_HIP_MFMA) + endif() +endif() target_include_directories(${SD_LIB} PUBLIC . src include) target_include_directories(${SD_LIB} PRIVATE src/core) target_include_directories(${SD_LIB} PUBLIC . thirdparty) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 776626d7e8..1f4c067927 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -29,6 +29,10 @@ PRs should include: - Linked issue/PR context when applicable. - Screenshots or sample outputs for UI/visual behavior changes. +## README UI Listings + +The [UIs list in the README](README.md#uis) only includes open-source projects that use `stable-diffusion.cpp` as a backend. Do not submit PRs to add closed-source UIs. + ## Code Style Format code according to the repository style before submitting changes. diff --git a/README.md b/README.md index 2305974f2c..b4ab2f5ab2 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,8 @@ API and command-line option may change frequently.*** ## 🔥Important News +* **2026/10/16** 🚀 stable-diffusion.cpp adds **Day-0 support for MOSS-Image-Base / MOSS-Image-SFT** +* **2026/10/16** 🚀 stable-diffusion.cpp adds **Day-0 support for FLUX.3 Image Klein / Klein Base** * **2026/09/20** 🚀 stable-diffusion.cpp adds **Day-0 support for Qwen-Image-2.1** * **2026/08/20** 🚀 stable-diffusion.cpp now supports **LTX-2.5** * **2026/08/04** 🚀 stable-diffusion.cpp adds **Day-1 support for MiniMax-H3** @@ -44,6 +46,8 @@ API and command-line option may change frequently.*** - [SD3/SD3.5](./docs/sd3.md) - [FLUX.1-dev/FLUX.1-schnell](./docs/flux.md) - [FLUX.2-dev/FLUX.2-klein](./docs/flux2.md) + - [FLUX.3 Image Klein / Klein Base](./docs/flux3.md) + - [MOSS-Image-Base / MOSS-Image-SFT](./docs/moss_image.md) - [Lens](./docs/lens.md) - [Chroma](./docs/chroma.md) - [Chroma1-Radiance](./docs/chroma_radiance.md) @@ -67,6 +71,7 @@ API and command-line option may change frequently.*** - [LLaDA-Image](./docs/llada_image.md) - [Ming-Image Design](./docs/ming_image.md) - [PixArt](./docs/pixart.md) + - [Iris-3B](./docs/iris.md) - [Image Edit Models](./docs/edit.md) - [FLUX.1-Kontext-dev](./docs/kontext.md) - [Qwen Image Edit series](./docs/qwen_image_edit.md) @@ -182,7 +187,6 @@ These projects wrap `stable-diffusion.cpp` for easier use in other languages/fra These projects use `stable-diffusion.cpp` as a backend for their image generation. - [GIMP Plugins](https://github.com/themanyone/gimp-plugins) -- [Jellybox](https://jellybox.com) - [Stable Diffusion GUI](https://github.com/fszontagh/sd.cpp.gui.wx) - [Stable Diffusion CLI-GUI](https://github.com/piallai/stable-diffusion.cpp) - [Local Diffusion](https://github.com/rmatif/Local-Diffusion) @@ -190,6 +194,7 @@ These projects use `stable-diffusion.cpp` as a backend for their image generatio - [LocalAI](https://github.com/mudler/LocalAI) - [Neural-Pixel](https://github.com/Luiz-Alcantara/Neural-Pixel) - [KoboldCpp](https://github.com/LostRuins/koboldcpp) +- [Kokon](https://github.com/GabrieleLozupone/kokon) ## Contributors diff --git a/assets/flux3/flux3-image-klein-base.png b/assets/flux3/flux3-image-klein-base.png new file mode 100644 index 0000000000..411502269a Binary files /dev/null and b/assets/flux3/flux3-image-klein-base.png differ diff --git a/assets/flux3/flux3-image-klein-edit.png b/assets/flux3/flux3-image-klein-edit.png new file mode 100644 index 0000000000..f392eb86d2 Binary files /dev/null and b/assets/flux3/flux3-image-klein-edit.png differ diff --git a/assets/flux3/flux3-image-klein.png b/assets/flux3/flux3-image-klein.png new file mode 100644 index 0000000000..7d45f34720 Binary files /dev/null and b/assets/flux3/flux3-image-klein.png differ diff --git a/assets/iris/example.png b/assets/iris/example.png new file mode 100644 index 0000000000..af3a4fd75b Binary files /dev/null and b/assets/iris/example.png differ diff --git a/assets/moss/sft.png b/assets/moss/sft.png new file mode 100644 index 0000000000..ede42d1f78 Binary files /dev/null and b/assets/moss/sft.png differ diff --git a/docker/Dockerfile.musa b/docker/Dockerfile.musa index 7dda431aaf..08d6f1d43d 100644 --- a/docker/Dockerfile.musa +++ b/docker/Dockerfile.musa @@ -1,7 +1,6 @@ -ARG MUSA_VERSION=rc4.2.0 -ARG UBUNTU_VERSION=22.04 +ARG MUSA_IMAGE=registry.mthreads.com/mcconline/inference/pytorch:2.9.1.post1-py3.10-musa5.2.0-mp31-devel-ubuntu22.04-amd64 -FROM mthreads/musa:${MUSA_VERSION}-devel-ubuntu${UBUNTU_VERSION}-amd64 as build +FROM ${MUSA_IMAGE} AS build # sd-server embeds the web UI at build time, so the build image needs Node/pnpm. RUN apt-get update && apt-get install -y --no-install-recommends ccache cmake git ca-certificates curl gnupg && \ @@ -22,9 +21,8 @@ COPY . . RUN mkdir build && cd build && \ cmake .. -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \ - -DCMAKE_C_FLAGS="${CMAKE_C_FLAGS} -fopenmp -I/usr/lib/llvm-14/lib/clang/14.0.0/include -L/usr/lib/llvm-14/lib" \ - -DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -fopenmp -I/usr/lib/llvm-14/lib/clang/14.0.0/include -L/usr/lib/llvm-14/lib" \ -DSD_MUSA=ON \ + -DMUSA_ARCHITECTURES=31 \ -DSD_BUILD_SHARED_LIBS=ON \ -DGGML_NATIVE=OFF \ -DSD_BUILD_SHARED_GGML_LIB=ON \ @@ -35,7 +33,7 @@ RUN mkdir build && cd build && \ -DCMAKE_BUILD_TYPE=Release && \ cmake --build . --config Release -FROM mthreads/musa:${MUSA_VERSION}-runtime-ubuntu${UBUNTU_VERSION}-amd64 as runtime +FROM ${MUSA_IMAGE} AS runtime COPY --from=build /sd.cpp/build/bin /sd.cpp/bin RUN printf '#!/bin/sh\nexec /sd.cpp/bin/sd-cli "$@"\n' > /sd-cli && \ @@ -45,3 +43,4 @@ RUN printf '#!/bin/sh\nexec /sd.cpp/bin/sd-cli "$@"\n' > /sd-cli && \ WORKDIR /sd.cpp ENTRYPOINT [ "/sd-cli" ] +CMD [] diff --git a/docker/Dockerfile.rocm b/docker/Dockerfile.rocm new file mode 100644 index 0000000000..fe8a9b15e1 --- /dev/null +++ b/docker/Dockerfile.rocm @@ -0,0 +1,50 @@ +FROM rocm/dev-ubuntu-24.04 AS build + +# sd-server embeds the web UI at build time, so the build image needs Node/pnpm. +RUN apt-get update && apt-get install -y --no-install-recommends \ + build-essential git cmake ninja-build ccache ca-certificates curl gnupg && \ + mkdir -p /etc/apt/keyrings && \ + curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key -o /tmp/nodesource-repo.gpg.key && \ + gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg /tmp/nodesource-repo.gpg.key && \ + rm /tmp/nodesource-repo.gpg.key && \ + echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" > /etc/apt/sources.list.d/nodesource.list && \ + apt-get update && apt-get install -y --no-install-recommends nodejs && \ + npm install -g pnpm@10.15.1 && \ + apt-get clean && rm -rf /var/lib/apt/lists/* + +WORKDIR /sd.cpp + +# ROCm's clang is not on PATH in Docker RUN shells (profile scripts are not loaded). +ENV PATH="/opt/rocm/llvm/bin:$PATH" + +COPY . . + +ARG AMDGPU_TARGETS="" + +RUN cmake . -B ./build -G Ninja \ + -DCMAKE_C_COMPILER=clang \ + -DCMAKE_CXX_COMPILER=clang++ \ + -DSD_HIPBLAS=ON \ + -DGGML_NATIVE=OFF \ + -DAMDGPU_TARGETS="${AMDGPU_TARGETS}" \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \ + -DCMAKE_POSITION_INDEPENDENT_CODE=ON +RUN cmake --build ./build --config Release --parallel + +FROM rocm/dev-ubuntu-24.04 AS runtime + +# ROCm clang links against its own OpenMP runtime in /opt/rocm/llvm/lib, +# and the ROCm runtime libs (hipblas, rocblas, amdhip64) live in /opt/rocm/lib. +ENV LD_LIBRARY_PATH="/opt/rocm/llvm/lib:/opt/rocm/lib:$LD_LIBRARY_PATH" + +RUN apt-get update && \ + apt-get install --yes --no-install-recommends libgomp1 && \ + apt-get clean && rm -rf /var/lib/apt/lists/* + +COPY --from=build /sd.cpp/build/bin /sd.cpp/bin +RUN printf '#!/bin/sh\nexec /sd.cpp/bin/sd-cli "$@"\n' > /sd-cli && \ + printf '#!/bin/sh\nexec /sd.cpp/bin/sd-server "$@"\n' > /sd-server && \ + chmod +x /sd-cli /sd-server + +ENTRYPOINT [ "/sd-cli" ] diff --git a/docs/anima.md b/docs/anima.md index b852358fdd..18b94952b6 100644 --- a/docs/anima.md +++ b/docs/anima.md @@ -15,7 +15,7 @@ ## Examples ```sh -.\bin\Release\sd-cli.exe --diffusion-model ..\models\diffusion_models\anima-preview.safetensors --vae ..\models\vae\qwen_image_vae.safetensors --llm ..\models\text_encoders\qwen_3_06b_base.safetensors -p "a lovely cat holding a sign says 'anima.cpp'" --cfg-scale 6.0 --sampling-method euler -v --offload-to-cpu --diffusion-fa +.\bin\Release\sd-cli.exe --diffusion-model ..\models\diffusion_models\anima-preview.safetensors --vae ..\models\vae\qwen_image_vae.safetensors --llm ..\models\text_encoders\qwen_3_06b_base.safetensors -p "a lovely cat holding a sign says 'anima.cpp'" --cfg-scale 6.0 --sampling-method euler -v --offload-to-cpu ``` anima image example diff --git a/docs/animatediff.md b/docs/animatediff.md index 2e923b0bf3..80c46ae64f 100644 --- a/docs/animatediff.md +++ b/docs/animatediff.md @@ -51,7 +51,7 @@ SD 1.5 defaults (euler_a, low CFG) produces noise-like output. .\bin\Release\sd-cli.exe -M vid_gen \ --model ..\models\checkpoints\realisticVisionV60B1.safetensors \ --motion-module ..\models\animatediff\mm_sd15_v3.safetensors \ - --offload-to-cpu --diffusion-fa \ + --offload-to-cpu \ -p "a red apple on a wooden table" \ --cfg-scale 8.0 --sampling-method euler --scheduler discrete \ -H 512 -W 512 --video-frames 8 --fps 8 --steps 20 -s 42 \ @@ -66,7 +66,7 @@ use layer streaming: .\bin\Release\sd-cli.exe -M vid_gen \ --model ..\models\checkpoints\realisticVisionV60B1.safetensors \ --motion-module ..\models\animatediff\mm_sd15_v3.safetensors \ - --offload-to-cpu --diffusion-fa \ + --offload-to-cpu \ -p "photo of coastline, rocks, storm weather, wind, waves, lightning" \ --cfg-scale 8.0 --sampling-method euler --scheduler discrete \ -H 384 -W 384 --video-frames 16 --fps 8 --steps 20 -s 42 \ @@ -79,7 +79,7 @@ Low-VRAM streaming (verified with a 2 GiB cap on RTX 3060): .\bin\Release\sd-cli.exe -M vid_gen \ --model ..\models\checkpoints\realisticVisionV60B1.safetensors \ --motion-module ..\models\animatediff\mm_sd15_v3.safetensors \ - --max-vram 2.0 --diffusion-fa \ + --max-vram 2.0 \ -p "photo of coastline, rocks, storm weather, wind, waves, lightning" \ --cfg-scale 8.0 --sampling-method euler --scheduler discrete \ -H 384 -W 384 --video-frames 8 --fps 8 --steps 20 -s 42 \ diff --git a/docs/backend.md b/docs/backend.md index 70eef34f8f..c5d98f0e89 100644 --- a/docs/backend.md +++ b/docs/backend.md @@ -215,6 +215,123 @@ If a VAE decode fails, decoding retries with spatial tiling even when `--auto-fi is off; supported video decoders try temporal tiling first and can then add spatial tiling. Spatial retries use half-size tiles along each latent dimension. +## Direct convolution (`--conv-direct on|off|auto`) + +`--conv-direct` defaults to `auto` and accepts module assignments for +`diffusion`, `vae` (including preview VAE), and `controlnet`, using the same +aliases and precedence rules as `--flash-attn`: + +```shell +sd-cli -m model.safetensors -p "a cat" --conv-direct auto,vae=off +sd-cli -m model.safetensors -p "a cat" --conv-direct off,diffusion=on +``` + +- `on` requests direct 2D and 3D convolution. +- `off` uses the existing im2col-based convolution paths. +- `auto` first checks support for a representative F16-weight/F32-input direct + convolution graph. Vulkan then benchmarks direct convolution against im2col + using two small shapes per dimension, with warmup, output validation, and five + interleaved measurements per shape. Direct convolution must improve the sum of + median times by at least 5%; a failed probe defaults to `off`. + Other backends retain their implicit GEMM checks without benchmarking: + CUDA 2D requires a compiled Turing-or-newer MMA architecture; HIP 2D requires + the supported CDNA MFMA or RDNA WMMA architectures described below for flash + attention. MUSA 2D has a SIMT implementation. CUDA, HIP, and MUSA 3D also have + a SIMT implementation, so they do not require MMA. Other backends default to + `off`. Results and decision logs are cached per compute backend and dimension + in the context, as with flash attention. Each dimension is selected independently, + and all compute devices in a module must qualify. Parameter-storage devices do + not affect this choice. + +These are backend-level defaults. GGML still chooses the actual kernel based on +weight type, shape, and hardware; enabling direct convolution does not guarantee +that every operation uses implicit GEMM. The CUDA-family implicit GEMM paths +require F16 weights and can use ordinary direct kernels for other cases. +This option does not change the separately created image upscaler context. + +Repeating `--conv-direct` replaces the previous assignment string. Existing +`--diffusion-conv-direct` (diffusion and ControlNet) and `--vae-conv-direct` +flags are deprecated and emit a warning, but remain supported when +`--conv-direct` is omitted. Use `--conv-direct auto,diffusion=on,controlnet=on` +and `--conv-direct auto,vae=on`, respectively. An explicit +`--conv-direct` takes precedence over both legacy flags regardless of order. +Library callers can set the appended `sd_ctx_params_t::conv_direct_mode` field +to the same string; null or empty selects `auto` while honoring legacy true +flags. The context copies the string. + +## Flash attention (`--flash-attn on|off|auto`) + +`--flash-attn` defaults to `auto`. Selection happens while creating the model +context, before inference, and is cached once per compute backend in that context. +Parameter-storage backends are not benchmarked. + +The option also accepts module assignments, using the same module aliases as +`--backend`: + +```shell +sd-cli -m model.safetensors -p "a cat" --flash-attn auto,te=off,vae=on +sd-cli -m model.safetensors -p "a cat" --flash-attn off,diffusion=auto +``` + +Supported modules are `diffusion`, `te`, `clip_vision`, `vae`, `controlnet`, and +`audio_encoder`. Modules without an assignment use the default (`auto` if no +default is supplied). A bare mode or `all=`, `default=`, or `*=` sets the default; +module-specific settings take precedence regardless of their position. Within +one assignment string, the last setting for the same module or default wins. +Repeating `--flash-attn` replaces the entire previous string. + +Only modules set to `auto` need backend probing. An explicit `on` or `off` for +one module does not change another module's decision, even when they share a +backend. Modules without configurable attention are rejected instead of silently +ignoring their settings. + +- `on` requests flash attention for all models. Unsupported attention operations + still fall back to ordinary attention. +- `off` disables flash attention, including the flash-attention fallback from + SageAttention. SageAttention itself remains controlled by `--sage-attn`. +- `auto` enables CPU and supported CUDA MMA configurations without timing a + benchmark. CUDA uses both the device's capability and the compiled GGML + architectures. HIP also skips timing on known CDNA MFMA architectures + (`gfx908`, `gfx90a`, `gfx940`/`gfx941`/`gfx942`, `gfx950`) and RDNA 3/3.5/4 + WMMA architectures (`gfx11xx`/`gfx12xx`). The CDNA shortcut requires + `GGML_HIP_MMQ_MFMA` to be enabled at build time. All shortcuts still check + support for the FA probe graph. Vulkan devices whose description identifies + NVIDIA RTX hardware (GeForce RTX, TITAN RTX, Quadro RTX and professional RTX) + also skip timing. This is a device-name heuristic and needs no CUDA runtime. + Unsupported graphs are disabled; other configurations, including older or + unknown HIP architectures and other Vulkan devices, are benchmarked. + +The probe compares ordinary and flash attention through the same attention +builder used by models, including layout conversion and F16 conversion. It uses +two small self-attention graphs (512 tokens with head size 64, and 1024 tokens +with head size 128, both with four heads), checks their outputs, warms up each +path, then alternates five synchronized measurements. Flash attention is enabled +when the sum of its median times is at least 5% lower. These representative +shapes are a startup heuristic, not a guarantee for every model or resolution. +Allocation/execution failures and inconclusive probes select `off`. Timing stops +starting new measurement pairs after one second of measured computation; +backend initialization, warmup and an in-flight pair can take longer. + +Different modules can select different results. A multi-device model enables +flash attention only if all of its compute devices select `on`, preserving the +model's existing single boolean setting. This conservative rule also covers +row-split configurations, which can fall back to layer split during initialization. + +`--fa` and `--diffusion-fa` are deprecated and emit a warning when used. +Use `--flash-attn on` and `--flash-attn off,diffusion=on`, respectively. +Both aliases write the same mode string as `--flash-attn`; the last occurrence +of any of these options wins. Library callers +can set `sd_ctx_params_t::flash_attn_mode` to the same string, including +`"on"`, `"off"`, `"auto"`, or `"auto,te=off,vae=on"`. +A null or empty string uses automatic selection unless a +legacy `flash_attn` or `diffusion_flash_attn` boolean is set. The context copies +the string; no new enum is required. + +```shell +sd-cli -m model.safetensors -p "a cat" --flash-attn auto +sd-cli -m model.safetensors -p "a cat" --flash-attn off +``` + ## Modules | Module | Purpose | Accepted names | diff --git a/docs/backend_probe.md b/docs/backend_probe.md new file mode 100644 index 0000000000..c420326d4c --- /dev/null +++ b/docs/backend_probe.md @@ -0,0 +1,50 @@ +# Adding backend performance probes + +`src/core/probe/backend_probe.h` provides the shared measurement machinery. Operator +policy stays separate: `src/core/probe/flash_attn.cpp`, for example, defines attention +shapes and its CPU/CUDA/HIP/Vulkan shortcuts, then calls `sd_run_backend_probe` for unknown +configurations. `src/core/probe/conv_direct.cpp` uses metadata-only probe graphs +to check direct 2D/3D convolution support, then enables known implicit GEMM +paths on non-Vulkan backends. Vulkan compares direct convolution with im2col +using the shared measurement machinery. + +For each representative shape, create a `BackendProbeCase`: + +- `build(graph, candidate)` creates inputs and either the reference or candidate + graph in `graph.ctx`, registers input tensors in `graph.inputs`, and assigns + `graph.output`. Leave the output null if the requested implementation is + unavailable; do not silently benchmark its fallback as the candidate. +- By default, inputs receive deterministic F32 data, with the same seed for both + variants. Supply `initialize` for F16 convolution weights, integer inputs, or + operator-specific values. It runs after allocation, outside timed execution. + Both variants must receive equivalent logical inputs. +- Default output validation requires matching shapes and contiguous F32 outputs, + checks finiteness, and applies absolute and relative tolerances. Supply + `compare` for other output types or validation rules. + +Graphs must be safe to execute repeatedly without modifying their inputs. +`BackendProbeGraph` owns its GGML context and buffer, so all return paths release +probe resources. Constructors allocate metadata only; `supported()` can also be +used before a known-architecture shortcut, without allocating device tensors. + +`BackendProbeOptions` controls graph metadata capacity, warmup count, measurement +count, measured-time budget, minimum free device memory, comparison tolerances, +and minimum improvement. Warmup and allocation are excluded from timing. The +runner alternates the two variants, synchronizes the backend around execution, +and compares sums of per-case medians. The time budget is checked before each +measurement pair; it cannot interrupt an in-flight backend operation. + +Only use `candidate_faster` when `completed` is true. On incomplete probes, +`error` reports why comparison failed and the timing totals may be partial. +The caller handles logging, known architecture rules, fallback policy, and +context-lifetime caching. Keep caches separate by operation (or key a shared +cache by both operation and backend); an attention result must not select a +convolution implementation. If shapes or settings vary within one context, +include them in the corresponding cache key as well. + +Convolution results are cached separately for 2D and 3D, once per compute backend +in the context, just like attention results. Each probe logs its backend, decision, +and reason; mixed-device modules log when their compute devices disagree. + +Module assignment parsing remains in `src/core/ggml_extend_backend.cpp`, next +to backend assignment parsing. The probe directory does not parse CLI/API options. diff --git a/docs/boogu_image.md b/docs/boogu_image.md index 2744aae57a..c5ad97dd85 100644 --- a/docs/boogu_image.md +++ b/docs/boogu_image.md @@ -17,7 +17,7 @@ Boogu Image uses a Boogu diffusion transformer, the FLUX VAE, and Qwen3-VL as th ### Boogu Image Base ``` -.\bin\Release\sd-cli.exe --diffusion-model ..\models\diffusion_models\boogu_image_base_bf16.safetensors --llm ..\models\text_encoders\Qwen3VL-8B-Instruct-Q4_K_M.gguf --vae ..\models\vae\ae.sft -p "a lovely cat" --diffusion-fa -v --offload-to-cpu +.\bin\Release\sd-cli.exe --diffusion-model ..\models\diffusion_models\boogu_image_base_bf16.safetensors --llm ..\models\text_encoders\Qwen3VL-8B-Instruct-Q4_K_M.gguf --vae ..\models\vae\ae.sft -p "a lovely cat" -v --offload-to-cpu ``` Boogu Image Base example @@ -25,7 +25,7 @@ Boogu Image uses a Boogu diffusion transformer, the FLUX VAE, and Qwen3-VL as th ### Boogu Image Edit ``` -.\bin\Release\sd-cli.exe --diffusion-model ..\models\diffusion_models\boogu_image_edit_bf16.safetensors --llm ..\models\text_encoders\Qwen3VL-8B-Instruct-Q4_K_M.gguf --llm_vision ..\models\text_encoders\mmproj-Qwen3VL-8B-Instruct-F16.gguf --vae ..\models\vae\ae.sft --diffusion-fa -v --offload-to-cpu -r ..\assets\flux\flux1-dev-q8_0.png -p "change 'flux.cpp' to 'boogu.cpp'" +.\bin\Release\sd-cli.exe --diffusion-model ..\models\diffusion_models\boogu_image_edit_bf16.safetensors --llm ..\models\text_encoders\Qwen3VL-8B-Instruct-Q4_K_M.gguf --llm_vision ..\models\text_encoders\mmproj-Qwen3VL-8B-Instruct-F16.gguf --vae ..\models\vae\ae.sft -v --offload-to-cpu -r ..\assets\flux\flux1-dev-q8_0.png -p "change 'flux.cpp' to 'boogu.cpp'" ``` Boogu Image Edit example \ No newline at end of file diff --git a/docs/build.md b/docs/build.md index 9daaa219b4..6ec0e40f0a 100644 --- a/docs/build.md +++ b/docs/build.md @@ -119,14 +119,16 @@ cmake --build . --config Release ## Build with MUSA -This provides GPU acceleration using Moore Threads GPU. Make sure to have the MUSA toolkit installed. +This provides GPU acceleration using Moore Threads GPUs. The configuration below follows upstream validation with MUSA SDK 5.2.0 and MTT S5000 (PH1, `mp_31`). Install that toolkit before building. Older SDKs such as 4.2 may lack the CUB headers required by the current backend. ```shell mkdir build && cd build -cmake .. -DCMAKE_C_COMPILER=/usr/local/musa/bin/clang -DCMAKE_CXX_COMPILER=/usr/local/musa/bin/clang++ -DSD_MUSA=ON -DCMAKE_BUILD_TYPE=Release +cmake .. -DCMAKE_C_COMPILER=/usr/local/musa/bin/clang -DCMAKE_CXX_COMPILER=/usr/local/musa/bin/clang++ -DSD_MUSA=ON -DMUSA_ARCHITECTURES=31 -DCMAKE_BUILD_TYPE=Release cmake --build . --config Release ``` +The MUSA Docker image uses the same SDK 5.2.0 development image as upstream for both build and runtime stages, and targets `mp_31` only. It includes the development tools and PyTorch from that base image, so it is larger than a minimal runtime image. Other GPU architectures require separate validation. + ## Build with Metal Using Metal makes the computation run on the GPU. Currently, there are some issues with Metal when performing operations on very large matrices, making it highly inefficient at the moment. Performance improvements are expected in the near future. diff --git a/docs/docker.md b/docs/docker.md index 5bacdd2d4b..28e9ab5dfa 100644 --- a/docs/docker.md +++ b/docs/docker.md @@ -24,12 +24,25 @@ docker build -f docker/Dockerfile -t sd . ## Building variants using Docker -Vulkan: +### Vulkan: ```shell docker build -f docker/Dockerfile.vulkan -t sd . ``` +### ROCm (AMD GPU): + +Defining one or multiple targets with `--build-arg AMDGPU_TARGETS` is strongly recommended. +Building the image will otherwise likely fail or build for a target that does not fit your +hardware. + +```shell +# Build for one target +docker build -f docker/Dockerfile.rocm --build-arg "AMDGPU_TARGETS=gfx1100" -t sd . +# Build for multiple targets +docker build -f docker/Dockerfile.rocm --build-arg "AMDGPU_TARGETS=gfx1030;gfx1100" -t sd . +``` + ## Run locally built image's CLI ```shell @@ -37,3 +50,21 @@ docker run --rm -v /path/to/models:/models -v /path/to/output/:/output sd [args. # For example # docker run --rm -v ./models:/models -v ./build:/output sd -m /models/sd-v1-4.ckpt -p "a lovely cat" -v -o /output/output.png ``` + +### ROCm (AMD GPU) + +The user that executes this command needs to be in the `video` group and have read and write +access to `/dev/dri` and `/dev/kfd`. + +`--device` and `--group-add` allow the container access to the GPU. + +```shell +docker run --rm --device=/dev/dri --device=/dev/kfd --group-add video \ + -v /path/to/models:/models -v /path/to/output/:/output \ + sd [args...] +# For example +# docker run --rm --device=/dev/dri --device=/dev/kfd --group-add video \ +# -v ./models:/models -v ./build:/output \ +# sd -m /models/sd-v1-4.ckpt -v -o /output/output.png \ +# -p "a lovely cat" +``` \ No newline at end of file diff --git a/docs/edit.md b/docs/edit.md index 0bd3b56200..62ecff2af5 100644 --- a/docs/edit.md +++ b/docs/edit.md @@ -14,6 +14,7 @@ Depending on the architecture, different models handle reference images differen | [**Qwen Image Edit**](./qwen_image_edit.md) | `qwen` | | **Qwen Image LAYERED** | `qwen_layered` | | [**Flux.2 [Dev] / Flux.2 [Klein]**](./flux2.md) | `flux2` | +| [**FLUX.3 Image Klein / Klein Base**](./flux3.md) | `flux2` | | [**Boogu Image Edit**](./boogu_image.md) | `z_image_omni` | | **Krea2 (Community Edit LoRAs)** | `krea2_ostris_edit` | | [**Mage-Flow-Edit**](./mage_flow.md#image-editing) | `mage_flow` | diff --git a/docs/ernie_image.md b/docs/ernie_image.md index 99f942211e..3b1fc124cb 100644 --- a/docs/ernie_image.md +++ b/docs/ernie_image.md @@ -21,7 +21,7 @@ You can run ERNIE-Image with stable-diffusion.cpp on GPUs with 4GB of VRAM — o ### ERNIE-Image-Turbo ``` -.\bin\Release\sd-cli.exe --diffusion-model ..\models\diffusion_models\ernie-image-turbo.safetensors --vae ..\models\vae\flux2_ae.safetensors --llm ..\models\text_encoders\ministral-3-3b.safetensors -p "a lovely cat" --cfg-scale 1.0 --steps 8 -v --offload-to-cpu --diffusion-fa +.\bin\Release\sd-cli.exe --diffusion-model ..\models\diffusion_models\ernie-image-turbo.safetensors --vae ..\models\vae\flux2_ae.safetensors --llm ..\models\text_encoders\ministral-3-3b.safetensors -p "a lovely cat" --cfg-scale 1.0 --steps 8 -v --offload-to-cpu ``` ERNIE-Image Turbo example @@ -29,7 +29,7 @@ You can run ERNIE-Image with stable-diffusion.cpp on GPUs with 4GB of VRAM — o ### ERNIE-Image ``` -.\bin\Release\sd-cli.exe --diffusion-model ..\models\diffusion_models\ernie-image-UD-Q4_K_M.gguf --vae ..\models\vae\flux2_ae.safetensors --llm ..\models\text_encoders\ministral-3-3b.safetensors -p "a lovely cat" --cfg-scale 5.0 -v --offload-to-cpu --diffusion-fa +.\bin\Release\sd-cli.exe --diffusion-model ..\models\diffusion_models\ernie-image-UD-Q4_K_M.gguf --vae ..\models\vae\flux2_ae.safetensors --llm ..\models\text_encoders\ministral-3-3b.safetensors -p "a lovely cat" --cfg-scale 5.0 -v --offload-to-cpu ``` ERNIE-Image example diff --git a/docs/esrgan.md b/docs/esrgan.md index 708f49bad7..4068ef11c7 100644 --- a/docs/esrgan.md +++ b/docs/esrgan.md @@ -2,7 +2,9 @@ You can use ESRGAN—such as the model [RealESRGAN_x4plus_anime_6B.pth](https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.2.4/RealESRGAN_x4plus_anime_6B.pth)—to upscale the generated images and improve their overall resolution and clarity. -RGBA images, including Qwen Image 2.1 output, keep their alpha channel during model upscaling and hires fix. ESRGAN processes the RGB channels; the alpha channel is resized with bilinear interpolation and recombined with the upscaled image. +MoSR models with the PixelShuffle upsampler, such as [4xNomos2_hq_mosr.pth](https://github.com/Phhofm/models/releases/download/4xNomos2_hq_mosr/4xNomos2_hq_mosr.pth), are also supported. The architecture is detected from the weights, so they are used the same way as ESRGAN models. + +RGBA images, including Qwen Image 2.1 output, keep their alpha channel during model upscaling and hires fix. The upscaler processes the RGB channels; the alpha channel is resized with bilinear interpolation and recombined with the upscaled image. - Specify the model path using the `--upscale-model PATH` parameter. example: diff --git a/docs/flux2.md b/docs/flux2.md index d3b2eff1f0..53fc8be5cf 100644 --- a/docs/flux2.md +++ b/docs/flux2.md @@ -16,7 +16,7 @@ ### Examples ``` -.\bin\Release\sd-cli.exe --diffusion-model ..\models\diffusion_models\flux2-dev-Q4_K_S.gguf --vae ..\models\vae\flux2_ae.safetensors --llm ..\models\text_encoders\Mistral-Small-3.2-24B-Instruct-2506-Q4_K_M.gguf -r .\kontext_input.png -p "change 'flux.cpp' to 'flux2-dev.cpp'" --cfg-scale 1.0 --sampling-method euler -v --diffusion-fa --offload-to-cpu +.\bin\Release\sd-cli.exe --diffusion-model ..\models\diffusion_models\flux2-dev-Q4_K_S.gguf --vae ..\models\vae\flux2_ae.safetensors --llm ..\models\text_encoders\Mistral-Small-3.2-24B-Instruct-2506-Q4_K_M.gguf -r .\kontext_input.png -p "change 'flux.cpp' to 'flux2-dev.cpp'" --cfg-scale 1.0 --sampling-method euler -v --offload-to-cpu ``` flux2 example @@ -42,19 +42,19 @@ ### Examples ``` -.\bin\Release\sd-cli.exe --diffusion-model ..\models\diffusion_models\flux-2-klein-4b.safetensors --vae ..\models\vae\flux2_ae.safetensors --llm ..\models\text_encoders\qwen_3_4b.safetensors -p "a lovely cat" --cfg-scale 1.0 --steps 4 -v --offload-to-cpu --diffusion-fa +.\bin\Release\sd-cli.exe --diffusion-model ..\models\diffusion_models\flux-2-klein-4b.safetensors --vae ..\models\vae\flux2_ae.safetensors --llm ..\models\text_encoders\qwen_3_4b.safetensors -p "a lovely cat" --cfg-scale 1.0 --steps 4 -v --offload-to-cpu ``` flux2-klein-4b ``` -.\bin\Release\sd-cli.exe --diffusion-model ..\models\diffusion_models\flux-2-klein-4b.safetensors --vae ..\models\vae\flux2_ae.safetensors --llm ..\models\text_encoders\qwen_3_4b.safetensors -r .\kontext_input.png -p "change 'flux.cpp' to 'klein.cpp'" --cfg-scale 1.0 --sampling-method euler -v --diffusion-fa --offload-to-cpu --steps 4 +.\bin\Release\sd-cli.exe --diffusion-model ..\models\diffusion_models\flux-2-klein-4b.safetensors --vae ..\models\vae\flux2_ae.safetensors --llm ..\models\text_encoders\qwen_3_4b.safetensors -r .\kontext_input.png -p "change 'flux.cpp' to 'klein.cpp'" --cfg-scale 1.0 --sampling-method euler -v --offload-to-cpu --steps 4 ``` flux2-klein-4b-edit ``` -.\bin\Release\sd-cli.exe --diffusion-model ..\models\diffusion_models\flux-2-klein-base-4b.safetensors --vae ..\models\vae\flux2_ae.safetensors --llm ..\models\text_encoders\qwen_3_4b.safetensors -p "a lovely cat" --cfg-scale 4.0 --steps 20 -v --offload-to-cpu --diffusion-fa +.\bin\Release\sd-cli.exe --diffusion-model ..\models\diffusion_models\flux-2-klein-base-4b.safetensors --vae ..\models\vae\flux2_ae.safetensors --llm ..\models\text_encoders\qwen_3_4b.safetensors -p "a lovely cat" --cfg-scale 4.0 --steps 20 -v --offload-to-cpu ``` flux2-klein-base-4b @@ -78,19 +78,19 @@ ### Examples ``` -.\bin\Release\sd-cli.exe --diffusion-model ..\models\diffusion_models\flux-2-klein-9b.safetensors --vae ..\models\vae\flux2_ae.safetensors --llm ..\models\text_encoders\qwen_3_8b.safetensors -p "a lovely cat" --cfg-scale 1.0 --steps 4 -v --offload-to-cpu --diffusion-fa +.\bin\Release\sd-cli.exe --diffusion-model ..\models\diffusion_models\flux-2-klein-9b.safetensors --vae ..\models\vae\flux2_ae.safetensors --llm ..\models\text_encoders\qwen_3_8b.safetensors -p "a lovely cat" --cfg-scale 1.0 --steps 4 -v --offload-to-cpu ``` flux2-klein-9b ``` -.\bin\Release\sd-cli.exe --diffusion-model ..\models\diffusion_models\flux-2-klein-9b.safetensors --vae ..\models\vae\flux2_ae.safetensors --llm ..\models\text_encoders\qwen_3_8b.safetensors -r .\kontext_input.png -p "change 'flux.cpp' to 'klein.cpp'" --cfg-scale 1.0 --sampling-method euler -v --diffusion-fa --offload-to-cpu --steps 4 +.\bin\Release\sd-cli.exe --diffusion-model ..\models\diffusion_models\flux-2-klein-9b.safetensors --vae ..\models\vae\flux2_ae.safetensors --llm ..\models\text_encoders\qwen_3_8b.safetensors -r .\kontext_input.png -p "change 'flux.cpp' to 'klein.cpp'" --cfg-scale 1.0 --sampling-method euler -v --offload-to-cpu --steps 4 ``` flux2-klein-9b-edit ``` -.\bin\Release\sd-cli.exe --diffusion-model ..\models\diffusion_models\flux-2-klein-base-9b.safetensors --vae ..\models\vae\flux2_ae.safetensors --llm ..\models\text_encoders\qwen_3_8b.safetensors -p "a lovely cat" --cfg-scale 4.0 --steps 20 -v --offload-to-cpu --diffusion-fa +.\bin\Release\sd-cli.exe --diffusion-model ..\models\diffusion_models\flux-2-klein-base-9b.safetensors --vae ..\models\vae\flux2_ae.safetensors --llm ..\models\text_encoders\qwen_3_8b.safetensors -p "a lovely cat" --cfg-scale 4.0 --steps 20 -v --offload-to-cpu ``` flux2-klein-base-9b \ No newline at end of file diff --git a/docs/flux3.md b/docs/flux3.md new file mode 100644 index 0000000000..8bc0b2ec29 --- /dev/null +++ b/docs/flux3.md @@ -0,0 +1,50 @@ +# How to Use + +FLUX.3 Image Klein uses a FLUX.3 diffusion transformer, the FLUX.2 VAE, and Qwen3-VL 4B as the LLM text encoder. + +## Download weights + +- Download FLUX.3 Image Klein + - safetensors: https://huggingface.co/black-forest-labs/flux-3-image-klein/tree/main + - gguf: https://huggingface.co/leejet/flux-3-image-klein-GGUF/tree/main +- Download FLUX.3 Image Klein Base + - safetensors: https://huggingface.co/black-forest-labs/flux-3-image-klein-base/tree/main + - gguf: https://huggingface.co/leejet/flux-3-image-klein-base-GGUF/tree/main +- Download vae + - safetensors: https://huggingface.co/black-forest-labs/FLUX.2-dev/tree/main + - The `ae.safetensors` included with FLUX.3 can also be used. +- Download Qwen3-VL 4B + - safetensors: https://huggingface.co/Comfy-Org/Krea-2/tree/main/text_encoders + - gguf: https://huggingface.co/Qwen/Qwen3-VL-4B-Instruct-GGUF/tree/main + +Use the root `model.safetensors` for the diffusion model. + +## Examples + +### FLUX.3 Image Klein + +The distilled model uses 16 steps and CFG 1.0. + +``` +.\bin\Release\sd-cli.exe --diffusion-model ..\models\diffusion_models\flux-3-image-klein.safetensors --llm ..\models\text_encoders\Qwen3-VL-4B-Instruct-Q4_K_M.gguf --vae ..\models\vae\flux2_ae.safetensors -p "a lovely cat holding a sign says 'flux3.cpp'" --cfg-scale 1.0 --steps 16 --sampling-method euler -v --offload-to-cpu +``` + + + +``` +.\bin\Release\sd-cli.exe --diffusion-model ..\models\diffusion_models\flux-3-image-klein.safetensors --vae ..\models\vae\flux2_ae.safetensors --llm ..\models\text_encoders\Qwen3-VL-4B-Instruct-Q4_K_M.gguf -r ..\assets\flux\flux1-dev-q8_0.png -p "change 'flux.cpp' to 'flux3-image-klein.cpp'" --cfg-scale 1.0 --sampling-method euler -v --offload-to-cpu --steps 16 +``` + + + +Repeat `-r` to use multiple reference images, up to 10. See [Image Editing](./edit.md) for reference-image preprocessing options. + +### FLUX.3 Image Klein Base + +``` +.\bin\Release\sd-cli.exe --diffusion-model ..\models\diffusion_models\flux-3-image-klein-base.safetensors --llm ..\models\text_encoders\Qwen3-VL-4B-Instruct-Q4_K_M.gguf --vae ..\models\vae\flux2_ae.safetensors -p "a lovely cat holding a sign says 'flux3.cpp'" --cfg-scale 3.5 --steps 20 --sampling-method euler -v --offload-to-cpu +``` + + + +The default discrete scheduler uses the upstream time shift of 6.93 for both models. Use `--flow-shift` to override it. diff --git a/docs/hunyuan_video.md b/docs/hunyuan_video.md index 2b05e0f718..fadb884ef4 100644 --- a/docs/hunyuan_video.md +++ b/docs/hunyuan_video.md @@ -18,7 +18,7 @@ and ByT5 Small GlyphXL for glyph-aware text conditioning. ## Text-to-video example ```shell -.\bin\Release\sd-cli.exe -M vid_gen --diffusion-model ..\models\diffusion_models\hunyuanvideo1.5_720p_t2v_fp16.safetensors --vae ..\models\vae\hunyuanvideo15_vae_fp16.safetensors --llm ..\models\text_encoders\qwen_2.5_vl_7b.safetensors --t5xxl ..\models\text_encoders\byt5_small_glyphxl_fp16.safetensors -p "a lovely cat" --cfg-scale 6.0 --sampling-method euler -v -W 1280 -H 720 --offload-to-cpu --diffusion-fa --video-frames 33 --vae-tiling +.\bin\Release\sd-cli.exe -M vid_gen --diffusion-model ..\models\diffusion_models\hunyuanvideo1.5_720p_t2v_fp16.safetensors --vae ..\models\vae\hunyuanvideo15_vae_fp16.safetensors --llm ..\models\text_encoders\qwen_2.5_vl_7b.safetensors --t5xxl ..\models\text_encoders\byt5_small_glyphxl_fp16.safetensors -p "a lovely cat" --cfg-scale 6.0 --sampling-method euler -v -W 1280 -H 720 --offload-to-cpu --video-frames 33 --vae-tiling ``` \ No newline at end of file diff --git a/docs/ideogram4.md b/docs/ideogram4.md index 003a02d594..f0f1dd2500 100644 --- a/docs/ideogram4.md +++ b/docs/ideogram4.md @@ -49,7 +49,7 @@ If you want lower VRAM usage, you can change the quantization from q8_0 to a low ## Examples ```sh -.\bin\Release\sd-cli.exe --diffusion-model ideogram4-Q8_0.gguf --uncond-diffusion-model ideogram4_uncond-Q8_0.gguf --llm ..\models\text_encoders\Qwen3VL-8B-Instruct-Q4_K_M.gguf --vae ..\models\vae\flux2_ae.safetensors -p '{"high_level_description":"A square 1024 x 1024 luxury fashion magazine cover featuring exactly one short chubby fluffy cat as the main model. The cat sits on a soft ivory studio floor, facing the viewer with a stylish calm expression, wearing tiny black sunglasses, a red silk scarf, and a small gold collar charm. In front of the cat on the floor is a wide horizontal luxury nameplate that clearly reads ideogram4.cpp. The whole design feels premium, fashionable, clean, and editorial.","style_description":{"aesthetics":"luxury fashion magazine cover, high-end pet couture campaign, minimalist editorial design, elegant studio photography, soft paper texture, refined typography, fashionable and polished","lighting":"Soft diffused studio lighting, gentle spotlight on the cat, subtle floor shadow, warm ivory highlights, clean separation between subject and background","photo":"high-resolution fashion editorial photography look, front-facing cat portrait, crisp fur details, glossy sunglasses, clear readable nameplate text, shallow depth of field","medium":"mixed media fashion photography and premium editorial graphic design","color_palette":["#F4EFE7","#111111","#D8B56D","#B73A3A","#FFFFFF","#8A7A6A"]},"compositional_deconstruction":{"canvas":"Square 1024 x 1024 canvas with a normal upright orientation. Do not rotate the poster or any text. Use a clean fashion magazine cover layout.","background":"Warm ivory studio backdrop with subtle paper grain, a soft spotlight gradient, faint floor shadow, and a few minimal gold editorial lines. The background is spacious, premium, and uncluttered.","layout":"Top center has a small elegant headline. Center area features one cat as the main fashion model. Lower foreground has a wide horizontal luxury nameplate placed on the floor in front of the cat. Bottom center has a small footer. All text is horizontal, upright, and readable left to right.","elements":[{"type":"text","desc":"Top center headline reading LOOK WHAT I FOUND in a refined high-fashion serif font. The headline is horizontal, centered, elegant, and secondary to the nameplate text."},{"type":"obj","desc":"Exactly one short chubby fluffy cat sitting in the center like a luxury fashion model. The cat has a large round head, compact body, short legs, soft detailed fur, expressive eyes, and a calm confident pose. The cat is cute and rounded, not tall, not stretched, not duplicated."},{"type":"obj","desc":"Tiny glossy black sunglasses worn naturally by the cat, slightly oversized but still showing the cat face clearly. The sunglasses add a chic fashion-editorial attitude."},{"type":"obj","desc":"A red silk scarf tied neatly around the cat neck, with soft folds and a couture feeling. The scarf must not cover the cat face or the nameplate."},{"type":"obj","desc":"A small gold collar charm or fashion accessory under the scarf, subtle and premium, adding a luxury campaign detail."},{"type":"obj","desc":"In the lower foreground, place a wide horizontal luxury nameplate on the floor in front of the cat. The nameplate is low, flat, landscape-oriented, much wider than tall, like a fashion show seat card or premium display plaque. It is centered, front-facing, level, and fully visible. It must not become vertical, tall, standing, rotated, or side-facing."},{"type":"text","desc":"Print the exact text ideogram4.cpp only on the wide horizontal nameplate. Use clean bold black lettering, perfectly spelled, lowercase, with the number 4 and .cpp extension. The text must fit completely inside the nameplate, stay horizontal, and be readable from left to right."},{"type":"obj","desc":"Add sparse premium editorial accents around the edges: thin gold lines, small code brackets, tiny cursor marks, subtle dots, and minimal geometric details. No extra cats, no stickers, no animal faces, no busy decorations."},{"type":"text","desc":"Bottom center footer reading tiny paws, big compile energy in a small refined monospace or editorial font. The footer is horizontal, centered, understated, and much smaller than the nameplate text."}]}}' --diffusion-fa -v --offload-to-cpu -H 1024 -W 1024 +.\bin\Release\sd-cli.exe --diffusion-model ideogram4-Q8_0.gguf --uncond-diffusion-model ideogram4_uncond-Q8_0.gguf --llm ..\models\text_encoders\Qwen3VL-8B-Instruct-Q4_K_M.gguf --vae ..\models\vae\flux2_ae.safetensors -p '{"high_level_description":"A square 1024 x 1024 luxury fashion magazine cover featuring exactly one short chubby fluffy cat as the main model. The cat sits on a soft ivory studio floor, facing the viewer with a stylish calm expression, wearing tiny black sunglasses, a red silk scarf, and a small gold collar charm. In front of the cat on the floor is a wide horizontal luxury nameplate that clearly reads ideogram4.cpp. The whole design feels premium, fashionable, clean, and editorial.","style_description":{"aesthetics":"luxury fashion magazine cover, high-end pet couture campaign, minimalist editorial design, elegant studio photography, soft paper texture, refined typography, fashionable and polished","lighting":"Soft diffused studio lighting, gentle spotlight on the cat, subtle floor shadow, warm ivory highlights, clean separation between subject and background","photo":"high-resolution fashion editorial photography look, front-facing cat portrait, crisp fur details, glossy sunglasses, clear readable nameplate text, shallow depth of field","medium":"mixed media fashion photography and premium editorial graphic design","color_palette":["#F4EFE7","#111111","#D8B56D","#B73A3A","#FFFFFF","#8A7A6A"]},"compositional_deconstruction":{"canvas":"Square 1024 x 1024 canvas with a normal upright orientation. Do not rotate the poster or any text. Use a clean fashion magazine cover layout.","background":"Warm ivory studio backdrop with subtle paper grain, a soft spotlight gradient, faint floor shadow, and a few minimal gold editorial lines. The background is spacious, premium, and uncluttered.","layout":"Top center has a small elegant headline. Center area features one cat as the main fashion model. Lower foreground has a wide horizontal luxury nameplate placed on the floor in front of the cat. Bottom center has a small footer. All text is horizontal, upright, and readable left to right.","elements":[{"type":"text","desc":"Top center headline reading LOOK WHAT I FOUND in a refined high-fashion serif font. The headline is horizontal, centered, elegant, and secondary to the nameplate text."},{"type":"obj","desc":"Exactly one short chubby fluffy cat sitting in the center like a luxury fashion model. The cat has a large round head, compact body, short legs, soft detailed fur, expressive eyes, and a calm confident pose. The cat is cute and rounded, not tall, not stretched, not duplicated."},{"type":"obj","desc":"Tiny glossy black sunglasses worn naturally by the cat, slightly oversized but still showing the cat face clearly. The sunglasses add a chic fashion-editorial attitude."},{"type":"obj","desc":"A red silk scarf tied neatly around the cat neck, with soft folds and a couture feeling. The scarf must not cover the cat face or the nameplate."},{"type":"obj","desc":"A small gold collar charm or fashion accessory under the scarf, subtle and premium, adding a luxury campaign detail."},{"type":"obj","desc":"In the lower foreground, place a wide horizontal luxury nameplate on the floor in front of the cat. The nameplate is low, flat, landscape-oriented, much wider than tall, like a fashion show seat card or premium display plaque. It is centered, front-facing, level, and fully visible. It must not become vertical, tall, standing, rotated, or side-facing."},{"type":"text","desc":"Print the exact text ideogram4.cpp only on the wide horizontal nameplate. Use clean bold black lettering, perfectly spelled, lowercase, with the number 4 and .cpp extension. The text must fit completely inside the nameplate, stay horizontal, and be readable from left to right."},{"type":"obj","desc":"Add sparse premium editorial accents around the edges: thin gold lines, small code brackets, tiny cursor marks, subtle dots, and minimal geometric details. No extra cats, no stickers, no animal faces, no busy decorations."},{"type":"text","desc":"Bottom center footer reading tiny paws, big compile energy in a small refined monospace or editorial font. The footer is horizontal, centered, understated, and much smaller than the nameplate text."}]}}' -v --offload-to-cpu -H 1024 -W 1024 ``` ideogram4 image example diff --git a/docs/int8_convrot.md b/docs/int8_convrot.md index dcbda83763..04d9c4f73c 100644 --- a/docs/int8_convrot.md +++ b/docs/int8_convrot.md @@ -102,5 +102,5 @@ The dedicated CUDA and HIP convrot activation paths currently require a group si ComfyUI INT8 convrot safetensors can be passed to `--diffusion-model` without conversion: ```powershell -.\bin\Release\sd-cli.exe --diffusion-model ..\models\diffusion_models\krea2_turbo_int8_convrot.safetensors --llm ..\models\text_encoders\Qwen3-VL-4B-Instruct-Q4_K_M.gguf --vae ..\models\vae\wan_2.1_vae.safetensors -p "a lovely cat holding a sign says 'krea2.cpp'" --steps 8 --cfg-scale 1 --diffusion-fa -v --offload-to-cpu +.\bin\Release\sd-cli.exe --diffusion-model ..\models\diffusion_models\krea2_turbo_int8_convrot.safetensors --llm ..\models\text_encoders\Qwen3-VL-4B-Instruct-Q4_K_M.gguf --vae ..\models\vae\wan_2.1_vae.safetensors -p "a lovely cat holding a sign says 'krea2.cpp'" --steps 8 --cfg-scale 1 -v --offload-to-cpu ``` diff --git a/docs/ip_adapter.md b/docs/ip_adapter.md index 76a651011b..27f9ae6896 100644 --- a/docs/ip_adapter.md +++ b/docs/ip_adapter.md @@ -48,7 +48,7 @@ sd-cli -m ..\models\sd_v1.5.safetensors --clip_vision ..\models\clip_vision_h.sa ## Example (SDXL) ``` -sd-cli -m ..\models\sdxl.safetensors --clip_vision ..\models\clip_vision_h.safetensors --ip-adapter ..\models\ip-adapter_sdxl_vit-h.safetensors --ip-adapter-image ..\assets\reference.png --ip-adapter-strength 0.8 -p "a woman, best quality" -n "lowres, bad anatomy" --cfg-scale 6 --steps 25 --sampling-method dpm++2m --scheduler karras -W 1024 -H 1024 --diffusion-fa --vae-tiling +sd-cli -m ..\models\sdxl.safetensors --clip_vision ..\models\clip_vision_h.safetensors --ip-adapter ..\models\ip-adapter_sdxl_vit-h.safetensors --ip-adapter-image ..\assets\reference.png --ip-adapter-strength 0.8 -p "a woman, best quality" -n "lowres, bad anatomy" --cfg-scale 6 --steps 25 --sampling-method dpm++2m --scheduler karras -W 1024 -H 1024 --vae-tiling ``` The SDXL VAE decode at 1024x1024 is memory heavy; add `--vae-tiling` (and @@ -83,5 +83,5 @@ Add the usual Control Net options to keep the reference appearance while controlling the pose: ``` -sd-cli -m ..\models\sdxl.safetensors --clip_vision ..\models\clip_vision_h.safetensors --ip-adapter ..\models\ip-adapter_sdxl_vit-h.safetensors --ip-adapter-image ..\assets\character.png --ip-adapter-strength 0.9 --control-net ..\models\OpenPoseXL2.safetensors --control-image ..\assets\pose.png --control-strength 0.8 -p "a character, side view" --cfg-scale 6 --steps 25 -W 1024 -H 1024 --diffusion-fa --vae-tiling +sd-cli -m ..\models\sdxl.safetensors --clip_vision ..\models\clip_vision_h.safetensors --ip-adapter ..\models\ip-adapter_sdxl_vit-h.safetensors --ip-adapter-image ..\assets\character.png --ip-adapter-strength 0.9 --control-net ..\models\OpenPoseXL2.safetensors --control-image ..\assets\pose.png --control-strength 0.8 -p "a character, side view" --cfg-scale 6 --steps 25 -W 1024 -H 1024 --vae-tiling ``` diff --git a/docs/iris.md b/docs/iris.md new file mode 100644 index 0000000000..322a3da1a4 --- /dev/null +++ b/docs/iris.md @@ -0,0 +1,24 @@ +# How to Use + +Iris-3B generates images directly in pixel space and uses Qwen3-VL-4B-Instruct as the text encoder. No VAE is required. + +## Download weights + +- Download Iris-3B + - safetensors: https://huggingface.co/speridlabs/iris-3b/tree/main (`model.safetensors` in the root directory) +- Download Qwen3-VL-4B-Instruct + - safetensors: https://huggingface.co/Comfy-Org/Krea-2/tree/main/text_encoders + - gguf: https://huggingface.co/Qwen/Qwen3-VL-4B-Instruct-GGUF/tree/main + +## Examples + +``` +.\bin\Release\sd-cli.exe --diffusion-model ..\models\diffusion_models\iris-3b.safetensors --llm ..\models\text_encoders\Qwen3-VL-4B-Instruct-Q4_K_M.gguf -p "a lovely cat" --cfg-scale 3 -H 1024 -W 1024 +``` + +iris-3b example + +## Notes + +- Width and height must be multiples of 16. Do not pass `--vae`. +- Captions are limited to 300 tokens including the assistant-turn suffix. Positive and negative prompts use the same template. diff --git a/docs/krea2.md b/docs/krea2.md index 10f8eab80e..67fad023ed 100644 --- a/docs/krea2.md +++ b/docs/krea2.md @@ -21,7 +21,7 @@ Krea2 uses a Krea2 diffusion transformer, the Wan2.1 VAE, and Qwen3-VL 4B as the ### Krea2 ``` -.\bin\Release\sd-cli.exe --diffusion-model ..\models\diffusion_models\Krea-2-Raw-Q8_0.gguf --llm ..\models\text_encoders\Qwen3-VL-4B-Instruct-Q4_K_M.gguf --vae ..\models\vae\wan_2.1_vae.safetensors -p "a lovely cat holding a sign says 'krea2.cpp'" --diffusion-fa -v --offload-to-cpu +.\bin\Release\sd-cli.exe --diffusion-model ..\models\diffusion_models\Krea-2-Raw-Q8_0.gguf --llm ..\models\text_encoders\Qwen3-VL-4B-Instruct-Q4_K_M.gguf --vae ..\models\vae\wan_2.1_vae.safetensors -p "a lovely cat holding a sign says 'krea2.cpp'" -v --offload-to-cpu ``` Krea2 Raw example diff --git a/docs/lens.md b/docs/lens.md index 64dc594c47..09e9575ac9 100644 --- a/docs/lens.md +++ b/docs/lens.md @@ -22,7 +22,7 @@ Lens and Lens Turbo require an external GPT-OSS `tokenizer.json` matching the te ### Lens ``` -.\bin\Release\sd-cli.exe --diffusion-model ..\models\diffusion_models\lens_bf16.safetensors --llm "..\models\text_encoders\gpt-oss-20b-UD-Q8_K_XL.gguf" --tokenizer ..\models\tokenizers\tokenizer_gpt_oss.json --vae ..\models\vae\flux2_ae.safetensors --cfg-scale 5.0 -p "A crystal dragon soaring through an aurora borealis sky, its entire body made of transparent faceted crystal refracting the green and purple aurora light into rainbow spectra, ice particles trailing from its wings, high fantasy digital art" --diffusion-fa -v +.\bin\Release\sd-cli.exe --diffusion-model ..\models\diffusion_models\lens_bf16.safetensors --llm "..\models\text_encoders\gpt-oss-20b-UD-Q8_K_XL.gguf" --tokenizer ..\models\tokenizers\tokenizer_gpt_oss.json --vae ..\models\vae\flux2_ae.safetensors --cfg-scale 5.0 -p "A crystal dragon soaring through an aurora borealis sky, its entire body made of transparent faceted crystal refracting the green and purple aurora light into rainbow spectra, ice particles trailing from its wings, high fantasy digital art" -v ``` Lens example @@ -30,7 +30,7 @@ Lens and Lens Turbo require an external GPT-OSS `tokenizer.json` matching the te ### Lens Turbo ``` -.\bin\Release\sd-cli.exe --diffusion-model ..\models\diffusion_models\lens_turbo_bf16.safetensors --llm "..\models\text_encoders\gpt-oss-20b-UD-Q8_K_XL.gguf" --tokenizer ..\models\tokenizers\tokenizer_gpt_oss.json --vae ..\models\vae\flux2_ae.safetensors --cfg-scale 1.0 -p "A crystal dragon soaring through an aurora borealis sky, its entire body made of transparent faceted crystal refracting the green and purple aurora light into rainbow spectra, ice particles trailing from its wings, high fantasy digital art" --diffusion-fa -v --steps 4 +.\bin\Release\sd-cli.exe --diffusion-model ..\models\diffusion_models\lens_turbo_bf16.safetensors --llm "..\models\text_encoders\gpt-oss-20b-UD-Q8_K_XL.gguf" --tokenizer ..\models\tokenizers\tokenizer_gpt_oss.json --vae ..\models\vae\flux2_ae.safetensors --cfg-scale 1.0 -p "A crystal dragon soaring through an aurora borealis sky, its entire body made of transparent faceted crystal refracting the green and purple aurora light into rainbow spectra, ice particles trailing from its wings, high fantasy digital art" -v --steps 4 ``` Lens Turbo example diff --git a/docs/lingbot_video.md b/docs/lingbot_video.md index d1248bd5bc..b92165ab5f 100644 --- a/docs/lingbot_video.md +++ b/docs/lingbot_video.md @@ -28,5 +28,5 @@ Lingbot Video uses a Lingbot diffusion transformer, the Wan2.1 VAE, and Qwen3-VL ### LingBot-Video T2V ```sh -.\bin\Release\sd-cli.exe -M vid_gen --diffusion-model ..\models\diffusion_models\lingbot-video-dens-1.3b.safetensors --llm ..\models\text_encoders\Qwen3-VL-4B-Instruct-Q4_K_M.gguf --vae ..\models\vae\wan_2.1_vae.safetensors -p '{"caption":{"comprehensive_description":"A lovely cat sits comfortably on a soft cushion near a sunlit window, looking calm, gentle, and adorable. The cat has soft fluffy fur, bright expressive eyes, small rounded ears, delicate whiskers, and a relaxed posture. Warm daylight falls across the cat from one side, creating soft highlights on the fur and a cozy glow around the scene. The background is softly blurred, showing hints of a peaceful indoor home environment with warm tones and gentle natural light. The overall atmosphere is cute, tender, serene, and photorealistic, emphasizing the cat''s charming appearance, soft texture, and affectionate presence.","camera_info":{"color":"Warm","frame_size":"Close Up","shot_type_angle":"Eye level","lens_size":"Medium Lens","composition":"Centered balanced","lighting":"Soft light","lighting_type":"Daylight"},"world_knowledge":[],"prominent_elements":[{"name":"lovely cat","description":"A cute and gentle domestic cat with soft fluffy fur, expressive eyes, and a calm relaxed presence.","location":"center of the frame","relative_size":"large","shape_and_color":"Small animal body with rounded face, triangular ears, bright eyes, and soft fur in warm natural tones","texture":"soft, fluffy, silky","appearance_details":"The cat has clean well-groomed fur, delicate whiskers, small ears, a cute nose, and bright attentive eyes. Its expression appears calm, affectionate, and slightly curious.","relationship":"Acts as the main subject and emotional focal point of the scene.","orientation":"facing the camera","pose":"sitting comfortably with a relaxed posture","expression":"gentle, adorable, calm, slightly curious","clothing":"","gender":"","skin_tone_and_texture":""},{"name":"cat eyes","description":"Bright expressive eyes that give the cat a sweet and affectionate appearance.","location":"upper center of the cat face","relative_size":"small","shape_and_color":"Round almond-like eyes with glossy reflections","texture":"clear, glossy, reflective","appearance_details":"The eyes catch the soft daylight, creating small natural highlights that make the cat look vivid and alive.","relationship":"Enhance the emotional charm and cuteness of the cat.","orientation":"looking toward the camera","pose":"","expression":"soft and attentive","clothing":"","gender":"","skin_tone_and_texture":""},{"name":"soft cushion","description":"A comfortable cushion or blanket where the cat is resting.","location":"bottom portion of the frame","relative_size":"medium","shape_and_color":"Soft rounded fabric surface in light warm neutral tones","texture":"plush, fabric, cozy","appearance_details":"The cushion gently supports the cat and adds a comfortable home-like feeling to the scene.","relationship":"Provides a cozy resting place for the cat.","orientation":"horizontal","pose":"","expression":"","clothing":"","gender":"","skin_tone_and_texture":""},{"name":"sunlit indoor background","description":"A softly blurred indoor background with warm daylight and peaceful home atmosphere.","location":"behind the cat, filling the upper and side areas of the frame","relative_size":"large","shape_and_color":"Soft abstract shapes in warm beige, cream, and pale golden tones","texture":"soft, blurry, bokeh-like","appearance_details":"The background is intentionally out of focus, keeping attention on the cat while creating a cozy and serene mood.","relationship":"Provides a warm and gentle environment that supports the cute domestic scene.","orientation":"upright","pose":"","expression":"","clothing":"","gender":"","skin_tone_and_texture":"","is_cluster":true,"number_of_objects":"numerous"}]}}' -n '{"universal_negative":{"visual_quality":["low quality","worst quality","blurry","pixelated","jpeg artifacts","low resolution","unstable color","color flicker","underexposed","overexposed","invisible subject","subject hidden in darkness"],"artistic_style":["painting","illustration","drawing","cartoon","3d render","cgi","sketch","digital art"],"composition_and_content":["text","watermark","signature","logo","subtitles","pillarboxed","side bars","portrait image in landscape frame"],"temporal_and_motion_stability":["flickering","jittery","motion blur","temporal inconsistency","warping","morphing","incoherent motion","unnatural movement","static object with sudden jump","frame-to-frame inconsistency"],"material_and_structure":["plastic-like glass","unrealistic texture","deformed bottle","liquid freezing improperly","distorted reflections"]}}' --diffusion-fa --offload-to-cpu --cfg-scale 3 --video-frames 33 -v +.\bin\Release\sd-cli.exe -M vid_gen --diffusion-model ..\models\diffusion_models\lingbot-video-dens-1.3b.safetensors --llm ..\models\text_encoders\Qwen3-VL-4B-Instruct-Q4_K_M.gguf --vae ..\models\vae\wan_2.1_vae.safetensors -p '{"caption":{"comprehensive_description":"A lovely cat sits comfortably on a soft cushion near a sunlit window, looking calm, gentle, and adorable. The cat has soft fluffy fur, bright expressive eyes, small rounded ears, delicate whiskers, and a relaxed posture. Warm daylight falls across the cat from one side, creating soft highlights on the fur and a cozy glow around the scene. The background is softly blurred, showing hints of a peaceful indoor home environment with warm tones and gentle natural light. The overall atmosphere is cute, tender, serene, and photorealistic, emphasizing the cat''s charming appearance, soft texture, and affectionate presence.","camera_info":{"color":"Warm","frame_size":"Close Up","shot_type_angle":"Eye level","lens_size":"Medium Lens","composition":"Centered balanced","lighting":"Soft light","lighting_type":"Daylight"},"world_knowledge":[],"prominent_elements":[{"name":"lovely cat","description":"A cute and gentle domestic cat with soft fluffy fur, expressive eyes, and a calm relaxed presence.","location":"center of the frame","relative_size":"large","shape_and_color":"Small animal body with rounded face, triangular ears, bright eyes, and soft fur in warm natural tones","texture":"soft, fluffy, silky","appearance_details":"The cat has clean well-groomed fur, delicate whiskers, small ears, a cute nose, and bright attentive eyes. Its expression appears calm, affectionate, and slightly curious.","relationship":"Acts as the main subject and emotional focal point of the scene.","orientation":"facing the camera","pose":"sitting comfortably with a relaxed posture","expression":"gentle, adorable, calm, slightly curious","clothing":"","gender":"","skin_tone_and_texture":""},{"name":"cat eyes","description":"Bright expressive eyes that give the cat a sweet and affectionate appearance.","location":"upper center of the cat face","relative_size":"small","shape_and_color":"Round almond-like eyes with glossy reflections","texture":"clear, glossy, reflective","appearance_details":"The eyes catch the soft daylight, creating small natural highlights that make the cat look vivid and alive.","relationship":"Enhance the emotional charm and cuteness of the cat.","orientation":"looking toward the camera","pose":"","expression":"soft and attentive","clothing":"","gender":"","skin_tone_and_texture":""},{"name":"soft cushion","description":"A comfortable cushion or blanket where the cat is resting.","location":"bottom portion of the frame","relative_size":"medium","shape_and_color":"Soft rounded fabric surface in light warm neutral tones","texture":"plush, fabric, cozy","appearance_details":"The cushion gently supports the cat and adds a comfortable home-like feeling to the scene.","relationship":"Provides a cozy resting place for the cat.","orientation":"horizontal","pose":"","expression":"","clothing":"","gender":"","skin_tone_and_texture":""},{"name":"sunlit indoor background","description":"A softly blurred indoor background with warm daylight and peaceful home atmosphere.","location":"behind the cat, filling the upper and side areas of the frame","relative_size":"large","shape_and_color":"Soft abstract shapes in warm beige, cream, and pale golden tones","texture":"soft, blurry, bokeh-like","appearance_details":"The background is intentionally out of focus, keeping attention on the cat while creating a cozy and serene mood.","relationship":"Provides a warm and gentle environment that supports the cute domestic scene.","orientation":"upright","pose":"","expression":"","clothing":"","gender":"","skin_tone_and_texture":"","is_cluster":true,"number_of_objects":"numerous"}]}}' -n '{"universal_negative":{"visual_quality":["low quality","worst quality","blurry","pixelated","jpeg artifacts","low resolution","unstable color","color flicker","underexposed","overexposed","invisible subject","subject hidden in darkness"],"artistic_style":["painting","illustration","drawing","cartoon","3d render","cgi","sketch","digital art"],"composition_and_content":["text","watermark","signature","logo","subtitles","pillarboxed","side bars","portrait image in landscape frame"],"temporal_and_motion_stability":["flickering","jittery","motion blur","temporal inconsistency","warping","morphing","incoherent motion","unnatural movement","static object with sudden jump","frame-to-frame inconsistency"],"material_and_structure":["plastic-like glass","unrealistic texture","deformed bottle","liquid freezing improperly","distorted reflections"]}}' --offload-to-cpu --cfg-scale 3 --video-frames 33 -v ``` diff --git a/docs/llada_image.md b/docs/llada_image.md index 9b24158be9..d939e78cea 100644 --- a/docs/llada_image.md +++ b/docs/llada_image.md @@ -122,7 +122,6 @@ save_file(merged, "llada_connectors.safetensors") --height 1024 \ --steps 4 \ --cfg-scale 1.0 \ - --diffusion-fa \ --output output.png ``` @@ -145,7 +144,7 @@ only in the positive branch. Editing requires connectors that include the SigVQ unchanged instead of applying the instruction; LLaDA-Image-Turbo edits correctly at both. - Editing runs the reference and the target in one sequence, so it needs roughly twice the tokens of text to image at the same size. On 12 GB, editing at 1024x1024 needs - `--diffusion-fa`; without it the diffusion graph does not fit. + flash attention; without it the diffusion graph does not fit. - The weights total about 16 GB, but segmented execution streams them, so a much smaller budget works. At 512x512, `--max-vram 6` costs almost nothing over unconstrained execution, and `--max-vram 3` still produces byte-identical output at roughly 2.5x the time. diff --git a/docs/longcat_image.md b/docs/longcat_image.md index c628492277..ae730b4727 100644 --- a/docs/longcat_image.md +++ b/docs/longcat_image.md @@ -24,7 +24,7 @@ LongCat uses quoted text for character-level text rendering. Put target text ins ### LongCat Image ``` -.\bin\Release\sd-cli.exe --diffusion-model ..\models\diffusion_models\LongCat-Image-Q4_K_M.gguf --vae ..\models\vae\ae.sft --llm ..\models\text_encoders\Qwen2.5-VL-7B-Instruct-Q8_0.gguf -p "a lovely cat holding a sign says 'longcat.cpp'" --cfg-scale 5.0 --sampling-method euler --flow-shift 3 -v --offload-to-cpu --diffusion-fa +.\bin\Release\sd-cli.exe --diffusion-model ..\models\diffusion_models\LongCat-Image-Q4_K_M.gguf --vae ..\models\vae\ae.sft --llm ..\models\text_encoders\Qwen2.5-VL-7B-Instruct-Q8_0.gguf -p "a lovely cat holding a sign says 'longcat.cpp'" --cfg-scale 5.0 --sampling-method euler --flow-shift 3 -v --offload-to-cpu ``` longcat example diff --git a/docs/ltx2.md b/docs/ltx2.md index 9caa974113..e42698ffb3 100644 --- a/docs/ltx2.md +++ b/docs/ltx2.md @@ -55,7 +55,7 @@ To run the text encoder quantized, convert it once with sd-cli: ### LTX-2.3 dev T2V ``` -.\bin\Release\sd-cli.exe -M vid_gen --diffusion-model ..\models\diffusion_models\ltx-2.3-22b-dev-UD-Q4_K_M.gguf --vae ..\models\vae\ltx-2.3-22b-dev_video_vae.safetensors --audio-vae ..\models\vae\ltx-2.3-22b-dev_audio_vae.safetensors --llm ..\models\text_encoders\gemma-3-12b-it-qat-UD-Q4_K_XL.gguf --embeddings-connectors ..\models\text_encoders\ltx-2.3-22b-dev_embeddings_connectors.safetensors -p "a lovely cat" --cfg-scale 6.0 --sampling-method euler -v -n "worst quality, low quality, blurry, distorted, artifacts" -W 1280 -H 720 --diffusion-fa --offload-to-cpu --video-frames 33 --fps 24 -o t2v.webm +.\bin\Release\sd-cli.exe -M vid_gen --diffusion-model ..\models\diffusion_models\ltx-2.3-22b-dev-UD-Q4_K_M.gguf --vae ..\models\vae\ltx-2.3-22b-dev_video_vae.safetensors --audio-vae ..\models\vae\ltx-2.3-22b-dev_audio_vae.safetensors --llm ..\models\text_encoders\gemma-3-12b-it-qat-UD-Q4_K_XL.gguf --embeddings-connectors ..\models\text_encoders\ltx-2.3-22b-dev_embeddings_connectors.safetensors -p "a lovely cat" --cfg-scale 6.0 --sampling-method euler -v -n "worst quality, low quality, blurry, distorted, artifacts" -W 1280 -H 720 --offload-to-cpu --video-frames 33 --fps 24 -o t2v.webm ```