【新功能】添加了Prompt Manager扩展,支持自定义提示词管理。
This commit is contained in:
@@ -8,6 +8,24 @@ A collection of fully customized ComfyUI nodes developed by Dontdrunk, designed
|
||||
|
||||
## Node List
|
||||
|
||||
<details>
|
||||
<summary>🎯 DD Prompt Manager (New Feature)</summary>
|
||||
|
||||
Intelligent prompt embedding and management system that provides powerful prompt management capabilities for all CLIP text encoder nodes:
|
||||
|
||||
**Core Features:**
|
||||
- 🔍 **Smart Node Recognition**: Automatically adds "Embed Prompt" buttons to various CLIP text encoders
|
||||
- 📁 **Import/Export**: Supports JSON format prompt backup and sharing, allowing you to share your prompts with others and import prompts from others
|
||||
|
||||
**Use Cases:**
|
||||
- Manage commonly used positive/negative prompt templates
|
||||
- Quickly switch between different style prompt combinations
|
||||
- Share and backup prompt libraries among teams
|
||||
- Improve workflow creation efficiency
|
||||
- Efficiently manage LORA model prompts
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>DD Model Optimizer + DD Sampling Optimizer</summary>
|
||||
|
||||
@@ -121,6 +139,12 @@ This extension now supports ComfyUI's native internationalization (i18n) system,
|
||||
3. Currently only supports node translation, frontend functionality translation is not yet supported
|
||||
|
||||
## Version History
|
||||
- v2.4.0 (2025-06-18)
|
||||
- 🎉 **New Prompt Manager Feature**:
|
||||
- Added intelligent prompt embedding functionality for all CLIP text encoder nodes
|
||||
- Supports CRUD operations for prompts with a modern management interface
|
||||
- Supports import/export of prompt files in JSON format
|
||||
|
||||
- v2.3.1 (2025-05-27)
|
||||
- Improved UI, added theme options, and fixed bugs.
|
||||
|
||||
|
||||
@@ -8,6 +8,24 @@
|
||||
|
||||
## 当前节点列表
|
||||
|
||||
<details>
|
||||
<summary>🎯 DD 提示词管理器(全新功能)</summary>
|
||||
|
||||
智能提示词嵌入和管理系统,为所有 CLIP 文本编码器节点提供强大的提示词管理功能:
|
||||
|
||||
**核心特性:**
|
||||
- 🔍 **智能节点识别**:自动为各种 CLIP 文本编码器添加"嵌入提示词"按钮
|
||||
- 📁 **导入导出**:支持 JSON 格式的提示词备份和分享,可以将自己的提示词分享给他人,也可以导入他人的提示词
|
||||
|
||||
**使用场景:**
|
||||
- 管理常用的正面/负面提示词模板
|
||||
- 快速切换不同风格的提示词组合
|
||||
- 团队间分享和备份提示词库
|
||||
- 提高工作流创作效率
|
||||
- 高效管理LORA模型提示词
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>DD 模型优化加载+DD 采样优化器</summary>
|
||||
|
||||
@@ -90,9 +108,8 @@
|
||||
<details>
|
||||
<summary>DD 界面布局</summary>
|
||||
|
||||
- 已实现Bate版本,可以随机或指定节点标题的颜色,可以对杂乱节点做快速整理
|
||||
- 美化UI,添加主题系统,每一种主题有两种不同风格可以切换,支持自定义主题
|
||||
- 添加模块化预设,可以预设自己的布局,一键应用
|
||||
- 已实现Alpha版本,可以随机或指定节点标题的颜色,可以对杂乱节点做快速整理
|
||||
- 美化UI,添加主题系统,每一种主题有两种不同风格可以切换,点击硬币动画即可切换
|
||||
|
||||
</details>
|
||||
|
||||
@@ -122,10 +139,16 @@
|
||||
本扩展现已支持 ComfyUI 原生国际化(i18n)系统,可在中英文间切换:
|
||||
|
||||
1. 切换语言:在 ComfyUI 界面右上角设置菜单中选择语言选项
|
||||
2. 选择中文(zh)或英文(en)
|
||||
2. 选择中文(zh)和 英文(en)
|
||||
3. 暂时只支持节点翻译,暂不支持前端功能翻译切换
|
||||
|
||||
## 版本历史
|
||||
- v2.4.0 (2025-06-18)
|
||||
- 🎉 **新增提示词管理器(Prompt Manager)**:
|
||||
- 为所有 CLIP 文本编码器节点添加智能提示词嵌入功能
|
||||
- 支持提示词的增删改查,提供现代化的管理界面
|
||||
- 支持导入导出 JSON 格式的提示词文件
|
||||
|
||||
- v2.3.1 (2025-05-27)
|
||||
- 完善界面UI添加主题选项,修复BUG。
|
||||
|
||||
@@ -215,9 +238,9 @@
|
||||
这是一个持续成长的节点集合,主要用于分享实用的 ComfyUI 扩展工具。欢迎通过 Issues 提供建议和反馈。如果您发现任何问题或有任何改进建议,请随时提出。
|
||||
|
||||
## 许可证
|
||||
- MIT授权协议
|
||||
|
||||
MIT
|
||||
|
||||
## 打赏作者
|
||||
1. 听说项目的成长需要Money来维持
|
||||
2. 不打赏的话,作者可能会:
|
||||
- 🦥 躺平摆烂
|
||||
|
||||
+1
-1
@@ -48,4 +48,4 @@ NODE_DISPLAY_NAME_MAPPINGS = {
|
||||
|
||||
__all__ = ['NODE_CLASS_MAPPINGS', 'NODE_DISPLAY_NAME_MAPPINGS']
|
||||
|
||||
WEB_DIRECTORY = "js"
|
||||
WEB_DIRECTORY = "extensions"
|
||||
@@ -0,0 +1,12 @@
|
||||
# ComfyUI Prompt Manager Extension
|
||||
# This extension adds prompt embedding functionality to CLIP text encoder nodes
|
||||
|
||||
# 导入API处理程序
|
||||
from .api.prompt_api import prompt_api
|
||||
|
||||
NODE_CLASS_MAPPINGS = {}
|
||||
NODE_DISPLAY_NAME_MAPPINGS = {}
|
||||
|
||||
WEB_DIRECTORY = "./web"
|
||||
|
||||
__all__ = ['NODE_CLASS_MAPPINGS', 'NODE_DISPLAY_NAME_MAPPINGS', 'WEB_DIRECTORY']
|
||||
@@ -0,0 +1 @@
|
||||
# Prompt Manager API Module
|
||||
@@ -0,0 +1,58 @@
|
||||
import os
|
||||
import json
|
||||
from aiohttp import web
|
||||
import aiohttp
|
||||
from server import PromptServer
|
||||
|
||||
# 提示词数据存储路径
|
||||
PROMPTS_FILE = os.path.join(os.path.dirname(__file__), "prompts.json")
|
||||
|
||||
class PromptEmbedderAPI:
|
||||
def __init__(self):
|
||||
self.prompts = self.load_prompts()
|
||||
|
||||
def load_prompts(self):
|
||||
"""从JSON文件加载提示词"""
|
||||
if os.path.exists(PROMPTS_FILE):
|
||||
try:
|
||||
with open(PROMPTS_FILE, 'r', encoding='utf-8') as f:
|
||||
return json.load(f)
|
||||
except Exception as e:
|
||||
print(f"Error loading prompts: {e}")
|
||||
return []
|
||||
return []
|
||||
|
||||
def save_prompts(self):
|
||||
"""保存提示词到JSON文件"""
|
||||
try:
|
||||
os.makedirs(os.path.dirname(PROMPTS_FILE), exist_ok=True)
|
||||
with open(PROMPTS_FILE, 'w', encoding='utf-8') as f:
|
||||
json.dump(self.prompts, f, ensure_ascii=False, indent=2)
|
||||
return True
|
||||
except Exception as e:
|
||||
print(f"Error saving prompts: {e}")
|
||||
return False
|
||||
|
||||
async def get_prompts(self, request):
|
||||
"""获取所有提示词"""
|
||||
return web.json_response(self.prompts)
|
||||
|
||||
async def save_prompts_api(self, request):
|
||||
"""保存提示词列表"""
|
||||
try:
|
||||
data = await request.json()
|
||||
self.prompts = data
|
||||
success = self.save_prompts()
|
||||
if success:
|
||||
return web.json_response({"status": "success"})
|
||||
else:
|
||||
return web.json_response({"status": "error", "message": "Failed to save prompts"}, status=500)
|
||||
except Exception as e:
|
||||
return web.json_response({"status": "error", "message": str(e)}, status=400)
|
||||
|
||||
# 创建API实例
|
||||
prompt_api = PromptEmbedderAPI()
|
||||
|
||||
# 注册路由
|
||||
PromptServer.instance.routes.get("/prompt_embedder/prompts")(prompt_api.get_prompts)
|
||||
PromptServer.instance.routes.post("/prompt_embedder/prompts")(prompt_api.save_prompts_api)
|
||||
@@ -0,0 +1,14 @@
|
||||
[
|
||||
{
|
||||
"id": 1,
|
||||
"name": "示例提示词1",
|
||||
"content": "beautiful, detailed, high quality, masterpiece",
|
||||
"createdAt": "2025-06-18T00:00:00.000Z"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"name": "示例提示词2",
|
||||
"content": "1girl, anime style, colorful, vibrant",
|
||||
"createdAt": "2025-06-18T00:00:00.000Z"
|
||||
}
|
||||
]
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,18 @@
|
||||
/* ComfyUI Prompt Manager Extension Styles */
|
||||
|
||||
/* 确保在ComfyUI环境中的样式兼容性 */
|
||||
.prompt-embedder-modal * {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* 节点按钮样式增强 */
|
||||
.comfy-multiline-input.prompt-embedder-enhanced {
|
||||
border-bottom: 2px solid #2a82e4;
|
||||
}
|
||||
|
||||
/* 提示词按钮悬停效果 */
|
||||
.prompt-embedder-button:hover {
|
||||
background: #1f6bb8 !important;
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 2px 4px rgba(42, 130, 228, 0.3);
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// ComfyUI-DD-Nodes 前端插件入口
|
||||
import "./Online Animation/ConnectionAnimationExt.js";
|
||||
import "./Intelligent Layout/LayoutExt.js";
|
||||
import "./Intelligent Layout/LayoutExt.js";
|
||||
import "./Prompt_Manager/web/PromptManagerExt.js";
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
[project]
|
||||
name = "comfyui-dd-nodes"
|
||||
description = "Advanced utility nodes for ComfyUI with intelligent layout and animation features."
|
||||
version = "2.2.0"
|
||||
version = "2.4.0"
|
||||
license = {file = "LICENSE"}
|
||||
dependencies = ["git+https://github.com/Dontdrunk/ComfyUI-DD-Nodes.git"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user