Borrowing it
Nothing to install: this file belongs to yxhpy/comfy-prompt-studio. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/yxhpy/comfy-prompt-studio/main/AGENTS.mdgit clone --depth 1 https://github.com/yxhpy/comfy-prompt-studioWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/yxhpy/comfy-prompt-studio/agents-md)<a href="https://agentmods.dev/instructions/yxhpy/comfy-prompt-studio/agents-md"><img src="https://agentmods.dev/badge/instructions/yxhpy/comfy-prompt-studio/agents-md.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01245 | $0.01245 |
| Opus 5 | $0.00622 | $0.00622 |
| Sonnet 5 | $0.00249 | $0.00249 |
| Haiku 4.5 | $0.00125 | $0.00125 |
Grade A, and why
comfy-prompt-studio AGENTS.md scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
response = requests.get(f"{OLLAMA_URL}/api/tags") How it starts
The opening of the file, as written. The whole thing — 186 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md - AI 代理配置文档
本文档说明项目中使用的 AI 代理配置和提示词生成服务。
AI 提供商
项目支持两种 AI 提供商,通过环境变量 AI_PROVIDER 配置:
1. Ollama (默认)
配置参数:
AI_PROVIDER=ollama
OLLAMA_MODEL=huihui_ai/qwen3-abliterated:30b
OLLAMA_URL=http://localhost:11434
特点:
- 本地部署,数据隐私性强
- 需要本地运行 Ollama 服务
- 支持多种开源模型
- 默认端口:11434
使用场景:
- 对数据隐私有要求的场景
- 需要离线工作的环境
- 自定义模型训练
2. Gemini
配置参数:
AI_PROVIDER=gemini
GEMINI_API_KEY=your-api-key-here
GEMINI_MODEL=gemini-2.0-flash-exp
GEMINI_BASE_URL=https://api.laozhang.ai/v1/
特点:
- 云端 API 服务
- 响应速度快
- 需要 API 密钥
- 支持流式响应
使用场景:
- 需要快速响应的场景
- 不便部署本地模型的环境
- 对最新模型能力有要求
提示词生成服务
核心模块
位置: src/core/prompt/generator.py
主要功能:
- 增强用户输入的简单提示词
- 生成详细的 Stable Diffusion 风格提示词
- 支持中英文输入
- 自动添加画质关键词
提示词生成流程
用户输入 → AI 代理 → 提示词增强 → 返回优化后的提示词
提示词模板
系统使用固定的提示词模板来指导 AI 生成高质量的图像描述:
PROMPT_TEMPLATE = """
你是一个专业的 Stable Diffusion 提示词专家。
用户会给你一个简单的描述,请帮助扩展成详细的 Stable Diffusion 提示词。
要求:
1. 保持用户原意,不要改变主题
2. 添加详细的画面细节、氛围、光影描述
3. 添加适当的画质关键词(如 masterpiece, best quality, ultra detailed 等)
4. 使用英文逗号分隔的关键词格式
5. 直接输出提示词,不要有其他说明文字
用户输入:{user_prompt}
"""
使用示例
输入:
一个女孩在花园里
输出:
masterpiece, best quality, ultra detailed, 8k wallpaper,
a beautiful girl standing in a lush garden,
surrounded by colorful flowers, soft sunlight filtering through trees,
peaceful atmosphere, detailed facial features, elegant pose,
vibrant colors, professional photography, shallow depth of field
单例模式实现
提示词服务使用单例模式,确保在应用生命周期内只初始化一次:
位置: src/services/prompt_service.py
优势:
- 避免重复初始化 AI 客户端
- 减少资源消耗
- 全局共享配置
使用方法:
from src.services.prompt_service import PromptService
service = PromptService.get_instance()
enhanced_prompt = service.generate_prompt("用户输入")
服务健康检查
在应用启动时,系统会自动检查 AI 服务的可用性:
Ollama 检查:
response = requests.get(f"{OLLAMA_URL}/api/tags")
if response.status_code == 200:
print("✅ Ollama 服务正常")
Gemini 检查:
client = OpenAI(api_key=GEMINI_API_KEY, base_url=GEMINI_BASE_URL)
# 测试连接
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 8d ago First seen · 186 lines · 1,245 tokens per session scan A 709f979eeb90
comfy-prompt-studio AGENTS.md is an instructions file published in the GitHub repository yxhpy/comfy-prompt-studio (85 stars, last pushed 5mo ago), licensed MIT. It adds 1,245 tokens to every session, about $0.0062 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other instructions, from other repositories
codex AGENTS.md
AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).
spec-kit AGENTS.md
AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.