[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-castorini--daam":3,"tool-castorini--daam":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 真正成长为懂上",160015,2,"2026-04-18T11:30:52",[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 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",109154,"2026-04-18T11:18:24",[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":76,"owner_email":76,"owner_twitter":76,"owner_website":77,"owner_url":78,"languages":79,"stars":92,"forks":93,"last_commit_at":94,"license":95,"difficulty_score":10,"env_os":96,"env_gpu":97,"env_ram":98,"env_deps":99,"category_tags":107,"github_topics":108,"view_count":32,"oss_zip_url":76,"oss_zip_packed_at":76,"status":17,"created_at":115,"updated_at":116,"faqs":117,"releases":158},9195,"castorini\u002Fdaam","daam","Diffusion attentive attribution maps for interpreting Stable Diffusion.","daam 是一款专为解读 Stable Diffusion 生成过程而设计的开源工具。它通过可视化“扩散注意力归因图”，直观地展示提示词中的每个单词是如何影响最终图像的具体区域的。\n\n在使用 AI 绘画时，用户常常困惑于模型究竟是如何理解提示词的，或者为何某些词语会导致意想不到的画面元素。daam 有效解决了这一“黑盒”难题，它将抽象的交叉注意力机制转化为清晰的热力图覆盖在图像上，让用户能精准看到如“狗”、“奔跑”或“田野”等词汇分别对应画面的哪些部分，从而更好地调试提示词并理解模型逻辑。\n\n这款工具非常适合 AI 研究人员、开发者以及希望深入掌控生成细节的高级创作者。其核心技术亮点在于基于交叉注意力（Cross Attention）的分析方法，不仅支持经典的 Stable Diffusion 模型，已更新适配了最新的 SDXL 版本。daam 提供了灵活的使用方式：既可以通过简单的命令行一键生成带标注的图像和热力图，也能作为 Python 库嵌入到自定义的研究流程或实验中，方便进行数据序列化保存与深度分析。","# What the DAAM: Interpreting Stable Diffusion Using Cross Attention\n\n[![HF Spaces](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FHuggingFace%20Space-online-green.svg)](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Ftetrisd\u002FDiffusion-Attentive-Attribution-Maps) [![Citation](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FCitation-ACL-orange.svg)](https:\u002F\u002Fgist.github.com\u002Fdaemon\u002F639de6fea584d7df1a62f04a2ea0cdad) [![PyPi version](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcastorini_daam_readme_9c6a80737c5b.png)](https:\u002F\u002Fpypi.org\u002Fproject\u002Fdaam) [![Downloads](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcastorini_daam_readme_8ea22d62bce6.png)](https:\u002F\u002Fpepy.tech\u002Fproject\u002Fdaam)\n\n![example image](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcastorini_daam_readme_fa9bba666980.jpg)\n\n### Updated to support Stable Diffusion XL (SDXL) and Diffusers 0.21.1!\n\nI regularly update this codebase. Please submit an issue if you have any questions.\n\nIn [our paper](https:\u002F\u002Faclanthology.org\u002F2023.acl-long.310), we propose diffusion attentive attribution maps (DAAM), a cross attention-based approach for interpreting Stable Diffusion.\nCheck out our demo: https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Ftetrisd\u002FDiffusion-Attentive-Attribution-Maps.\nSee our [documentation](https:\u002F\u002Fcastorini.github.io\u002Fdaam\u002F), hosted by GitHub pages, and [our Colab notebook](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1miGauqa07uHnDoe81NmbmtTtnupmlipv?usp=sharing), updated for v0.1.0.\n\n## Getting Started\nFirst, install [PyTorch](https:\u002F\u002Fpytorch.org) for your platform.\nThen, install DAAM with `pip install daam`, unless you want an editable version of the library, in which case do `git clone https:\u002F\u002Fgithub.com\u002Fcastorini\u002Fdaam && pip install -e daam`.\nFinally, login using `huggingface-cli login` to get many stable diffusion models -- you'll need to get a token at [HuggingFace.co](https:\u002F\u002Fhuggingface.co\u002F).\n\n### Running the Website Demo\nSimply run `daam-demo` in a shell and navigate to http:\u002F\u002Flocalhost:8080.\nThe same demo as the one on HuggingFace Spaces will show up.\n\n### Using DAAM as a CLI Utility\nDAAM comes with a simple generation script for people who want to quickly try it out.\nTry running\n```bash\n$ mkdir -p daam-test && cd daam-test\n$ daam \"A dog running across the field.\"\n$ ls\na.heat_map.png    field.heat_map.png    generation.pt   output.png  seed.txt\ndog.heat_map.png  running.heat_map.png  prompt.txt\n```\nYour current working directory will now contain the generated image as `output.png` and a DAAM map for every word, as well as some auxiliary data.\nYou can see more options for `daam` by running `daam -h`.\nTo use Stable Diffusion XL as the backend, run `daam --model xl-base-1.0 \"Dog jumping\"`.  \n\n### Using DAAM as a Library\n\nImport and use DAAM as follows:\n\n```python\nfrom daam import trace, set_seed\nfrom diffusers import DiffusionPipeline\nfrom matplotlib import pyplot as plt\nimport torch\n\n\nmodel_id = 'stabilityai\u002Fstable-diffusion-xl-base-1.0'\ndevice = 'cuda'\n\npipe = DiffusionPipeline.from_pretrained(model_id, use_auth_token=True, torch_dtype=torch.float16, use_safetensors=True, variant='fp16')\npipe = pipe.to(device)\n\nprompt = 'A dog runs across the field'\ngen = set_seed(0)  # for reproducibility\n\nwith torch.no_grad():\n    with trace(pipe) as tc:\n        out = pipe(prompt, num_inference_steps=50, generator=gen)\n        heat_map = tc.compute_global_heat_map()\n        heat_map = heat_map.compute_word_heat_map('dog')\n        heat_map.plot_overlay(out.images[0])\n        plt.show()\n```\n\nYou can also serialize and deserialize the DAAM maps pretty easily:\n\n```python\nfrom daam import GenerationExperiment, trace\n\nwith trace(pipe) as tc:\n    pipe('A dog and a cat')\n    exp = tc.to_experiment('experiment-dir')\n    exp.save()  # experiment-dir now contains all the data and heat maps\n\nexp = GenerationExperiment.load('experiment-dir')  # load the experiment\n```\n\nWe'll continue adding docs.\nIn the meantime, check out the `GenerationExperiment`, `GlobalHeatMap`, and `DiffusionHeatMapHooker` classes, as well as the `daam\u002Frun\u002F*.py` example scripts.\nYou can download the COCO-Gen dataset from the paper at http:\u002F\u002Fralphtang.com\u002Fcoco-gen.tar.gz.\nIf clicking the link doesn't work on your browser, copy and paste it in a new tab, or use a CLI utility such as `wget`.\n\n## See Also\n- [DAAM-i2i](https:\u002F\u002Fgithub.com\u002FRishiDarkDevil\u002Fdaam-i2i), an extension of DAAM to image-to-image attribution.\n\n- [Furkan's video](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=XiKyEKJrTLQ) on easily getting started with DAAM.\n\n- [1littlecoder's video](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=J2WtkA1Xfew) for a code demonstration and Colab notebook of an older version of DAAM.\n\n## Citation\n```\n@inproceedings{tang2023daam,\n    title = \"What the {DAAM}: Interpreting Stable Diffusion Using Cross Attention\",\n    author = \"Tang, Raphael  and\n      Liu, Linqing  and\n      Pandey, Akshat  and\n      Jiang, Zhiying  and\n      Yang, Gefei  and\n      Kumar, Karun  and\n      Stenetorp, Pontus  and\n      Lin, Jimmy  and\n      Ture, Ferhan\",\n    booktitle = \"Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)\",\n    year = \"2023\",\n    url = \"https:\u002F\u002Faclanthology.org\u002F2023.acl-long.310\",\n}\n```\n","# 什么是DAAM？利用交叉注意力解释Stable Diffusion\n\n[![HF Spaces](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FHuggingFace%20Space-online-green.svg)](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Ftetrisd\u002FDiffusion-Attentive-Attribution-Maps) [![引用](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FCitation-ACL-orange.svg)](https:\u002F\u002Fgist.github.com\u002Fdaemon\u002F639de6fea584d7df1a62f04a2ea0cdad) [![PyPi版本](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcastorini_daam_readme_9c6a80737c5b.png)](https:\u002F\u002Fpypi.org\u002Fproject\u002Fdaam) [![下载量](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcastorini_daam_readme_8ea22d62bce6.png)](https:\u002F\u002Fpepy.tech\u002Fproject\u002Fdaam)\n\n![示例图片](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcastorini_daam_readme_fa9bba666980.jpg)\n\n### 已更新以支持Stable Diffusion XL (SDXL) 和 Diffusers 0.21.1！\n\n我会定期更新此代码库。如有任何问题，请提交issue。\n\n在我们的论文中，我们提出了扩散注意力归因图（DAAM），这是一种基于交叉注意力的方法，用于解释Stable Diffusion模型。\n请查看我们的演示：https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Ftetrisd\u002FDiffusion-Attentive-Attribution-Maps。\n您还可以参阅由GitHub Pages托管的[文档](https:\u002F\u002Fcastorini.github.io\u002Fdaam\u002F)，以及为v0.1.0版本更新的[Colab笔记本](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1miGauqa07uHnDoe81NmbmtTtnupmlipv?usp=sharing)。\n\n## 快速入门\n首先，请根据您的平台安装[PyTorch](https:\u002F\u002Fpytorch.org)。\n然后，您可以使用`pip install daam`来安装DAAM；如果您需要可编辑的库版本，则可以执行`git clone https:\u002F\u002Fgithub.com\u002Fcastorini\u002Fdaam && pip install -e daam`。\n最后，使用`huggingface-cli login`登录以获取大量Stable Diffusion模型——您需要在[HuggingFace.co](https:\u002F\u002Fhuggingface.co\u002F)上获取一个token。\n\n### 运行网站演示\n只需在终端中运行`daam-demo`，然后访问http:\u002F\u002Flocalhost:8080即可。\n您将看到与HuggingFace Spaces上相同的演示页面。\n\n### 将DAAM用作命令行工具\nDAAM自带一个简单的生成脚本，方便用户快速试用。\n尝试运行以下命令：\n```bash\n$ mkdir -p daam-test && cd daam-test\n$ daam \"一只狗在田野上奔跑。\"\n$ ls\na.heat_map.png    field.heat_map.png    generation.pt   output.png  seed.txt\ndog.heat_map.png  running.heat_map.png  prompt.txt\n```\n此时，当前工作目录下将包含生成的图像`output.png`、每个单词对应的DAAM热力图，以及一些辅助数据。\n您可以通过运行`daam -h`查看更多选项。\n若要使用Stable Diffusion XL作为后端，请运行`daam --model xl-base-1.0 \"狗在跳跃\"`。\n\n### 将DAAM用作库\n您可以按如下方式导入并使用DAAM：\n\n```python\nfrom daam import trace, set_seed\nfrom diffusers import DiffusionPipeline\nfrom matplotlib import pyplot as plt\nimport torch\n\n\nmodel_id = 'stabilityai\u002Fstable-diffusion-xl-base-1.0'\ndevice = 'cuda'\n\npipe = DiffusionPipeline.from_pretrained(model_id, use_auth_token=True, torch_dtype=torch.float16, use_safetensors=True, variant='fp16')\npipe = pipe.to(device)\n\nprompt = '一只狗在田野上奔跑'\ngen = set_seed(0)  # 为了可重复性\n\nwith torch.no_grad():\n    with trace(pipe) as tc:\n        out = pipe(prompt, num_inference_steps=50, generator=gen)\n        heat_map = tc.compute_global_heat_map()\n        heat_map = heat_map.compute_word_heat_map('dog')\n        heat_map.plot_overlay(out.images[0])\n        plt.show()\n```\n\n您也可以非常方便地序列化和反序列化DAAM热力图：\n\n```python\nfrom daam import GenerationExperiment, trace\n\nwith trace(pipe) as tc:\n    pipe('一只狗和一只猫')\n    exp = tc.to_experiment('experiment-dir')\n    exp.save()  # experiment-dir 现在包含了所有数据和热力图\n\nexp = GenerationExperiment.load('experiment-dir')  # 加载实验\n```\n\n我们将继续完善文档。在此期间，您可以查看`GenerationExperiment`、`GlobalHeatMap`和`DiffusionHeatMapHooker`类，以及`daam\u002Frun\u002F*.py`中的示例脚本。\n您还可以从论文附带的链接下载COCO-Gen数据集：http:\u002F\u002Fralphtang.com\u002Fcoco-gen.tar.gz。\n如果浏览器无法直接打开该链接，请将其复制到新标签页中，或使用`wget`等命令行工具。\n\n## 另请参阅\n- [DAAM-i2i](https:\u002F\u002Fgithub.com\u002FRishiDarkDevil\u002Fdaam-i2i)，DAAM在图像到图像归因任务上的扩展。\n- [Furkan的视频](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=XiKyEKJrTLQ)，介绍如何轻松上手DAAM。\n- [1littlecoder的视频](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=J2WtkA1Xfew)，展示了旧版DAAM的代码演示及Colab笔记本。\n\n## 引用\n```\n@inproceedings{tang2023daam,\n    title = \"What the {DAAM}: Interpreting Stable Diffusion Using Cross Attention\",\n    author = \"Tang, Raphael  and\n      Liu, Linqing  and\n      Pandey, Akshat  and\n      Jiang, Zhiying  and\n      Yang, Gefei  and\n      Kumar, Karun  and\n      Stenetorp, Pontus  and\n      Lin, Jimmy  and\n      Ture, Ferhan\",\n    booktitle = \"Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)\",\n    year = \"2023\",\n    url = \"https:\u002F\u002Faclanthology.org\u002F2023.acl-long.310\",\n}\n```","# DAAM 快速上手指南\n\nDAAM (Diffusion Attentive Attribution Maps) 是一个基于交叉注意力机制的工具，用于解释和分析 Stable Diffusion 模型的生成过程。它能生成热力图，直观展示提示词中的每个单词如何影响最终图像的特定区域。\n\n## 环境准备\n\n在开始之前，请确保满足以下系统要求和前置依赖：\n\n*   **操作系统**：Linux, macOS 或 Windows\n*   **Python**：建议 Python 3.8 及以上版本\n*   **GPU**：推荐使用 NVIDIA GPU 以加速推理（需安装对应的 CUDA 驱动）\n*   **前置依赖**：\n    *   **PyTorch**：必须先安装与你的硬件环境匹配的 PyTorch 版本。\n    *   **Hugging Face 账号**：需要注册账号并获取 Access Token 以下载 Stable Diffusion 模型。\n\n> **国内加速建议**：\n> *   安装 PyTorch 时，建议访问 [PyTorch 官网](https:\u002F\u002Fpytorch.org\u002F) 选择对应命令，或使用清华\u002F中科大镜像源。\n> *   下载模型时，若网络受限，可配置 `HF_ENDPOINT` 环境变量使用 Hugging Face 国内镜像：\n>     ```bash\n>     export HF_ENDPOINT=https:\u002F\u002Fhf-mirror.com\n>     ```\n\n## 安装步骤\n\n1.  **安装 PyTorch**\n    请访问 [PyTorch 官网](https:\u002F\u002Fpytorch.org\u002Fget-started\u002Flocally\u002F) 获取适合你平台的安装命令并执行。例如：\n    ```bash\n    pip install torch torchvision torchaudio --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu118\n    ```\n\n2.  **安装 DAAM**\n    通过 pip 直接安装稳定版：\n    ```bash\n    pip install daam\n    ```\n    如果你需要修改源码或使用最新开发版，可以使用可编辑模式安装：\n    ```bash\n    git clone https:\u002F\u002Fgithub.com\u002Fcastorini\u002Fdaam\n    cd daam\n    pip install -e .\n    ```\n\n3.  **登录 Hugging Face**\n    为了能够下载 Stable Diffusion 模型，需要在终端登录你的 Hugging Face 账号：\n    ```bash\n    huggingface-cli login\n    ```\n    按提示输入你在 [HuggingFace.co](https:\u002F\u002Fhuggingface.co\u002Fsettings\u002Ftokens) 获取的 Access Token。\n\n## 基本使用\n\nDAAM 提供了命令行工具 (CLI) 和 Python 库两种使用方式。\n\n### 方法一：使用命令行工具 (最简单)\n\n这是快速体验 DAAM 功能的最快方式。运行以下命令将生成图像及对应的单词热力图。\n\n```bash\n# 创建测试目录并进入\nmkdir -p daam-test && cd daam-test\n\n# 运行生成命令\ndaam \"A dog running across the field.\"\n\n# 查看生成的文件\nls\n```\n\n**输出说明**：\n当前目录下将包含：\n*   `output.png`: 生成的原始图像。\n*   `*.heat_map.png`: 提示词中每个单词（如 `dog`, `running`, `field`）对应的注意力热力图。\n*   `prompt.txt`, `seed.txt`: 生成参数记录。\n\n**使用 Stable Diffusion XL (SDXL)**：\n若想使用更新的 SDXL 模型作为后端，添加 `--model` 参数：\n```bash\ndaam --model xl-base-1.0 \"Dog jumping\"\n```\n\n### 方法二：作为 Python 库使用\n\n你可以在自己的代码中集成 DAAM 进行更灵活的控制和分析。\n\n```python\nfrom daam import trace, set_seed\nfrom diffusers import DiffusionPipeline\nfrom matplotlib import pyplot as plt\nimport torch\n\n# 配置模型和设备\nmodel_id = 'stabilityai\u002Fstable-diffusion-xl-base-1.0'\ndevice = 'cuda'\n\n# 加载管道\npipe = DiffusionPipeline.from_pretrained(\n    model_id, \n    use_auth_token=True, \n    torch_dtype=torch.float16, \n    use_safetensors=True, \n    variant='fp16'\n)\npipe = pipe.to(device)\n\nprompt = 'A dog runs across the field'\ngen = set_seed(0)  # 设置随机种子以保证结果可复现\n\n# 使用 trace 上下文管理器捕获注意力图\nwith torch.no_grad():\n    with trace(pipe) as tc:\n        out = pipe(prompt, num_inference_steps=50, generator=gen)\n        \n        # 计算全局热力图\n        heat_map = tc.compute_global_heat_map()\n        \n        # 计算特定单词 ('dog') 的热力图\n        heat_map = heat_map.compute_word_heat_map('dog')\n        \n        # 绘制叠加图\n        heat_map.plot_overlay(out.images[0])\n        plt.show()\n```\n\n**保存与加载实验数据**：\nDAAM 支持将生成的实验数据（包含所有热力图和元数据）序列化保存到磁盘，方便后续分析。\n\n```python\nfrom daam import GenerationExperiment, trace\n\n# 保存实验\nwith trace(pipe) as tc:\n    pipe('A dog and a cat')\n    exp = tc.to_experiment('experiment-dir')\n    exp.save()  # 数据已保存至 experiment-dir 目录\n\n# 加载实验\nexp = GenerationExperiment.load('experiment-dir')\n```","一位数字艺术家正在为游戏项目批量生成角色概念图，需要确保 Stable Diffusion 能精准还原提示词中的关键细节（如“红色披风”或“机械义肢”），避免画面元素错位。\n\n### 没有 daam 时\n- 生成结果不符合预期时，只能盲目调整提示词顺序或权重，完全靠猜测模型到底关注了哪些词汇。\n- 无法确认模型是否真的“看懂”了复杂指令，经常出现在描述“拿着剑的骑士”时，剑却凭空消失或长在手上的情况。\n- 调试过程极其低效，为了修正一个局部错误，往往需要重新生成数十张图片来碰运气，浪费大量算力和时间。\n- 难以向团队成员解释为何模型会产生某种偏差，缺乏可视化的证据来支撑优化方案。\n\n### 使用 daam 后\n- 直接生成每个提示词对应的热力图，清晰看到“红色披风”具体映射在图像的哪个区域，瞬间定位模型注意力的焦点。\n- 通过可视化交叉注意力机制，快速发现模型忽略了“机械义肢”或错误关联了背景，从而针对性地修改提示词结构。\n- 大幅减少试错成本，只需分析一张图的热力图即可确定问题根源，将原本需要几十次的迭代缩减为两三次精准调整。\n- 利用导出的实验数据与热力图，直观地向团队展示模型对特定词汇的理解偏差，使协作沟通更有据可依。\n\ndaam 将 Stable Diffusion 的“黑盒”思维过程转化为可视化的热力图，让创作者从盲目猜谜转向精准控制，显著提升生成内容的可控性与生产效率。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fcastorini_daam_fa9bba66.jpg","castorini","Castorini","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fcastorini_706a9662.jpg","Jimmy Lin's research group at the University of Waterloo",null,"castorini.io","https:\u002F\u002Fgithub.com\u002Fcastorini",[80,84,88],{"name":81,"color":82,"percentage":83},"Jupyter Notebook","#DA5B0B",96.7,{"name":85,"color":86,"percentage":87},"Python","#3572A5",3.2,{"name":89,"color":90,"percentage":91},"CSS","#663399",0,795,69,"2026-04-10T07:50:14","MIT","Linux, macOS, Windows","必需（用于运行 Stable Diffusion），建议使用支持 CUDA 的 NVIDIA GPU。代码示例显示使用 torch.float16，通常建议显存 8GB+ 以运行 SDXL 模型。","未说明（建议 16GB+ 以流畅运行大模型）",{"notes":100,"python":101,"dependencies":102},"1. 首次使用前需通过 'huggingface-cli login' 登录并获取 Token 以下载模型。\n2. 已更新支持 Stable Diffusion XL (SDXL) 和 Diffusers 0.21.1 版本。\n3. 可通过 'pip install daam' 直接安装，或克隆源码进行可编辑安装。\n4. 提供命令行工具 'daam' 和本地演示服务 'daam-demo'。","未说明",[103,104,105,106],"torch","diffusers>=0.21.1","matplotlib","huggingface-cli",[14,15],[109,110,111,112,113,114],"explainable-ai","huggingface","pytorch","stable-diffusion","generative-ai","diffusion","2026-03-27T02:49:30.150509","2026-04-19T03:05:55.922537",[118,123,128,133,138,143,148,153],{"id":119,"question_zh":120,"answer_zh":121,"source_url":122},41286,"安装时遇到 'Requires-Python >=3.10' 错误，但我使用的是 Python 3.8 怎么办？","维护者已确认将在下一个主要版本中将要求降级为 Python 3.8。目前如果您需要在离线设备或特定环境中运行，建议暂时将 Python 环境降级至 3.8 版本即可正常安装和使用。","https:\u002F\u002Fgithub.com\u002Fcastorini\u002Fdaam\u002Fissues\u002F5",{"id":124,"question_zh":125,"answer_zh":126,"source_url":127},41287,"DAAM 是否支持 Stable Diffusion V2 模型？","是的，最新版本已更新以支持 Stable Diffusion V2。请查看项目的 README 文件，其中包含了用于 V2 模型的 CLI 工具使用说明。","https:\u002F\u002Fgithub.com\u002Fcastorini\u002Fdaam\u002Fissues\u002F9",{"id":129,"question_zh":130,"answer_zh":131,"source_url":132},41288,"在计算热力图时，参数 `time_idx` 具体代表什么含义？是指去噪的第一步还是最后一步？","`time_idx` 指的是对 U-Net 调用的顺序索引。在代码循环 `for time_idx, time_step in enumerate(ts_schedule)` 中，`time_idx == 0` 代表对 U-Net 的第一次调用（即去噪过程的第一步），对应的热力图也是基于此次调用生成的。它并不直接等同于调度器的时间步数值（如 999），而是指迭代次数。","https:\u002F\u002Fgithub.com\u002Fcastorini\u002Fdaam\u002Fissues\u002F15",{"id":134,"question_zh":135,"answer_zh":136,"source_url":137},41289,"运行 `compute_global_heat_map` 时报错 'RuntimeError: stack expects a non-empty TensorList' 如何解决？","该错误通常是因为 DAAM 当前不支持切片注意力（sliced attention）机制。如果遇到此问题，请检查您的 Pipeline 配置，确保未启用 sliced attention 选项。维护者表示会在后续更新中修复对此特性的支持。","https:\u002F\u002Fgithub.com\u002Fcastorini\u002Fdaam\u002Fissues\u002F12",{"id":139,"question_zh":140,"answer_zh":141,"source_url":142},41290,"遇到 'TypeError: FrozenCLIPEmbedder... takes 2 positional arguments but 4 were given' 错误怎么办？","这通常是由于 `transformers` 库版本不兼容导致的。DAAM 目前要求 `transformers` 版本为 4.24.0（参考 requirements.txt）。如果您使用了更高版本（如 4.25 或 4.27），可能会引发此错误。建议将 `transformers` 降级至 4.24.0，或者等待并安装最新的 DAAM 版本，因为新版本已尝试兼容更新的库。","https:\u002F\u002Fgithub.com\u002Fcastorini\u002Fdaam\u002Fissues\u002F30",{"id":144,"question_zh":145,"answer_zh":146,"source_url":147},41291,"DAAM 是否支持最新的 Diffusers 库（如 0.11.0 或更高版本）？","是的，项目已更新以支持最新的 Diffusers 0.14.0 和 Transformers 4.27 库。此外，更新后的版本在安装或使用 `xformers` 时也不会导致崩溃。请确保您将 DAAM 升级到最新版本以获得这些兼容性改进。","https:\u002F\u002Fgithub.com\u002Fcastorini\u002Fdaam\u002Fissues\u002F31",{"id":149,"question_zh":150,"answer_zh":151,"source_url":152},41292,"DAAM 是否支持 SDXL (Stable Diffusion XL) 模型？","是的，最新发布的版本已经添加了对 SDXL 的支持。此前由于 Diffusers 0.16 版本尚未包含 `StableDiffusionXLPipeline` 而导致不支持，但该问题已在后续更新（PR #56）中解决。请升级到最新版本以使用 SDXL 功能。","https:\u002F\u002Fgithub.com\u002Fcastorini\u002Fdaam\u002Fissues\u002F50",{"id":154,"question_zh":155,"answer_zh":156,"source_url":157},41293,"如何在多对象图像上评估 DAAM？如果一个像素被多个名词激活该怎么办？","在多对象评估中，可以直接比较不同类别的注意力值。有用户在实际测试中（基于 PASCAL VOC2012 数据集），使用提示语 \"a photo of the ...\" 直接比较不同类的注意力值，取得了比传统 CAM 方法更好的 mIOU 结果。虽然存在一个像素对应多个名词的情况，但在弱监督语义分割协议下，直接进行注意力值的对比和 argmax 处理是可行的方案。","https:\u002F\u002Fgithub.com\u002Fcastorini\u002Fdaam\u002Fissues\u002F1",[159,164,169,174,179,184,189,194,199,204,209,214,218,223,228],{"id":160,"version":161,"summary_zh":162,"released_at":163},333238,"v0.2.0","## 变更内容\n* 由 @daemon 在 https:\u002F\u002Fgithub.com\u002Fcastorini\u002Fdaam\u002Fpull\u002F45 中修复了 downblock 列表的长度问题。\n* 由 @rockerBOO 在 https:\u002F\u002Fgithub.com\u002Fcastorini\u002Fdaam\u002Fpull\u002F53 中移除了交叉注意力处理器的挂钩。\n* 由 @daemon 在 https:\u002F\u002Fgithub.com\u002Fcastorini\u002Fdaam\u002Fpull\u002F56 中添加了 Stable Diffusion XL 的支持。\n\n## 新贡献者\n* @rockerBOO 在 https:\u002F\u002Fgithub.com\u002Fcastorini\u002Fdaam\u002Fpull\u002F53 中完成了首次贡献。\n\n**完整变更日志**: https:\u002F\u002Fgithub.com\u002Fcastorini\u002Fdaam\u002Fcompare\u002Fv0.1.0...v0.2.0","2024-01-07T20:51:47",{"id":165,"version":166,"summary_zh":167,"released_at":168},333239,"v0.1.0","**完整更新日志**: https:\u002F\u002Fgithub.com\u002Fcastorini\u002Fdaam\u002Fcompare\u002Fv0.0.15...v0.1.0","2023-07-06T06:53:53",{"id":170,"version":171,"summary_zh":172,"released_at":173},333240,"v0.0.15","## 变更内容\n* 由 @wangdong2023 在 https:\u002F\u002Fgithub.com\u002Fcastorini\u002Fdaam\u002Fpull\u002F41 中升级了 diffusers\n\n## 新贡献者\n* @wangdong2023 在 https:\u002F\u002Fgithub.com\u002Fcastorini\u002Fdaam\u002Fpull\u002F41 中完成了首次贡献\n\n**完整变更日志**: https:\u002F\u002Fgithub.com\u002Fcastorini\u002Fdaam\u002Fcompare\u002Fv0.0.13...v0.0.15","2023-06-08T05:13:31",{"id":175,"version":176,"summary_zh":177,"released_at":178},333241,"v0.0.13","## 变更内容\n- 更新以支持最新的 Diffusers 0.14.0 和 Transformers 4.27 库。\n\n**完整变更日志**: https:\u002F\u002Fgithub.com\u002Fcastorini\u002Fdaam\u002Fcompare\u002Fv0.0.12...v0.0.13","2023-04-08T23:04:55",{"id":180,"version":181,"summary_zh":182,"released_at":183},333242,"v0.0.12","添加对 v2.1 模型的支持。","2022-12-16T14:11:19",{"id":185,"version":186,"summary_zh":187,"released_at":188},333243,"v0.0.11","## 变更内容\n* 由 @sALTaccount 在 https:\u002F\u002Fgithub.com\u002Fcastorini\u002Fdaam\u002Fpull\u002F17 中修复了下划线问题，并使合并索引的计算更加健壮。\n* 由 @daemon 在 https:\u002F\u002Fgithub.com\u002Fcastorini\u002Fdaam\u002Fpull\u002F21 中添加了对 CPU 的支持。\n\n## 新贡献者\n* @sALTaccount 在 https:\u002F\u002Fgithub.com\u002Fcastorini\u002Fdaam\u002Fpull\u002F17 中完成了首次贡献。\n\n**完整变更日志**: https:\u002F\u002Fgithub.com\u002Fcastorini\u002Fdaam\u002Fcompare\u002Fv0.0.10...v0.0.11","2022-12-09T03:15:21",{"id":190,"version":191,"summary_zh":192,"released_at":193},333244,"v0.0.10","## 变更内容\n* @ji-xin 在 https:\u002F\u002Fgithub.com\u002Fcastorini\u002Fdaam\u002Fpull\u002F13 中添加了示例\n\n## 新贡献者\n* @ji-xin 在 https:\u002F\u002Fgithub.com\u002Fcastorini\u002Fdaam\u002Fpull\u002F13 中完成了首次贡献\n\n**完整变更日志**: https:\u002F\u002Fgithub.com\u002Fcastorini\u002Fdaam\u002Fcompare\u002Fv0.0.9...v0.0.10","2022-12-08T04:46:46",{"id":195,"version":196,"summary_zh":197,"released_at":198},333245,"v0.0.9","**完整更新日志**: https:\u002F\u002Fgithub.com\u002Fcastorini\u002Fdaam\u002Fcompare\u002Fv0.0.8...v0.0.9","2022-11-30T18:19:41",{"id":200,"version":201,"summary_zh":202,"released_at":203},333246,"v0.0.8","**完整更新日志**: https:\u002F\u002Fgithub.com\u002Fcastorini\u002Fdaam\u002Fcompare\u002Fv0.0.7...v0.0.8","2022-11-30T18:00:53",{"id":205,"version":206,"summary_zh":207,"released_at":208},333247,"v0.0.7","**完整更新日志**: https:\u002F\u002Fgithub.com\u002Fcastorini\u002Fdaam\u002Fcompare\u002Fv0.0.6...v0.0.7","2022-11-30T17:53:08",{"id":210,"version":211,"summary_zh":212,"released_at":213},333248,"v0.0.6","## What's Changed\r\n* Add head or layer index in model by @likicode in https:\u002F\u002Fgithub.com\u002Fcastorini\u002Fdaam\u002Fpull\u002F8\r\n* Add support for Stable Diffusion 2.0 by @daemon in https:\u002F\u002Fgithub.com\u002Fcastorini\u002Fdaam\u002Fpull\u002F10\r\n* Add CLI utility -- see readme.\r\n* Make DAAM map generation more efficient.\r\n\r\n## New Contributors\r\n* @likicode made their first contribution in https:\u002F\u002Fgithub.com\u002Fcastorini\u002Fdaam\u002Fpull\u002F8\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fcastorini\u002Fdaam\u002Fcompare\u002Fv0.0.5...v0.0.6","2022-11-30T05:48:38",{"id":215,"version":216,"summary_zh":76,"released_at":217},333249,"v0.0.5","2022-11-17T04:53:48",{"id":219,"version":220,"summary_zh":221,"released_at":222},333250,"v0.0.4","DAAM currently incompatible with the latest Diffusers library, so requirements now has a `0.3.0` constraint.","2022-11-15T05:43:08",{"id":224,"version":225,"summary_zh":226,"released_at":227},333251,"v0.0.3","**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fcastorini\u002Fdaam\u002Fcompare\u002Fv0.0.2...v0.0.3","2022-11-12T02:19:31",{"id":229,"version":230,"summary_zh":231,"released_at":232},333252,"v0.0.2","Bleeding-edge alpha release. See README.md.","2022-11-12T02:11:36"]