[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-axodox--axodox-machinelearning":3,"tool-axodox--axodox-machinelearning":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",150037,2,"2026-04-10T23:33:47",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108322,"2026-04-10T11:39:34",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[52,13,15,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":32,"last_commit_at":59,"category_tags":60,"status":17},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[52,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":66,"readme_en":67,"readme_zh":68,"quickstart_zh":69,"use_case_zh":70,"hero_image_url":71,"owner_login":72,"owner_name":73,"owner_avatar_url":74,"owner_bio":75,"owner_company":76,"owner_location":77,"owner_email":78,"owner_twitter":79,"owner_website":80,"owner_url":81,"languages":82,"stars":95,"forks":96,"last_commit_at":97,"license":98,"difficulty_score":99,"env_os":100,"env_gpu":101,"env_ram":102,"env_deps":103,"category_tags":112,"github_topics":113,"view_count":99,"oss_zip_url":79,"oss_zip_packed_at":79,"status":17,"created_at":127,"updated_at":128,"faqs":129,"releases":165},273,"axodox\u002Faxodox-machinelearning","axodox-machinelearning","This repository contains a pure C++ ONNX implementation of multiple offline AI models, such as StableDiffusion (1.5 and XL), ControlNet, Midas, HED and OpenPose.","axodox-machinelearning 是一个纯 C++ 实现的离线 AI 模型库，核心功能是让开发者能够在不使用 Python 的情况下，在 C++ 应用中运行 Stable Diffusion 进行图像生成。它完整支持 txt2img（文字生成图）、img2img（图像生成图）和 inpainting（图像修复）等核心功能，还内置了安全检查器。\n\n这个库最大的特点是部署极其简单——只需要几个可执行文件、库文件和模型权重就能运行，无需搭建复杂的 Python 环境。对于需要将 AI 图像生成能力集成到游戏或实时图形应用中的开发者来说非常友好。\n\n除了基础的 Stable Diffusion，axodox-machinelearning 还支持 ControlNet，可以利用姿态估计（OpenPose）、深度估计（MiDAS）和边缘检测（HED）来引导图像生成过程，实现更精细的控制。模型已针对 DirectML 进行优化，可在 Windows 平台上高效运行。\n\n如果你是一名游戏开发者或图形应用工程师，想在自己的 C++ 项目中加入 AI 图像生成功能，这个库值得一看。","## Introduction\r\n\r\nThis repository contains a **fully C++ implementation of Stable Diffusion**-based image synthesis, including the original txt2img, img2img and inpainting capabilities and the safety checker. This solution **does not depend on Python** and **runs the entire image generation process in a single process with competitive performance**, making deployments significantly simpler and smaller, essentially consisting a few executable and library files, and the model weights. Using the library it is possible to integrate Stable Diffusion into almost any application - as long as it can import C++ or C functions, but it is **most useful for the developers of realtime graphics applications and games**, which are often realized with C++.\r\n\r\n\u003Ctable style=\"margin: 0px auto;\">\r\n  \u003Ctr>\r\n    \u003Ctd>\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Faxodox_axodox-machinelearning_readme_3ee5eddd56c0.png\" alt=\"a samurai drawing his sword to defend his land\" width=\"256\" height=\"256\">\u003C\u002Ftd>\r\n    \u003Ctd>\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Faxodox_axodox-machinelearning_readme_a8b9908f53cc.png\" alt=\"a sailship crossing the high sea, 18st century, impressionist painting, closeup\" width=\"256\" height=\"256\">\u003C\u002Ftd>\r\n    \u003Ctd>\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Faxodox_axodox-machinelearning_readme_5f056a53f978.png\" alt=\" close up portrait photo of woman in wastelander clothes, long haircut, pale skin, slim body, background is city ruins, (high detailed skin:1.2)\" width=\"256\" height=\"256\">\u003C\u002Ftd>\r\n  \u003C\u002Ftr>\r\n\u003C\u002Ftable>\r\n\r\n## ControlNet support\r\n\r\nThe library also supports ControlNet, this allows using input images to guide the image generation process, for example:\r\n\r\n![OpenPose based ControlNet](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Faxodox_axodox-machinelearning_readme_ac40848848c4.png)\r\nIn this first, example we use an OpenPose estimator and OpenPose conditioned ControlNet, we can guide the img2img generation by specifying the pose, so it produces better results.\r\n\r\n![HED based ControlNet](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Faxodox_axodox-machinelearning_readme_bec9bde8ac36.png)\r\nUsing HED edge detection and edge conditioned ControlNet, we change the style of the image to resemble a comic book illustration, but keep the layout intact.\r\n\r\n![Depth based ControlNet](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Faxodox_axodox-machinelearning_readme_e863ba7373b7.png)\r\nUsing a depth estimator and depth map conditioned ControlNet, we generate a different character, but keep the original setup.\r\n\r\n## Feature extractors\r\n\r\nThe library also provides GPU accelerated implementations of the following feature extractors (showcased above):\r\n- Pose estimation: extracts the skeleton of a human from an image using [OpenPose](https:\u002F\u002Farxiv.org\u002Fabs\u002F1812.08008)\r\n- Depth estimation: estimates the depth of each pixel from a single image using [MiDAS](https:\u002F\u002Farxiv.org\u002Fabs\u002F1907.01341v3)\r\n- Edge Detection: extracts edges from an image, using [Holistically-Nested Edge Detection](https:\u002F\u002Farxiv.org\u002Fabs\u002F1504.06375)\r\n\r\n## Code examples\r\n\r\nHere are some simple code examples:\r\n- [StableDiffusion](https:\u002F\u002Fgithub.com\u002Faxodox\u002Faxodox-machinelearning\u002Fblob\u002Fmain\u002FAxodox.MachineLearning.Test\u002FStableDiffusionTest.cpp)\r\n- [ControlNet](https:\u002F\u002Fgithub.com\u002Faxodox\u002Faxodox-machinelearning\u002Fblob\u002Fmain\u002FAxodox.MachineLearning.Test\u002FControlNetTest.cpp)\r\n- [Feature extraction](https:\u002F\u002Fgithub.com\u002Faxodox\u002Faxodox-machinelearning\u002Fblob\u002Fmain\u002FAxodox.MachineLearning.Test\u002FFeatureExtractorTest.cpp)\r\n\r\n## Reference models\r\n\r\nThe AI models required for the library are stored in the ONNX format. All of the models have been run through Microsoft Olive and are optimized for DirectML. I have tested the library with the following models:\r\n\r\n- [Stable Diffusion 1.5 with ControlNet support](https:\u002F\u002Fhuggingface.co\u002Faxodoxian\u002Fstable_diffusion_onnx)\r\n- [Realistic Vision 1.4 with ControlNet support](https:\u002F\u002Fhuggingface.co\u002Faxodoxian\u002Frealistic_vision_onnx)\r\n- [ControlNet with feature extractors](https:\u002F\u002Fhuggingface.co\u002Faxodoxian\u002Fcontrolnet_onnx)\r\n\r\nYou may bring your own models, by converting them using [this guide](https:\u002F\u002Fgithub.com\u002Faxodox\u002Funpaint\u002Fwiki\u002FModel-import).\r\n\r\n> Please make sure to check the original license of the models if you plan to integrate them in your products.\r\n\r\n## Technical background\r\n\r\nThe implementation uses the [ONNX](https:\u002F\u002Fonnx.ai\u002F) to store the mathematical models involved in the image generation. These ONNX models are then executed using the [ONNX runtime](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fonnxruntime), which support a variety of platforms (Windows, Linux, MacOS, Android, iOS, WebAssembly etc.), and execution providers (such as NVIDIA CUDA \u002F TensorRT; AMD ROCm, Apple CoreML, Qualcomm QNN, Microsoft DirectML and many more). \r\n\r\nWe provide an example integration called [Unpaint](https:\u002F\u002Fgithub.com\u002Faxodox\u002Funpaint) which showcases how the libraries can be integrated in a simple WinUI based user interface. You may download the free app from the [Microsoft Store](https:\u002F\u002Fwww.microsoft.com\u002Fstore\u002FproductId\u002F9N25M770896D) to evaluate the performance characteristics of the solution.\r\n\r\nThe current codebase and the resulting [Nuget packages](https:\u002F\u002Fwww.nuget.org\u002Fpackages\u002FAxodox.MachineLearning) target Windows and use DirectML, however only small sections of the code utilize Windows specific APIs, and thus could be ported to other platforms with minimal effort.\r\n\r\n## Licensing\r\n\r\nThe source code of this library is provided under the MIT license.\r\n\r\n## Integrating the component\r\n\r\nPrebuilt versions of the project can be retrieved from Nuget under the name `Axodox.MachineLearning` and added to Visual Studio C++ projects (both desktop and UWP projects are supported) with the x64 platform.\r\n\r\nBasic integration:\r\n- Add the `Axodox.Common` and `Axodox.MachineLearning` packages to your project\r\n- Make sure to **only have x64 platform in your project** as this lib is x64 only for now\r\n- Ensure that your compiler is set to **C++20**, we also recommend enabling all warnings and conformance mode\r\n- Add the following include statement to your code file or precompiled header: `#include \"Include\u002FAxodox.MachineLearning.h\"`\r\n- Follow this example code to integrate the pipeline: https:\u002F\u002Fgithub.com\u002Faxodox\u002Funpaint\u002Fblob\u002Fmain\u002FUnpaint\u002FStableDiffusionModelExecutor.cpp\r\n\r\n> We recommend adding appropriate safety mechanisms to your app to suppress inappropriate outputs of StableDiffusion, the performance overhead is insignificant.\r\n\r\nThe Stable Diffusion models we use have been generated using [Microsoft Olive](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FOlive\u002Ftree\u002Fmain\u002Fexamples\u002Fdirectml\u002Fstable_diffusion), please follow the linked example to convert models from HuggingFace. By changing the script you can also convert models stored on your disk from various formats (e.g. `*.safetensors`). You can find some preconverted models [here](https:\u002F\u002Fhuggingface.co\u002Fmodels?other=unpaint,stable_diffusion_model) for testing.\r\n\r\n# Building the project\r\n\r\nBuilding the library is required to make and test changes. You will need to have the following installed to build the library:\r\n\r\n- [Visual Studio 2022](https:\u002F\u002Fvisualstudio.microsoft.com\u002Fdownloads\u002F)\r\n  - Select the following workloads:\r\n    - Desktop development with C++    \r\n    - Game development with C++\r\n  - To build [Unpaint](https:\u002F\u002Fgithub.com\u002Faxodox\u002Funpaint) as well also select these individual packages:\r\n    - Universal Windows Platform development\r\n    - C++ (v143) Universal Windows Platform tools\r\n\r\nYou can either run `build_nuget.ps1` or open `Axodox.MachineLearning.sln` and build from Visual Studio.\r\n\r\nOnce you have built the library, you override your existing nuget package install by setting the `AxodoxMachineLearning-Location` environment variable to point to your local build. \r\n\r\n> For example `C:\\dev\\axodox-machinelearning\\Axodox.MachineLearning.Universal` for an UWP app and `C:\\dev\\axodox-machinelearning\\Axodox.MachineLearning.Desktop` for a desktop app.\r\n\r\nThen add the project pointed by the path to the solution of your own project. This allows to add all projects into the same solution and make changes on the library and your app seamlessly without copying files repeatedly.\r\n","## 介绍\n\n该仓库包含了一个**完全基于 C++ 实现的 Stable Diffusion** 图像合成方案，包括原始的 txt2img（文字生成图像）、img2img（图像生成图像）和 inpainting（图像修复）功能，以及安全检查器。该解决方案**不依赖 Python**，**以具有竞争力的性能在单个进程中运行整个图像生成流程**，使部署大大简化和缩小，基本上只包含几个可执行文件和库文件，以及模型权重。使用该库可以将 Stable Diffusion 集成到几乎任何应用中——只要它可以导入 C++ 或 C 函数，但它**对于实时图形应用和游戏的开发者最为有用**，这些应用通常使用 C++ 实现。\n\n\u003Ctable style=\"margin: 0px auto;\">\n  \u003Ctr>\n    \u003Ctd>\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Faxodox_axodox-machinelearning_readme_3ee5eddd56c0.png\" alt=\"a samurai drawing his sword to defend his land\" width=\"256\" height=\"256\">\u003C\u002Ftd>\n    \u003Ctd>\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Faxodox_axodox-machinelearning_readme_a8b9908f53cc.png\" alt=\"a sailship crossing the high sea, 18st century, impressionist painting, closeup\" width=\"256\" height=\"256\">\u003C\u002Ftd>\n    \u003Ctd>\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Faxodox_axodox-machinelearning_readme_5f056a53f978.png\" alt=\" close up portrait photo of woman in wastelander clothes, long haircut, pale skin, slim body, background is city ruins, (high detailed skin:1.2)\" width=\"256\" height=\"256\">\u003C\u002Ftd>\n  \u003C\u002Ftr>\n\u003C\u002Ftable>\n\n## ControlNet 支持\n\n该库还支持 ControlNet（一种神经网络架构，允许使用输入图像引导图像生成过程），这允许使用输入图像来引导图像生成过程，例如：\n\n![OpenPose based ControlNet](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Faxodox_axodox-machinelearning_readme_ac40848848c4.png)\n在这个第一个示例中，我们使用 OpenPose 估计器和 OpenPose 条件化的 ControlNet，我们可以通过指定姿态来引导 img2img 生成，从而产生更好的结果。\n\n![HED based ControlNet](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Faxodox_axodox-machinelearning_readme_bec9bde8ac36.png)\n使用 HED 边缘检测和边缘条件化的 ControlNet，我们将图像风格改变为类似漫画插图的形式，同时保持布局完整。\n\n![Depth based ControlNet](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Faxodox_axodox-machinelearning_readme_e863ba7373b7.png)\n使用深度估计器和深度图条件化的 ControlNet，我们生成一个不同的角色，但保持原始设置。\n\n## 特征提取器\n\n该库还提供了以下特征提取器的 GPU 加速实现（上述示例中展示的）：\n\n- 姿态估计：使用 [OpenPose](https:\u002F\u002Farxiv.org\u002Fabs\u002F1812.08008) 从图像中提取人体骨架\n- 深度估计：使用 [MiDAS](https:\u002F\u002Farxiv.org\u002Fabs\u002F1907.01341v3) 从单张图像估计每个像素的深度\n- 边缘检测：使用 [Holistically-Nested Edge Detection](https:\u002F\u002Farxiv.org\u002Fabs\u002F1504.06375)（HED，整体嵌套边缘检测）从图像中提取边缘\n\n## 代码示例\n\n以下是一些简单的代码示例：\n\n- [StableDiffusion](https:\u002F\u002Fgithub.com\u002Faxodox\u002Faxodox-machinelearning\u002Fblob\u002Fmain\u002FAxodox.MachineLearning.Test\u002FStableDiffusionTest.cpp)\n- [ControlNet](https:\u002F\u002Fgithub.com\u002Faxodox\u002Faxodox-machinelearning\u002Fblob\u002Fmain\u002FAxodox.MachineLearning.Test\u002FControlNetTest.cpp)\n- [特征提取](https:\u002F\u002Fgithub.com\u002Faxodox\u002Faxodox-machinelearning\u002Fblob\u002Fmain\u002FAxodox.MachineLearning.Test\u002FFeatureExtractorTest.cpp)\n\n## 参考模型\n\n该库所需的 AI 模型以 ONNX（Open Neural Network Exchange，开放神经网络交换）格式存储。所有模型都已通过 Microsoft Olive 运行，并针对 DirectML 进行了优化。我已使用以下模型测试了该库：\n\n- [支持 ControlNet 的 Stable Diffusion 1.5](https:\u002F\u002Fhuggingface.co\u002Faxodoxian\u002Fstable_diffusion_onnx)\n- [支持 ControlNet 的 Realistic Vision 1.4](https:\u002F\u002Fhuggingface.co\u002Faxodoxian\u002Frealistic_vision_onnx)\n- [带特征提取器的 ControlNet](https:\u002F\u002Fhuggingface.co\u002Faxodoxian\u002Fcontrolnet_onnx)\n\n您可以使用[本指南](https:\u002F\u002Fgithub.com\u002Faxodox\u002Funpaint\u002Fwiki\u002FModel-import)转换自己的模型。\n\n> 如果您计划将这些模型集成到您的产品中，请务必查看模型的原始许可证。\n\n## 技术背景\n\n该实现使用 [ONNX](https:\u002F\u002Fonnx.ai\u002F) 来存储图像生成过程中涉及的数学模型。这些 ONNX 模型随后使用 [ONNX Runtime](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fonnxruntime) 执行，该运行时支持多种平台（Windows、Linux、MacOS、Android、iOS、WebAssembly 等）和执行提供程序（如 NVIDIA CUDA \u002F TensorRT；AMD ROCm、Apple CoreML、Qualcomm QNN、Microsoft DirectML 等）。\n\n我们提供了一个名为 [Unpaint](https:\u002F\u002Fgithub.com\u002Faxodox\u002Funpaint) 的集成示例，展示了如何将库集成到简单的 WinUI（Windows UI，一个基于 C++ 的现代 Windows 界面框架）用户界面中。您可以从 [Microsoft Store](https:\u002F\u002Fwww.microsoft.com\u002Fstore\u002FproductId\u002F9N25M770896D) 下载免费应用程序来评估该解决方案的性能特性。\n\n当前代码库和生成的 [Nuget 包](https:\u002F\u002Fwww.nuget.org\u002Fpackages\u002FAxodox.MachineLearning) 面向 Windows 并使用 DirectML，不过只有小部分代码使用了 Windows 特定的 API，因此可以以最少的改动移植到其他平台。\n\n## 许可\n\n该库的源代码以 MIT 许可证提供。\n\n## 集成组件\n\n该项目的预构建版本可以从 Nuget 获取，名称为 `Axodox.MachineLearning`，可以添加到 Visual Studio C++ 项目中（桌面和 UWP 项目均支持），仅支持 x64 平台。\n\n基本集成步骤：\n\n- 将 `Axodox.Common` 和 `Axodox.MachineLearning` 包添加到您的项目\n- 确保您的项目**仅包含 x64 平台**，因为该库目前仅支持 x64\n- 确保您的编译器设置为 **C++20**，我们还建议启用所有警告和合规模式\n- 将以下 include 语句添加到您的代码文件或预编译头文件中：`#include \"Include\u002FAxodox.MachineLearning.h\"`\n- 按照此示例代码集成管道：https:\u002F\u002Fgithub.com\u002Faxodox\u002Funpaint\u002Fblob\u002Fmain\u002FUnpaint\u002FStableDiffusionModelExecutor.cpp\n\n> 我们建议在您的应用程序中添加适当的安全机制来抑制 StableDiffusion 的不当输出，性能开销很小。\n\n我们使用的 Stable Diffusion 模型是使用 [Microsoft Olive](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FOlive\u002Ftree\u002Fmain\u002Fexamples\u002Fdirectml\u002Fstable_diffusion) 生成的，请按照链接的示例将模型从 HuggingFace 转换。通过更改脚本，您还可以转换存储在磁盘上的各种格式的模型（例如 `*.safetensors`）。您可以在[这里](https:\u002F\u002Fhuggingface.co\u002Fmodels?other=unpaint,stable_diffusion_model)找到一些预转换的模型用于测试。\n\n# 构建项目\n\n构建库是进行修改和测试所必需的。您需要安装以下工具来构建该库：\n\n- [Visual Studio 2022](https:\u002F\u002Fvisualstudio.microsoft.com\u002Fdownloads\u002F)\n  - 选择以下工作负载：\n    - 使用 C++ 的桌面开发\n    - 使用 C++ 的游戏开发\n  - 若还要构建 [Unpaint](https:\u002F\u002Fgithub.com\u002Faxodox\u002Funpaint)，请同时选择以下单独组件：\n    - 通用 Windows 平台开发\n    - C++ (v143) 通用 Windows 平台工具\n\n您可以运行 `build_nuget.ps1`，或者打开 `Axodox.MachineLearning.sln` 并在 Visual Studio 中进行构建。\n\n构建库后，通过将 `AxodoxMachineLearning-Location` 环境变量设置为指向您的本地构建目录来覆盖现有的 NuGet 包安装。\n\n> 例如，UWP 应用程序使用 `C:\\dev\\axodox-machinelearning\\Axodox.MachineLearning.Universal`，桌面应用程序使用 `C:\\dev\\axodox-machinelearning\\Axodox.MachineLearning.Desktop`。\n\n然后，将该路径指向的项目添加到您自己项目的解决方案中。这允许将所有项目添加到同一个解决方案中，从而可以无缝地对库和您的应用程序进行修改，而无需反复复制文件。","# axodox-machinelearning 快速上手指南\n\n## 环境准备\n\n### 系统要求\n- **操作系统**：Windows 10\u002F11（当前主要支持）\n- **平台**：x64\n- **编译器**：Visual Studio 2022\n\n### 前置依赖\n\n安装 Visual Studio 2022 时需要选择以下工作负载：\n- **Desktop development with C++**\n- **Game development with C++**\n\n如需构建 Unpaint 示例程序，还需额外选择：\n- Universal Windows Platform development\n- C++ (v143) Universal Windows Platform tools\n\n### 编译要求\n- C++20 标准\n- 建议启用所有警告和 conformance mode\n\n---\n\n## 安装步骤\n\n### 方式一：使用 NuGet 包（推荐）\n\n1. 在 Visual Studio 中打开你的 C++ 项目（支持 Desktop 和 UWP）\n2. 确保项目平台设置为 **x64**（仅支持 x64）\n3. 通过 NuGet 包管理器安装以下两个包：\n   - `Axodox.Common`\n   - `Axodox.MachineLearning`\n\n4. 在代码文件或预编译头文件中添加头文件引用：\n```cpp\n#include \"Include\u002FAxodox.MachineLearning.h\"\n```\n\n### 方式二：本地构建\n\n1. 克隆仓库：\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Faxodox\u002Faxodox-machinelearning.git\n```\n\n2. 使用以下方式之一构建：\n   - 运行脚本：`.\\build_nuget.ps1`\n   - 或在 Visual Studio 中打开 `Axodox.MachineLearning.sln` 解决方案\n\n3. 使用本地构建版本：\n   - 设置环境变量 `AxodoxMachineLearning-Location` 指向本地构建目录\n   - UWP 应用：`C:\\dev\\axodox-machinelearning\\Axodox.MachineLearning.Universal`\n   - Desktop 应用：`C:\\dev\\axodox-machinelearning\\Axodox.MachineLearning.Desktop`\n\n---\n\n## 基本使用\n\n### 下载模型文件\n\n预转换的 ONNX 模型可从以下地址获取：\n- [Stable Diffusion 1.5 with ControlNet](https:\u002F\u002Fhuggingface.co\u002Faxodoxian\u002Fstable_diffusion_onnx)\n- [Realistic Vision 1.4 with ControlNet](https:\u002F\u002Fhuggingface.co\u002Faxodoxian\u002Frealistic_vision_onnx)\n- [ControlNet with feature extractors](https:\u002F\u002Fhuggingface.co\u002Faxodoxian\u002Fcontrolnet_onnx)\n\n### 简单示例：文本生成图像\n\n参考官方示例代码：\n- [StableDiffusionTest.cpp](https:\u002F\u002Fgithub.com\u002Faxodox\u002Faxodox-machinelearning\u002Fblob\u002Fmain\u002FAxodox.MachineLearning.Test\u002FStableDiffusionTest.cpp)\n- [ControlNetTest.cpp](https:\u002F\u002Fgithub.com\u002Faxodox\u002Faxodox-machinelearning\u002Fblob\u002Fmain\u002FAxodox.MachineLearning.Test\u002FControlNetTest.cpp)\n- [FeatureExtractorTest.cpp](https:\u002F\u002Fgithub.com\u002Faxodox\u002Faxodox-machinelearning\u002Fblob\u002Fmain\u002FAxodox.MachineLearning.Test\u002FFeatureExtractorTest.cpp)\n\n完整集成示例可参考 [Unpaint 项目](https:\u002F\u002Fgithub.com\u002Faxodox\u002Funpaint) 中的 `StableDiffusionModelExecutor.cpp`。\n\n### 注意事项\n\n- 建议在应用中添加适当的安全机制，以过滤不适当输出\n- 模型文件需放置在程序可访问的路径下\n- 确保模型文件符合原始许可证要求","# 游戏开发者：在 C++ 游戏中集成 AI 图像生成功能\n\n小张是一名游戏开发工程师，正在开发一款开放世界 RPG 游戏。团队希望在游戏中实现一个“AI 角色定制系统”——玩家可以通过文字描述实时生成自定义游戏角色形象，并结合姿态控制生成对应的游戏内立绘。团队的技术栈主要是 C++ 和自研游戏引擎。\n\n### 没有 axodox-machinelearning 时\n\n- 团队需要额外维护一套 Python 运行时环境，包括 PyTorch、Diffusers 等大量依赖库，部署流程极其繁琐\n- 游戏引擎与 Python 之间需要通过进程间通信或 HTTP API 交互，响应延迟高达数秒，无法满足实时交互需求\n- 每次更新或修复 bug 需要同时维护 C++ 游戏端和 Python AI 服务两套代码，调试成本翻倍\n- 游戏安装包需要额外打包 Python 解释器和模型文件，整体体积增加数百 MB，玩家下载体验差\n- 跨平台发布时，Python 依赖在不同操作系统上的兼容性问题频发，测试工作量巨大\n\n### 使用 axodox-machinelearning 后\n\n- 直接在 C++ 代码中调用 Stable Diffusion 和 ControlNet，无需任何外部运行时，整个流程由单一可执行文件完成\n- AI 推理与游戏逻辑运行在同一进程内，延迟从数秒降至亚秒级，玩家输入描述后几乎即时看到生成结果\n- 统一使用 C++ 开发，调试器可以直接断点跟踪整个图像生成流程，bug 定位效率大幅提升\n- 部署包仅包含编译后的可执行文件、模型权重和必要的运行时库，整体体积显著缩小\n- 纯 C++ 实现天然支持跨平台，Windows、Linux、Mac 均可直接编译运行，无需额外适配工作\n\n### 总结\n\naxodox-machinelearning 让游戏开发者能够在 C++ 环境中原生运行 Stable Diffusion，消除了 Python 依赖的沉重负担，使 AI 图像生成真正融入实时游戏体验。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Faxodox_axodox-machinelearning_bec9bde8.png","axodox","Péter Major","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Faxodox_7596adb6.png","Technical Lead at CAE Budapest.","CAE","Budapest","axodox@outlook.com",null,"https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Fpéter-major-9b00175b","https:\u002F\u002Fgithub.com\u002Faxodox",[83,87,91],{"name":84,"color":85,"percentage":86},"C++","#f34b7d",96.3,{"name":88,"color":89,"percentage":90},"PowerShell","#012456",1.9,{"name":92,"color":93,"percentage":94},"C","#555555",1.8,630,41,"2026-04-08T12:45:23","MIT",4,"Windows","使用 DirectML 加速（AMD\u002FIntel\u002FNVIDIA GPU 均可），未说明具体显存要求","未说明",{"notes":104,"python":105,"dependencies":106},"纯 C++ 实现，不依赖 Python；当前主要针对 Windows 平台优化，使用 DirectML 作为执行提供程序；理论上可移植到 Linux\u002FmacOS\u002FAndroid\u002FiOS，但需要较大改动；需要 Visual Studio 2022 进行构建；仅支持 x64 平台；需要 C++20 编译器；模型文件需单独下载（约数 GB）","不需要（纯 C++ 实现）",[107,108,109,110,111],"ONNX","ONNX Runtime","Microsoft DirectML","Axodox.Common","Axodox.MachineLearning",[15,14],[114,115,116,117,118,119,120,121,122,123,124,125,126],"cpp","image-generation","mit-license","native","nuget","onnx","stable-diffusion","directml","controlnet","holistically-nested-edge-detection","midas","openpose","stable-diffusion-xl","2026-03-27T02:49:30.150509","2026-04-11T18:31:39.650856",[130,135,140,145,150,155,160],{"id":131,"question_zh":132,"answer_zh":133,"source_url":134},885,"如何在非 UWP 控制台应用中使用该库？","该库可以在非 UWP 项目中使用。遇到 WinRT 错误（如 'The process has no package identity.'）通常是因为 Logger 依赖项。解决方法是将项目中相关的 Logger 代码注释掉，应用程序即可正常运行。此外，还需要引用 DirectML 和 ONNX runtime 的 NuGet 包，以及模型文件和 clip_tok.onnx、ortextensions.dll（来自库的 NuGet 包）。","https:\u002F\u002Fgithub.com\u002Faxodox\u002Faxodox-machinelearning\u002Fissues\u002F9",{"id":136,"question_zh":137,"answer_zh":138,"source_url":139},886,"如何访问 txt2img 结果的 GPU 数据而不下载到 CPU？","可以使用 OrtDmlApi 类的 GetD3D12ResourceFromAllocation 方法从 OrtValue 获取底层的 ID3D12Resource，从而直接访问 GPU 数据。不过需要注意：由于 DML 中某些操作是在 CPU 上执行的，可能无法达到预期的加速效果。另外，作者使用了自己的 ONNX\u002FDML 分支（Axodox.MachineLearning.OnnxRuntime.DirectML），其中包含了显著的性能改进，通过减少和管理 VRAM 来提升 DirectML 的执行效率。","https:\u002F\u002Fgithub.com\u002Faxodox\u002Faxodox-machinelearning\u002Fissues\u002F29",{"id":141,"question_zh":142,"answer_zh":143,"source_url":144},887,"在哪里可以找到 clip_tok.onnx 模型文件？","clip_tok.onnx 模型文件位于 GitHub 仓库的 Axodox.MachineLearning.Shared\u002FAssets 目录下。","https:\u002F\u002Fgithub.com\u002Faxodox\u002Faxodox-machinelearning\u002Fissues\u002F21",{"id":146,"question_zh":147,"answer_zh":148,"source_url":149},888,"如何设置环境变量来使用本地构建的库？","构建库后，设置 AxodoxMachineLearning-Location 环境变量指向本地构建路径即可覆盖现有的 NuGet 包安装。对于 UWP 应用，路径指向 C:\\dev\\axodox-machinelearning\\Axodox.MachineLearning.Universal；对于桌面应用，指向 C:\\dev\\axodox-machinelearning\\Axodox.MachineLearning.Desktop。为了更好的开发体验，还可以将库的项目添加到自己的解决方案中，这样修改代码后会自动重新编译，实现无缝开发。","https:\u002F\u002Fgithub.com\u002Faxodox\u002Faxodox-machinelearning\u002Fissues\u002F17",{"id":151,"question_zh":152,"answer_zh":153,"source_url":154},889,"测试失败显示 'Failed to set to the execution context' 怎么办？","这是因为 Windows 系统自带的旧版本 DirectML 和 ONNX runtime 被加载到测试运行器中，而不是最新的 NuGet 包。解决方法是将这些 DLL 文件复制到测试运行器的文件夹中。此外，还需要其他输入文件和模型文件才能运行测试（由于文件较大且 GitHub LFS 费用问题，这些文件目前未包含在仓库中）。可以参考测试代码作为使用示例。","https:\u002F\u002Fgithub.com\u002Faxodox\u002Faxodox-machinelearning\u002Fissues\u002F15",{"id":156,"question_zh":157,"answer_zh":158,"source_url":159},890,"这个库是什么？是否使用 ONNX Runtime？","该库使用 C++ ONNX Runtime，是从零开始用 C++ 开发的项目，基于自己的代码和 Diffusers Python 库。与 awesome.js 无关。","https:\u002F\u002Fgithub.com\u002Faxodox\u002Faxodox-machinelearning\u002Fissues\u002F20",{"id":161,"question_zh":162,"answer_zh":163,"source_url":164},891,"为什么 NuGet 包在 Unreal Engine 5.2 项目中安装失败？","Unreal Engine 实际上不支持直接的 NuGet 包。需要将 NuGet 包包装成 Unreal Engine 的第三方库插件才能使用。","https:\u002F\u002Fgithub.com\u002Faxodox\u002Faxodox-machinelearning\u002Fissues\u002F2",[]]