Giter VIP home page Giter VIP logo

openpromptstudio's Introduction

🥣 OPS/OpenPromptStudio

提示词工作室 | 可视化编辑提示词

OPS-cover

🥣 立即试试 moonvy.com/apps/ops/

这是一个旨在把 AIGC 提示词(现在支持 Midjourney)可视化并提供编辑功能的工具,有以下特性

  • 显示英文提示词的中文翻译
  • 翻译输入的中文提示词到英文(因为 Midjourney 仅支持英文提示词)
  • 为提示词进行分类(普通、样式、质量、命令)
  • 轻松的排序、隐藏提示词
  • 把提示词可视化结果导出为图片
  • 常用提示词词典
  • 通过 Notion 管理提示词词典

使用教程

OPS-cover

📺 B 站视频教程

如何连接的我的 Notion 来管理自己的词典

OPS 支持使用 Notion 来管理自己的词典,使用 Notion 管理相对简单,可自定义程度也很高。

1. 复制「演示-AIGC 提示词库」

复制我们的演示文档的自己的 Notion 工作区中

📕 演示-AIGC 提示词库

保持表头定义: text, subTypedirlang_zh 不要变(或者你可以新建一个 Notion 数据库,只要有这些表头 OPS 就能连接的这个数据库)

Notion 表头定义

