{"owner":"leejet","repo":"stable-diffusion.cpp","hasSkills":true,"hasMcp":false,"mcpConfig":null,"found":["AGENTS.md","CLAUDE.md"],"skills":{"AGENTS.md":"# Instructions for stable-diffusion.cpp\n\nThis document is for AI coding agents working in this repository. It should\ndescribe agent-specific workflow, repository routing, editing boundaries, and\nproject-specific pitfalls.\n\nFor general contribution rules, including PR scope, commit conventions, code\nstyle, dependency updates, security hygiene, and AI-assisted contribution policy,\nsee `CONTRIBUTING.md`.\n\n---\n\n## Agent Operating Rules\n\nBefore analyzing or modifying the repository:\n\n1. Read this file.\n2. Use `rg` / `rg --files` or directory listing commands to confirm the current\n   tree before relying on a path.\n3. Start from `src/` and relevant `docs/` for runtime behavior.\n4. Read the relevant code before editing.\n5. Prefer the smallest change that fits the existing architecture.\n6. Report focused verification and mention any tests not run.\n\nAgents must not:\n\n* Run `git push`, create PRs, or submit issue/PR comments on the user's behalf.\n* Create commits unless the user explicitly requests that specific commit.\n* Modify `ggml/`, `thirdparty/`, or `examples/server/frontend/` unless\n  explicitly requested and necessary.\n* Read large local model files or tokenizer vocabulary files.\n* Rewrite unrelated code for style-only reasons.\n* Add secrets, model weights, generated binaries, local absolute paths, or\n  machine-specific output.\n\nWhen a change is large, architectural, or likely to affect public behavior,\npause and present a short plan before editing.\n\n---\n\n## Repository Map and Editing Boundaries\n\nThis is a routing map for agents, not a full architecture document. The layout\ncan change, so verify paths before using them. Do not inspect excluded\nlarge-data directories while checking the tree.\n\n### Primary Project Code\n\nCore implementation lives under `src/`.\n\nCurrent source layout includes:\n\n* `src/core/` - shared tensor, ggml integration, backend, graph, RNG, and utility\n  code.\n* `src/model/` - model families and model components.\n* `src/model_io/` - model file loading, GGUF, safetensors, pickle, and related\n  serialization helpers.\n* `src/runtime/` - sampling, denoising, guidance, caching, preprocessing, and\n  runtime execution helpers.\n* `src/tokenizers/` - tokenizer implementations.\n* `src/conditioning/` - conditioning and prompt-related implementation.\n* `src/extensions/` - optional feature extensions.\n* top-level `src/*.cpp` and `src/*.h` files - public implementation entry\n  points, model loading, conversion, versioning, and shared managers.\n\n`src/tokenizers/vocab/` contains large tokenizer vocabulary data. Do not read or\nparse files in this directory; reference the path only when necessary.\n\n### Public API\n\n`include/` contains the C API exposed by the project. Currently the primary\npublic header is `include/stable-diffusion.h`.\n\nTreat public headers as stable API. Avoid breaking compatibility unless the user\nexplicitly requests it. If public behavior changes, update relevant examples or\ndocumentation.\n\n### Examples\n\n`examples/` contains programs demonstrating library usage.\n\n* `examples/cli/` - command line program for running models, testing features,\n  and debugging.\n* `examples/common/` - shared example support code.\n* `examples/server/` - server application built on top of the library.\n* `examples/server/frontend/` - git submodule containing independent frontend\n  code. Avoid modifying it unless explicitly requested.\n\n### Documentation and Tooling\n\n* `docs/` - documentation for supported models, build options, behavior, and\n  workflows.\n* `scripts/` - development, model processing, build automation, formatting, and\n  tooling scripts.\n* `cmake/` - CMake support modules.\n* `docker/` - Docker-related project files.\n* `assets/` - documentation assets; not runtime code.\n\n### External, Local, and Generated State\n\n* `ggml/` - git submodule for the ggml dependency.\n* `thirdparty/` - vendored third-party dependencies.\n* `models/` - local model storage. Ignore this directory and do not read model\n  files.\n* `test/` - local testing scripts. Use only when relevant to the task.\n* `build/`, `build_*`, and similar directories - generated build outputs.\n  Inspect them only when debugging a build result.\n\n---\n\n## Agent Workflow for Code Changes\n\n1. Identify the relevant modules under `src/`.\n2. Check whether the change touches the public API in `include/`.\n3. Consult relevant `docs/` and examples before changing user-facing behavior.\n4. Follow existing local patterns before adding new abstractions.\n5. Keep edits scoped to the requested behavior.\n6. Run the narrowest useful build, test, or inspection command available.\n\nFollow `CONTRIBUTING.md` for formatting, naming, PR expectations, dependency\nupdate policy, and security rules.\n\n---\n\n## Code Comments\n\nKeep comments rare and useful.\n\nDo not add comments that only describe what the code does. Add comments only\nwhen the code cannot fully express the logic, the logic is unusually complex, or\nthere are historical reasons, invariants, constraints, compatibility concerns,\nor known pitfalls that future maintainers need to understand.\n\nDo not add task-specific comments that will be meaningless after review.\n\nExamples from the current codebase:\n\n```cpp\n// GOOD: explains a safety constraint that is not obvious from the assignment.\n// From src/model_io/pickle_io.cpp.\n// Non-tensor checkpoint metadata can use REDUCE for arbitrary\n// Python objects. Do not execute it; keep stack shape only.\nstack.push_back(make_none_value());\n\n// BAD: describes only what the next line does.\n// Set the token count to zero.\ntoken_count = 0;\n```\n\n---\n\n## Text File Encoding\n\nWhen reading or editing repository text files:\n\n* Prefer UTF-8 with LF for Markdown, frontend source, JSON, and other text-first\n  project files unless the file already clearly uses a different encoding.\n* Do not assume terminal output encoding matches file encoding on Windows.\n* A file that looks garbled in PowerShell output may still be valid UTF-8.\n* When inspecting UTF-8 files in PowerShell, prefer explicit UTF-8 reads such as:\n  * `[Console]::OutputEncoding = [System.Text.Encoding]::UTF8`\n  * `Get-Content -Encoding utf8 <path>`\n* Avoid rewriting a file purely because console output looked garbled; verify\n  the actual file encoding first.\n\n---\n\n## Tensor and Layout Notes\n\nAdditional tensor/layout rules for this codebase:\n\n* `sd::Tensor` shape order is not PyTorch/NumPy-style. `shape()[0]` is the\n  lowest and most contiguous dimension, and higher indices are higher\n  dimensions.\n* Broadcasting for `sd::Tensor` must align dimensions from low to high dimension\n  indices. If one tensor has fewer dimensions, append implicit `1`s at the\n  higher-dimension end.\n* `ggml_n_dims` / `ggml_n_dims(tensor)` can drop trailing singleton high\n  dimensions. Do not assume a logical trailing dimension of `1` will still be\n  counted in ggml metadata.\n* Internal tensor-returning interfaces use an empty `sd::Tensor` to represent\n  null, absent, or failure states. Do not add `std::optional<sd::Tensor<...>>`\n  for internal APIs unless a distinct semantic state is truly required.\n","CLAUDE.md":"@AGENTS.md\n\n## Claude Code\n\nFollow `AGENTS.md` as the shared repository instructions.\n\nDo not duplicate contribution, style, PR, dependency, or security policy here;\nuse `CONTRIBUTING.md` as the canonical source for those rules.\n\nKeep Claude-specific project notes in this file only when they do not apply to\nother coding agents.\n"},"files":{"AGENTS.md":"# Instructions for stable-diffusion.cpp\n\nThis document is for AI coding agents working in this repository. It should\ndescribe agent-specific workflow, repository routing, editing boundaries, and\nproject-specific pitfalls.\n\nFor general contribution rules, including PR scope, commit conventions, code\nstyle, dependency updates, security hygiene, and AI-assisted contribution policy,\nsee `CONTRIBUTING.md`.\n\n---\n\n## Agent Operating Rules\n\nBefore analyzing or modifying the repository:\n\n1. Read this file.\n2. Use `rg` / `rg --files` or directory listing commands to confirm the current\n   tree before relying on a path.\n3. Start from `src/` and relevant `docs/` for runtime behavior.\n4. Read the relevant code before editing.\n5. Prefer the smallest change that fits the existing architecture.\n6. Report focused verification and mention any tests not run.\n\nAgents must not:\n\n* Run `git push`, create PRs, or submit issue/PR comments on the user's behalf.\n* Create commits unless the user explicitly requests that specific commit.\n* Modify `ggml/`, `thirdparty/`, or `examples/server/frontend/` unless\n  explicitly requested and necessary.\n* Read large local model files or tokenizer vocabulary files.\n* Rewrite unrelated code for style-only reasons.\n* Add secrets, model weights, generated binaries, local absolute paths, or\n  machine-specific output.\n\nWhen a change is large, architectural, or likely to affect public behavior,\npause and present a short plan before editing.\n\n---\n\n## Repository Map and Editing Boundaries\n\nThis is a routing map for agents, not a full architecture document. The layout\ncan change, so verify paths before using them. Do not inspect excluded\nlarge-data directories while checking the tree.\n\n### Primary Project Code\n\nCore implementation lives under `src/`.\n\nCurrent source layout includes:\n\n* `src/core/` - shared tensor, ggml integration, backend, graph, RNG, and utility\n  code.\n* `src/model/` - model families and model components.\n* `src/model_io/` - model file loading, GGUF, safetensors, pickle, and related\n  serialization helpers.\n* `src/runtime/` - sampling, denoising, guidance, caching, preprocessing, and\n  runtime execution helpers.\n* `src/tokenizers/` - tokenizer implementations.\n* `src/conditioning/` - conditioning and prompt-related implementation.\n* `src/extensions/` - optional feature extensions.\n* top-level `src/*.cpp` and `src/*.h` files - public implementation entry\n  points, model loading, conversion, versioning, and shared managers.\n\n`src/tokenizers/vocab/` contains large tokenizer vocabulary data. Do not read or\nparse files in this directory; reference the path only when necessary.\n\n### Public API\n\n`include/` contains the C API exposed by the project. Currently the primary\npublic header is `include/stable-diffusion.h`.\n\nTreat public headers as stable API. Avoid breaking compatibility unless the user\nexplicitly requests it. If public behavior changes, update relevant examples or\ndocumentation.\n\n### Examples\n\n`examples/` contains programs demonstrating library usage.\n\n* `examples/cli/` - command line program for running models, testing features,\n  and debugging.\n* `examples/common/` - shared example support code.\n* `examples/server/` - server application built on top of the library.\n* `examples/server/frontend/` - git submodule containing independent frontend\n  code. Avoid modifying it unless explicitly requested.\n\n### Documentation and Tooling\n\n* `docs/` - documentation for supported models, build options, behavior, and\n  workflows.\n* `scripts/` - development, model processing, build automation, formatting, and\n  tooling scripts.\n* `cmake/` - CMake support modules.\n* `docker/` - Docker-related project files.\n* `assets/` - documentation assets; not runtime code.\n\n### External, Local, and Generated State\n\n* `ggml/` - git submodule for the ggml dependency.\n* `thirdparty/` - vendored third-party dependencies.\n* `models/` - local model storage. Ignore this directory and do not read model\n  files.\n* `test/` - local testing scripts. Use only when relevant to the task.\n* `build/`, `build_*`, and similar directories - generated build outputs.\n  Inspect them only when debugging a build result.\n\n---\n\n## Agent Workflow for Code Changes\n\n1. Identify the relevant modules under `src/`.\n2. Check whether the change touches the public API in `include/`.\n3. Consult relevant `docs/` and examples before changing user-facing behavior.\n4. Follow existing local patterns before adding new abstractions.\n5. Keep edits scoped to the requested behavior.\n6. Run the narrowest useful build, test, or inspection command available.\n\nFollow `CONTRIBUTING.md` for formatting, naming, PR expectations, dependency\nupdate policy, and security rules.\n\n---\n\n## Code Comments\n\nKeep comments rare and useful.\n\nDo not add comments that only describe what the code does. Add comments only\nwhen the code cannot fully express the logic, the logic is unusually complex, or\nthere are historical reasons, invariants, constraints, compatibility concerns,\nor known pitfalls that future maintainers need to understand.\n\nDo not add task-specific comments that will be meaningless after review.\n\nExamples from the current codebase:\n\n```cpp\n// GOOD: explains a safety constraint that is not obvious from the assignment.\n// From src/model_io/pickle_io.cpp.\n// Non-tensor checkpoint metadata can use REDUCE for arbitrary\n// Python objects. Do not execute it; keep stack shape only.\nstack.push_back(make_none_value());\n\n// BAD: describes only what the next line does.\n// Set the token count to zero.\ntoken_count = 0;\n```\n\n---\n\n## Text File Encoding\n\nWhen reading or editing repository text files:\n\n* Prefer UTF-8 with LF for Markdown, frontend source, JSON, and other text-first\n  project files unless the file already clearly uses a different encoding.\n* Do not assume terminal output encoding matches file encoding on Windows.\n* A file that looks garbled in PowerShell output may still be valid UTF-8.\n* When inspecting UTF-8 files in PowerShell, prefer explicit UTF-8 reads such as:\n  * `[Console]::OutputEncoding = [System.Text.Encoding]::UTF8`\n  * `Get-Content -Encoding utf8 <path>`\n* Avoid rewriting a file purely because console output looked garbled; verify\n  the actual file encoding first.\n\n---\n\n## Tensor and Layout Notes\n\nAdditional tensor/layout rules for this codebase:\n\n* `sd::Tensor` shape order is not PyTorch/NumPy-style. `shape()[0]` is the\n  lowest and most contiguous dimension, and higher indices are higher\n  dimensions.\n* Broadcasting for `sd::Tensor` must align dimensions from low to high dimension\n  indices. If one tensor has fewer dimensions, append implicit `1`s at the\n  higher-dimension end.\n* `ggml_n_dims` / `ggml_n_dims(tensor)` can drop trailing singleton high\n  dimensions. Do not assume a logical trailing dimension of `1` will still be\n  counted in ggml metadata.\n* Internal tensor-returning interfaces use an empty `sd::Tensor` to represent\n  null, absent, or failure states. Do not add `std::optional<sd::Tensor<...>>`\n  for internal APIs unless a distinct semantic state is truly required.\n","CLAUDE.md":"@AGENTS.md\n\n## Claude Code\n\nFollow `AGENTS.md` as the shared repository instructions.\n\nDo not duplicate contribution, style, PR, dependency, or security policy here;\nuse `CONTRIBUTING.md` as the canonical source for those rules.\n\nKeep Claude-specific project notes in this file only when they do not apply to\nother coding agents.\n"},"items":[{"name":"AGENTS.md","path":"AGENTS.md","title":"AGENTS.md","content":"# Instructions for stable-diffusion.cpp\n\nThis document is for AI coding agents working in this repository. It should\ndescribe agent-specific workflow, repository routing, editing boundaries, and\nproject-specific pitfalls.\n\nFor general contribution rules, including PR scope, commit conventions, code\nstyle, dependency updates, security hygiene, and AI-assisted contribution policy,\nsee `CONTRIBUTING.md`.\n\n---\n\n## Agent Operating Rules\n\nBefore analyzing or modifying the repository:\n\n1. Read this file.\n2. Use `rg` / `rg --files` or directory listing commands to confirm the current\n   tree before relying on a path.\n3. Start from `src/` and relevant `docs/` for runtime behavior.\n4. Read the relevant code before editing.\n5. Prefer the smallest change that fits the existing architecture.\n6. Report focused verification and mention any tests not run.\n\nAgents must not:\n\n* Run `git push`, create PRs, or submit issue/PR comments on the user's behalf.\n* Create commits unless the user explicitly requests that specific commit.\n* Modify `ggml/`, `thirdparty/`, or `examples/server/frontend/` unless\n  explicitly requested and necessary.\n* Read large local model files or tokenizer vocabulary files.\n* Rewrite unrelated code for style-only reasons.\n* Add secrets, model weights, generated binaries, local absolute paths, or\n  machine-specific output.\n\nWhen a change is large, architectural, or likely to affect public behavior,\npause and present a short plan before editing.\n\n---\n\n## Repository Map and Editing Boundaries\n\nThis is a routing map for agents, not a full architecture document. The layout\ncan change, so verify paths before using them. Do not inspect excluded\nlarge-data directories while checking the tree.\n\n### Primary Project Code\n\nCore implementation lives under `src/`.\n\nCurrent source layout includes:\n\n* `src/core/` - shared tensor, ggml integration, backend, graph, RNG, and utility\n  code.\n* `src/model/` - model families and model components.\n* `src/model_io/` - model file loading, GGUF, safetensors, pickle, and related\n  serialization helpers.\n* `src/runtime/` - sampling, denoising, guidance, caching, preprocessing, and\n  runtime execution helpers.\n* `src/tokenizers/` - tokenizer implementations.\n* `src/conditioning/` - conditioning and prompt-related implementation.\n* `src/extensions/` - optional feature extensions.\n* top-level `src/*.cpp` and `src/*.h` files - public implementation entry\n  points, model loading, conversion, versioning, and shared managers.\n\n`src/tokenizers/vocab/` contains large tokenizer vocabulary data. Do not read or\nparse files in this directory; reference the path only when necessary.\n\n### Public API\n\n`include/` contains the C API exposed by the project. Currently the primary\npublic header is `include/stable-diffusion.h`.\n\nTreat public headers as stable API. Avoid breaking compatibility unless the user\nexplicitly requests it. If public behavior changes, update relevant examples or\ndocumentation.\n\n### Examples\n\n`examples/` contains programs demonstrating library usage.\n\n* `examples/cli/` - command line program for running models, testing features,\n  and debugging.\n* `examples/common/` - shared example support code.\n* `examples/server/` - server application built on top of the library.\n* `examples/server/frontend/` - git submodule containing independent frontend\n  code. Avoid modifying it unless explicitly requested.\n\n### Documentation and Tooling\n\n* `docs/` - documentation for supported models, build options, behavior, and\n  workflows.\n* `scripts/` - development, model processing, build automation, formatting, and\n  tooling scripts.\n* `cmake/` - CMake support modules.\n* `docker/` - Docker-related project files.\n* `assets/` - documentation assets; not runtime code.\n\n### External, Local, and Generated State\n\n* `ggml/` - git submodule for the ggml dependency.\n* `thirdparty/` - vendored third-party dependencies.\n* `models/` - local model storage. Ignore this directory and do not read model\n  files.\n* `test/` - local testing scripts. Use only when relevant to the task.\n* `build/`, `build_*`, and similar directories - generated build outputs.\n  Inspect them only when debugging a build result.\n\n---\n\n## Agent Workflow for Code Changes\n\n1. Identify the relevant modules under `src/`.\n2. Check whether the change touches the public API in `include/`.\n3. Consult relevant `docs/` and examples before changing user-facing behavior.\n4. Follow existing local patterns before adding new abstractions.\n5. Keep edits scoped to the requested behavior.\n6. Run the narrowest useful build, test, or inspection command available.\n\nFollow `CONTRIBUTING.md` for formatting, naming, PR expectations, dependency\nupdate policy, and security rules.\n\n---\n\n## Code Comments\n\nKeep comments rare and useful.\n\nDo not add comments that only describe what the code does. Add comments only\nwhen the code cannot fully express the logic, the logic is unusually complex, or\nthere are historical reasons, invariants, constraints, compatibility concerns,\nor known pitfalls that future maintainers need to understand.\n\nDo not add task-specific comments that will be meaningless after review.\n\nExamples from the current codebase:\n\n```cpp\n// GOOD: explains a safety constraint that is not obvious from the assignment.\n// From src/model_io/pickle_io.cpp.\n// Non-tensor checkpoint metadata can use REDUCE for arbitrary\n// Python objects. Do not execute it; keep stack shape only.\nstack.push_back(make_none_value());\n\n// BAD: describes only what the next line does.\n// Set the token count to zero.\ntoken_count = 0;\n```\n\n---\n\n## Text File Encoding\n\nWhen reading or editing repository text files:\n\n* Prefer UTF-8 with LF for Markdown, frontend source, JSON, and other text-first\n  project files unless the file already clearly uses a different encoding.\n* Do not assume terminal output encoding matches file encoding on Windows.\n* A file that looks garbled in PowerShell output may still be valid UTF-8.\n* When inspecting UTF-8 files in PowerShell, prefer explicit UTF-8 reads such as:\n  * `[Console]::OutputEncoding = [System.Text.Encoding]::UTF8`\n  * `Get-Content -Encoding utf8 <path>`\n* Avoid rewriting a file purely because console output looked garbled; verify\n  the actual file encoding first.\n\n---\n\n## Tensor and Layout Notes\n\nAdditional tensor/layout rules for this codebase:\n\n* `sd::Tensor` shape order is not PyTorch/NumPy-style. `shape()[0]` is the\n  lowest and most contiguous dimension, and higher indices are higher\n  dimensions.\n* Broadcasting for `sd::Tensor` must align dimensions from low to high dimension\n  indices. If one tensor has fewer dimensions, append implicit `1`s at the\n  higher-dimension end.\n* `ggml_n_dims` / `ggml_n_dims(tensor)` can drop trailing singleton high\n  dimensions. Do not assume a logical trailing dimension of `1` will still be\n  counted in ggml metadata.\n* Internal tensor-returning interfaces use an empty `sd::Tensor` to represent\n  null, absent, or failure states. Do not add `std::optional<sd::Tensor<...>>`\n  for internal APIs unless a distinct semantic state is truly required.\n","category":"root","tokens":1768},{"name":"CLAUDE.md","path":"CLAUDE.md","title":"CLAUDE.md","content":"@AGENTS.md\n\n## Claude Code\n\nFollow `AGENTS.md` as the shared repository instructions.\n\nDo not duplicate contribution, style, PR, dependency, or security policy here;\nuse `CONTRIBUTING.md` as the canonical source for those rules.\n\nKeep Claude-specific project notes in this file only when they do not apply to\nother coding agents.\n","category":"root","tokens":83}]}