表头 作用
text 提示词原文(不区分大小写)
lang_zh 对应的中文翻译
subType 提示词在 OPS 中的分类(普通风格质量命令
dir 词典中的分类,子分类用/分隔如:风格/绘画风格
alias 别名,可以有多个,用, 分隔

2. 创建自己的 Notion 集成插件(integrations)

要让 OPS 连接到自己的 Notion 数据库,需要创建一个自己的集成(integrations)。OPS 会通过此集成的权限连接到你的数据库。

2.1 打开集成开发页面

打开 Notion 的集成开发页面 🔗 www.notion.so/my-integrations 点击 「+ new integrations」按钮创建一个新集成插件

2.2 创建集成插件

在集成插件页面中选择允许访问的 Notion 工作区(Workspace),你的 Notion 数据库需要创建在此工作区下,OPS 才能通过集成插件访问。

2.3 获取集成插件 Token 密钥

集成插件创建完毕后,复制 Token 秘钥保存下来,你将使用此 Token 作为访问凭证,请妥善保管不要在公开场合泄露。

2.4 在数据库页面链接到你的集成

集成插件创建后,还需要在你的 Notion 数据库的菜单中连接到你的集成插件:

3. 在 OPS 中配置 Notion

在 OPS 右上角打开提示词词典,鼠标放在「连接我的 Notion」按钮上,展开设置面板

  • 「Integrations Token」 里面填入前面我们生成的集成 Token 秘钥(秘钥只会保存在浏览器本地(localStorage),不会被上传到任何地方)

  • 「Database ID」里粘贴你 Notion 数据库的访问地址

  • 然后点击「载入」按钮

获取 Notion 数据库的访问地址(DatabaseID

在 Notion 数据库菜单中点击 「Copy link to view」 就可以了,粘贴 Notion 数据库地址到 OPS 的配置输入框后会自动提取 DatabaseID

更好的体验

你可以在 zeroG 浏览器 里让 OPS 与 Discord 在一个无限画布中使用,获得更好的体验

截屏2023-04-06 15.51.23.png

开发者

本地运行需要 NodeJS 环境

使用 npm run start 运行

运行打开后访问 localhost:12833/apps/ops/

Docker

如果你不想安装 NodeJS 环境,可以使用 Docker 运行,参考 ./docker

如何修改默认提示词词典

  1. ./data/src 中编辑 .csv 文件,你可以用 Excel、Numbers 或者纯文本编辑器编辑。

  2. Notion 中编辑(./data/src/notion/fromNotion.js

翻译服务

./server 文件夹中有一个翻译服务的简单实现,调用腾讯翻译 你需要申请一个腾讯机器翻译的账号(每月免费额度 500 万字) 然后在项目根目录创建一个 .env 文件写入你的的 SECRET_IDSECRET_KEY

.env

# 翻译机配置 https://bobtranslate.com/service/translate/tencent.html
TENCENT_SECRET_ID="AKIDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
TENCENT_SECRET_KEY="a5XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

# 自定义翻译服务地址 [可选] (如果你部署在服务器上,通过此配置指定 Web 端访问翻译服务的地址)
# LOCAL_TRANSLATE_HOST="192.168.50.222:3000"

然后运行 npm run serve 启动 OPS 服务本地翻译服务

自部署

如果要部署到自己的服务器,请在 .env 文件中配置翻译服务的访问地址: LOCAL_TRANSLATE_HOST,如 192.168.50.222:3000或者https://mySite.com,在 Web 页中会根据此地址发起请求,请根据你部署后实际访问地址来配置。

openpromptstudio's People

Contributors

0xllllh avatar eltociear avatar godlockin avatar olalalalao avatar richardoey avatar sinlov avatar v0ker avatar yarna avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openpromptstudio's Issues

本地翻譯問題,請教備份問題

  1. 如果部屬在另外一台,用本地翻譯就不能使用,我看錯誤好像只會呼叫localhost
  2. notion有做連結,但是如果做git pull之後好像要重新設定??

/src/Compoents/PromptEditor/Lib/parsePrompts/parsers/Midjourney/index.ts存在一个错误

/src/Compoents/PromptEditor/Lib/parsePrompts/parsers/Midjourney/index.ts 这个文件,第一行
import { IPromptWord, PromptWordType } from "../../ParsePrompts"
存在错误,应该改成
import { IPromptWord, PromptWordType } from "../../parsePrompts"
由于windows环境不分大小写,所以应该可以正常运行,但是linux环境则会报错。

容器化部署出错

VITE v3.1.0 ready in 210 ms

➜ Local: http://localhost:12833/apps/ops/
➜ Network: http://172.17.0.5:12833/apps/ops/
✘ [ERROR] No matching export in "node_modules/@vueuse/core/node_modules/vue-demi/lib/index.mjs" for import "createApp"

node_modules/@vueuse/core/dist/index.esm.js:1:62:
  1 │ import { isRef, ref, watchEffect, computed, customRef, unref, createApp, reactive, watch, getCurrentInstance, onMounted, onUpdated, toRefs as toRefs$1, shallowRef, markRaw, readonly, isVue2 } from 'vue-demi';
    ╵                                                               ~~~~~~~~~

Please add more languages other than Chinese

This is an AMAZING project! You are a genius! Can you add other languages other than Chinese? I can provide ITALIAN translations of the keywords and the UI. I'm from Italy.😀
If you support more languages and create a permanent website, OpenPromptStudio can become an international online resource for Prompts.
Can you add a GUIDE on how to contribute for adding a language translation of the keywords? I think that if you add a section to the Readme.md titled "HOW TO CONTRIBUTE WITH AN ADDITIONAL LANGUAGE TRANSLATION". There you can write a step by step guide on how to do it. It would be better if this section of the Readme.md was written in english.

问题

直接运行Index是一个空页面,是需要配置什么吗?

本地docker部署报错

"""

@moonvy/[email protected] dev
vite dev --host

VITE v3.1.0 ready in 487 ms

➜ Local: http://localhost:12833/apps/ops/
➜ Network: http://172.17.0.5:12833/apps/ops/
node:internal/errors:490
ErrorCaptureStackTrace(err);
^

Error: ENOSPC: System limit for number of file watchers reached, watch '/app/src/Boot/vue.boot.ts'
at FSWatcher. (node:internal/fs/watchers:247:19)
at Object.watch (node:fs:2343:34)
at createFsWatchInstance (file:///app/node_modules/vite/dist/node/chunks/dep-665b0112.js:49738:17)
at setFsWatchListener (file:///app/node_modules/vite/dist/node/chunks/dep-665b0112.js:49785:15)
at NodeFsHandler$1._watchWithNodeFs (file:///app/node_modules/vite/dist/node/chunks/dep-665b0112.js:49940:14)
at NodeFsHandler$1._handleFile (file:///app/node_modules/vite/dist/node/chunks/dep-665b0112.js:50004:23)
at NodeFsHandler$1._addToNodeFs (file:///app/node_modules/vite/dist/node/chunks/dep-665b0112.js:50246:21)
at async file:///app/node_modules/vite/dist/node/chunks/dep-665b0112.js:51238:21
at async Promise.all (index 0)
Emitted 'error' event on FSWatcher instance at:
at FSWatcher._handleError (file:///app/node_modules/vite/dist/node/chunks/dep-665b0112.js:51434:10)
at NodeFsHandler$1._addToNodeFs (file:///app/node_modules/vite/dist/node/chunks/dep-665b0112.js:50254:18)
at async file:///app/node_modules/vite/dist/node/chunks/dep-665b0112.js:51238:21
at async Promise.all (index 0) {
errno: -28,
syscall: 'watch',
code: 'ENOSPC',
path: '/app/src/Boot/vue.boot.ts',
filename: '/app/src/Boot/vue.boot.ts'
}

Node.js v18.15.0

"""

image

本地node部署出错

nohup npm run serve 无法打开网页nohup npm run dev可以
nohup npm run dev无法使用已经配置了腾讯密钥的翻译服务

数据库连接错误

一直提示,Notion连接错误:没有Notion数据库的访问权限。请在此Notion 数据库页面菜单的'Connections'中添加你的集成应用
但是已经反复确认Token和数据库的BaseID无误,token的访问权限也已经连接至数据库和上级页面,但还是出错0.0

1

b3db015c2cd0bfdec780277943a4dde
what‘s going on here?’

翻译功不起作用

已经申请启用了腾讯翻译秘钥。
image
image

还有能不能添加一个本地数据库。将有需要的自己添加到本地数据库中。
notion网速不是很快。添加数据也比较麻烦。

在window11 系统中部署出现 Internal server error: Failed to resolve import "@moonvy/app-core" from "src\Boot\index.ts". Does the file exist?

Failed to resolve import "@moonvy/app-core" from "src\Boot\index.ts". Does the file exist?
10:57:57 [vite] Internal server error: Failed to resolve import "@moonvy/app-core" from "src\Boot\index.ts". Does the file exist?
Plugin: vite:import-analysis
File: E:/Projects/OpenPromptStudio/src/Boot/index.ts
1 | import { bootVue } from "./vue.boot";
2 | import { I18n } from "@moonvy/app-core";
| ^
3 | export function boot() {
4 | ;
部署后出现上诉报错
系统版本 Windows 11 企业版 22H2 (22621.1105)
nodejs版本 18.15.0 LTS

部署运行出错:Failed to resolve import "../../ParsePrompts"

$ npm run dev

> @moonvy/[email protected] dev
> vite dev --host


  VITE v3.1.0  ready in 746 ms

  ➜  Local:   http://localhost:12345/apps/ops/
  ➜  Network: http://x.x.x.x:12345/apps/ops/
  ➜  Network: http://x.x.x.x:12345/apps/ops/
Failed to resolve import "../../ParsePrompts" from "src/Compoents/PromptEditor/Lib/parsePrompts/parsers/Midjourney/index.ts". Does the file exist?
4:37:41 AM [vite] Internal server error: Failed to resolve import "../../ParsePrompts" from "src/Compoents/PromptEditor/Lib/parsePrompts/parsers/Midjourney/index.ts". Does the file exist?
  Plugin: vite:import-analysis
  File: /root/OpenPromptStudio/src/Compoents/PromptEditor/Lib/parsePrompts/parsers/Midjourney/index.ts
  1  |  import { PromptWordType } from "../../ParsePrompts";
     |                                  ^
  2  |  import { translateZh2En } from "../../../translatePrompts";
  3  |  export async function midjourneyParse(text, options) {
      at formatError (file:///root/OpenPromptStudio/node_modules/vite/dist/node/chunks/dep-665b0112.js:40782:46)
      at TransformContext.error (file:///root/OpenPromptStudio/node_modules/vite/dist/node/chunks/dep-665b0112.js:40778:19)
      at normalizeUrl (file:///root/OpenPromptStudio/node_modules/vite/dist/node/chunks/dep-665b0112.js:37514:33)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)
      at async TransformContext.transform (file:///root/OpenPromptStudio/node_modules/vite/dist/node/chunks/dep-665b0112.js:37648:47)
      at async Object.transform (file:///root/OpenPromptStudio/node_modules/vite/dist/node/chunks/dep-665b0112.js:41031:30)
      at async loadAndTransform (file:///root/OpenPromptStudio/node_modules/vite/dist/node/chunks/dep-665b0112.js:37292:29)

提示词词典页面拖动有Bug

在「提示词词典」中拖动会出现提示词悬浮在空中的情况。

浏览器:Arc Version 0.96.0 (38004)

复现方式:在「提示词词典」抽屉中,按住一个「词」,然后放开,就会卡在空中。

拖动截图

提示词抽屉缩回去之后还在

Ubuntu22.04用docker部署出错

[plugin:vite:import-analysis] Failed to resolve import "../../ParsePrompts" from "src/Compoents/PromptEditor/Lib/parsePrompts/parsers/Midjourney/index.ts". Does the file exist?
/app/src/Compoents/PromptEditor/Lib/parsePrompts/parsers/Midjourney/index.ts:1:44
1 | import { PromptWordType } from "../../ParsePrompts";
| ^
2 | import { translateZh2En } from "../../../translatePrompts";
3 | export async function midjourneyParse(text, options) {
at formatError (file:///app/node_modules/vite/dist/node/chunks/dep-665b0112.js:40782:46)
at TransformContext.error (file:///app/node_modules/vite/dist/node/chunks/dep-665b0112.js:40778:19)
at normalizeUrl (file:///app/node_modules/vite/dist/node/chunks/dep-665b0112.js:37514:33)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async TransformContext.transform (file:///app/node_modules/vite/dist/node/chunks/dep-665b0112.js:37648:47)
at async Object.transform (file:///app/node_modules/vite/dist/node/chunks/dep-665b0112.js:41031:30)
at async loadAndTransform (file:///app/node_modules/vite/dist/node/chunks/dep-665b0112.js:37292:29
Click outside or fix the code to dismiss.
You can also disable this overlay by setting server.hmr.overlay to false in vite.config.js.

交互建议

image

最好 字典和编辑区不重叠,因为有同时操作的场景

功能建议:支持通过API方式,发送多条prompt到OpenPromptStudio进行修改

你好,我做个prompt的生成器,能否通过API ,POST到OpenPromptStudio里面进行修改。

目前使用流程:
clip识别图片,使用gpt2模型,生成多条prompt
或 中文,使用chatglm扩展,翻译成英文,生成多条prompt

然后一条一条复制过来修改,比较繁琐:)

改进的流程:
生成多条prompt --> http post --> OpenPromptStudio(建立多个工作区)

项目地址:
https://github.com/zhongpei/image2text_prompt_generator

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.