Compare commits

..
3 Commits
Author SHA1 Message Date
shadowcz007 f847dcccf4 v0.2.5.2 2023-12-05 17:22:51 +08:00
shadowcz007 ff3f8f52d0 update 2023-12-05 17:22:28 +08:00
shadowcz007 d7d46682fc 优化GPT 2023-12-05 13:47:08 +08:00
11 changed files with 193 additions and 149 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ https://github.com/shadowcz007/comfyui-mixlab-nodes/assets/12645064/e7e77f90-e43
### GPT
> ChatGPT、ChatGLM3 , Some code provided by rui.
> ChatGPT、ChatGLM3 , Some code provided by rui. If you are using OpenAI's service, fill in https://api.openai.com/v1 . If you are using a local LLM service, fill in http://127.0.0.1:xxxx/v1
![gpt-workflow.svg](./assets/gpt-workflow.svg)
+4 -3
View File
@@ -260,7 +260,7 @@ from .nodes.ImageNode import TransparentImage,LoadImagesFromPath,AreaToMask,Smoo
from .nodes.Vae import VAELoader,VAEDecode
from .nodes.ScreenShareNode import ScreenShareNode,FloatingVideo
from .nodes.Clipseg import CLIPSeg,CombineMasks
from .nodes.ChatGPT import ChatGPTNode,SessionHistory
from .nodes.ChatGPT import ChatGPTNode,ShowTextForGPT,CharacterInText
# 要导出的所有节点及其名称的字典
# 注意:名称应全局唯一
@@ -282,7 +282,8 @@ NODE_CLASS_MAPPINGS = {
"CLIPSeg_":CLIPSeg,
"CombineMasks_":CombineMasks,
"ChatGPT":ChatGPTNode,
"SessionHistory":SessionHistory
"ShowTextForGPT":ShowTextForGPT,
"CharacterInText":CharacterInText
}
# 一个包含节点友好/可读的标题的字典
@@ -294,7 +295,7 @@ NODE_DISPLAY_NAME_MAPPINGS = {
"ScreenShare":"ScreenShare #Mixlab",
"FloatingVideo":"FloatingVideo #Mixlab",
"ChatGPT":"ChatGPT #Mixlab",
"SessionHistory":"SessionHistory #Mixlab"
"ShowTextForGPT":"ShowTextForGPT #Mixlab"
}
# web ui的节点功能
+62 -22
View File
@@ -66,7 +66,7 @@ class ChatGPTNode:
def __init__(self):
# self.__client = OpenAI()
self.session_history = [] # 用于存储会话历史的列表
self.seed=0
# self.seed=0
self.system_content="You are ChatGPT, a large language model trained by OpenAI. Answer as concisely as possible."
@classmethod
@@ -84,15 +84,16 @@ class ChatGPTNode:
"model": (["gpt-3.5-turbo", "gpt-3.5-turbo-16k-0613", "gpt-4-0613","gpt-4-1106-preview"],
{"default": "gpt-3.5-turbo"}),
"seed": ("INT", {"default": 0, "min": 0, "max": 10000, "step": 1}),
"context_size":("INT", {"default": 1, "min": 0, "max":30, "step": 1}),
},
}
RETURN_TYPES = ("STRING","STRING",)
RETURN_NAMES = ("text","session_history",)
RETURN_TYPES = ("STRING","STRING","STRING",)
RETURN_NAMES = ("text","messages","session_history",)
FUNCTION = "generate_contextual_text"
CATEGORY = "Mixlab/GPT"
CATEGORY = "♾️Mixlab/GPT"
INPUT_IS_LIST = False
OUTPUT_IS_LIST = (False,False,)
OUTPUT_IS_LIST = (False,False,False,)
def generate_contextual_text(self,
@@ -101,18 +102,13 @@ class ChatGPTNode:
prompt,
system_content,
model,
seed):
print(api_key,
api_url,
prompt,
system_content,
model,
seed)
seed,context_size):
# print(api_key!='',api_url,prompt,system_content,model,seed)
# 可以选择保留会话历史以维持上下文记忆
# 或者在此处清除会话历史 self.session_history.clear()
if seed!=self.seed:
self.seed=seed
self.session_history=[]
# if seed!=self.seed:
# self.seed=seed
# self.session_history=[]
# 把系统信息和初始信息添加到会话历史中
if system_content:
@@ -129,21 +125,32 @@ class ChatGPTNode:
# 把用户的提示添加到会话历史中
# 调用API时传递整个会话历史
messages=[{"role": "system", "content": self.system_content}]+self.session_history+[{"role": "user", "content": prompt}]
def crop_list_tail(lst, size):
if size >= len(lst):
return lst
elif size==0:
return []
else:
return lst[-size:]
session_history=crop_list_tail(self.session_history,context_size)
messages=[{"role": "system", "content": self.system_content}]+session_history+[{"role": "user", "content": prompt}]
response_content = chat(client,model,messages)
self.session_history=self.session_history+[{"role": "user", "content": prompt}]+[{'role':'assistant',"content":response_content}]
return (response_content,json.dumps(self.session_history, indent=4),)
return (response_content,json.dumps(messages, indent=4),json.dumps(self.session_history, indent=4),)
class SessionHistory:
class ShowTextForGPT:
@classmethod
def INPUT_TYPES(s):
return {
"required": {
"session_history": ("STRING", {"forceInput": True}),
"text": ("STRING", {"forceInput": True}),
}
}
@@ -153,8 +160,41 @@ class SessionHistory:
OUTPUT_NODE = True
OUTPUT_IS_LIST = (True,)
CATEGORY = "Mixlab/GPT"
CATEGORY = "♾️Mixlab/GPT"
def run(self, session_history):
def run(self, text):
# print(session_history)
return {"ui": {"text": session_history}, "result": (session_history,)}
return {"ui": {"text": text}, "result": (text,)}
class CharacterInText:
@classmethod
def INPUT_TYPES(s):
return {
"required": {
"text": ("STRING", {"multiline": True}),
"character": ("STRING", {"multiline": True}),
"start_index": ("INT", {
"default": 1,
"min": 0, #Minimum value
"max": 1024, #Maximum value
"step": 1, #Slider's step
"display": "number" # Cosmetic only: display as "number" or "slider"
}),
}
}
INPUT_IS_LIST = False
RETURN_TYPES = ("INT",)
FUNCTION = "run"
# OUTPUT_NODE = True
OUTPUT_IS_LIST = (False,)
CATEGORY = "♾️Mixlab/GPT"
def run(self, text,character,start_index):
# print(text,character,start_index)
b=1 if character in text else 0
return (b+start_index,)
+2 -2
View File
@@ -99,7 +99,7 @@ class CLIPSeg:
}
}
CATEGORY = "Mixlab/mask"
CATEGORY = "♾️Mixlab/mask"
RETURN_TYPES = ("MASK", "IMAGE", "IMAGE",)
RETURN_NAMES = ("Mask","Heatmap Mask", "BW Mask")
@@ -204,7 +204,7 @@ class CombineMasks:
},
}
CATEGORY = "Mixlab/mask"
CATEGORY = "♾️Mixlab/mask"
RETURN_TYPES = ("MASK", "IMAGE", "IMAGE",)
RETURN_NAMES = ("Combined Mask","Heatmap Mask", "BW Mask")
+9 -9
View File
@@ -341,7 +341,7 @@ class SmoothMask:
FUNCTION = "run"
CATEGORY = "Mixlab/mask"
CATEGORY = "♾️Mixlab/mask"
INPUT_IS_LIST = False
@@ -389,7 +389,7 @@ class FeatheredMask:
FUNCTION = "run"
CATEGORY = "Mixlab/mask"
CATEGORY = "♾️Mixlab/mask"
OUTPUT_IS_LIST = (False,)
@@ -456,7 +456,7 @@ class SplitLongMask:
FUNCTION = "run"
CATEGORY = "Mixlab/mask"
CATEGORY = "♾️Mixlab/mask"
OUTPUT_IS_LIST = (True,)
@@ -499,7 +499,7 @@ class TransparentImage:
FUNCTION = "run"
CATEGORY = "Mixlab/image"
CATEGORY = "♾️Mixlab/image"
# INPUT_IS_LIST = True, 一个batch传进来
OUTPUT_IS_LIST = (True,True,True,)
@@ -568,7 +568,7 @@ class EnhanceImage:
FUNCTION = "run"
CATEGORY = "Mixlab/image"
CATEGORY = "♾️Mixlab/image"
INPUT_IS_LIST = False
@@ -627,7 +627,7 @@ class LoadImagesFromPath:
FUNCTION = "run"
CATEGORY = "Mixlab/image"
CATEGORY = "♾️Mixlab/image"
# INPUT_IS_LIST = True
OUTPUT_IS_LIST = (True,True,False,)
@@ -688,7 +688,7 @@ class ImageCropByAlpha:
FUNCTION = "run"
CATEGORY = "Mixlab/image"
CATEGORY = "♾️Mixlab/image"
INPUT_IS_LIST = False
OUTPUT_IS_LIST = (False,)
@@ -719,7 +719,7 @@ class AreaToMask:
FUNCTION = "run"
CATEGORY = "Mixlab/mask"
CATEGORY = "♾️Mixlab/mask"
INPUT_IS_LIST = False
OUTPUT_IS_LIST = (False,)
@@ -754,7 +754,7 @@ class FaceToMask:
FUNCTION = "run"
CATEGORY = "Mixlab/mask"
CATEGORY = "♾️Mixlab/mask"
INPUT_IS_LIST = False
OUTPUT_IS_LIST = (False,)
+2 -2
View File
@@ -79,7 +79,7 @@ class RandomPrompt:
FUNCTION = "run"
CATEGORY = "Mixlab/prompt"
CATEGORY = "♾️Mixlab/prompt"
OUTPUT_IS_LIST = (True,)
OUTPUT_NODE = True
@@ -158,7 +158,7 @@ class RunWorkflow:
FUNCTION = "run"
CATEGORY = "Mixlab/workflow"
CATEGORY = "♾️Mixlab/workflow"
OUTPUT_IS_LIST = (True,)
OUTPUT_NODE = True
+2 -2
View File
@@ -89,7 +89,7 @@ class ScreenShareNode:
FUNCTION = "run"
CATEGORY = "Mixlab/image"
CATEGORY = "♾️Mixlab/image"
# INPUT_IS_LIST = True
OUTPUT_IS_LIST = (False,False,False)
@@ -114,7 +114,7 @@ class FloatingVideo:
OUTPUT_NODE = True
FUNCTION = "run"
CATEGORY = "Mixlab/image"
CATEGORY = "♾️Mixlab/image"
# INPUT_IS_LIST = True
# OUTPUT_IS_LIST = (False,False,)
+2 -2
View File
@@ -145,7 +145,7 @@ class VAELoader:
RETURN_TYPES = ("VAE",)
FUNCTION = "load_vae"
CATEGORY = "Mixlab/ConsistencyDecoder"
CATEGORY = "♾️Mixlab/ConsistencyDecoder"
#TODO: scale factor?
def load_vae(self, vae_name):
@@ -165,7 +165,7 @@ class VAEDecode:
RETURN_TYPES = ("IMAGE",)
FUNCTION = "decode"
CATEGORY = "Mixlab/ConsistencyDecoder"
CATEGORY = "♾️Mixlab/ConsistencyDecoder"
def decode(self, vae, samples):
image = vae.decode(samples["samples"].to("cuda:0"))
+2 -2
View File
@@ -3,7 +3,7 @@ import { app } from '../../../scripts/app.js'
const repoOwner = 'shadowcz007' // 替换为仓库的所有者
const repoName = 'comfyui-mixlab-nodes' // 替换为仓库的名称
const version = 'v0.2.5.1'
const version = 'v0.2.5.2'
fetch(`https://api.github.com/repos/${repoOwner}/${repoName}/releases/latest`)
.then(response => response.json())
@@ -16,7 +16,7 @@ fetch(`https://api.github.com/repos/${repoOwner}/${repoName}/releases/latest`)
app.ui.dialog.show(`<h4 style="font-size: 18px;">${repoName} <br>
Latest release version: ${latestVersion}</h4>
<p>Please proceed to the official repository to download the latest version.</p>
<a style=" color: #2196F3;
<a style="color: #2196F3;
font-size: 18px;
font-weight: 800;
letter-spacing: 2px;
+11 -10
View File
@@ -61,7 +61,8 @@ app.registerExtension({
return [128, 24] // a method to compute the current size of the widget
},
async serializeValue (nodeId, widgetIndex) {
return localStorage.getItem('_mixlab_api_key') || ''
//localStorage.getItem('_mixlab_api_key') || ''
return 'by Mixlab'
}
}
// widget.something = something; // maybe adds stuff to it
@@ -81,7 +82,7 @@ app.registerExtension({
return [128, 24] // a method to compute the current size of the widget
},
async serializeValue (nodeId, widgetIndex) {
return localStorage.getItem('_mixlab_api_url') || ''
return localStorage.getItem('_mixlab_api_url') || 'https://api.openai.com/v1'
}
}
// widget.something = something; // maybe adds stuff to it
@@ -101,7 +102,7 @@ app.registerExtension({
const api_key = this.widgets.filter(w => w.name == 'api_key')[0]
const api_url = this.widgets.filter(w => w.name == 'api_url')[0]
console.log('api_key', api_key, api_url)
// console.log('api_key', api_key, api_url)
const widget = {
type: 'div',
@@ -129,19 +130,19 @@ app.registerExtension({
inputKey.style = `margin:4px 48px;`
inputUrl.style = `margin:4px 48px`
inputUrl.value = localStorage.getItem('_mixlab_api_url') || ''
inputKey.value = localStorage.getItem('_mixlab_api_key') || ''
inputUrl.value = localStorage.getItem('_mixlab_api_url') || 'https://api.openai.com/v1'
inputKey.value = localStorage.getItem('_mixlab_api_key') || 'by Mixlab'
widget.div.appendChild(inputKey)
widget.div.appendChild(inputUrl)
inputKey.addEventListener('change', () => {
api_key.serializeValue = () => inputKey.value || ''
api_key.serializeValue = () => inputKey.value || 'by Mixlab'
localStorage.setItem('_mixlab_api_key', inputKey.value)
})
inputUrl.addEventListener('change', () => {
api_url.serializeValue = () => inputUrl.value || ''
api_url.serializeValue = () => inputUrl.value || 'https://api.openai.com/v1'
localStorage.setItem('_mixlab_api_url', inputUrl.value)
})
@@ -165,9 +166,9 @@ app.registerExtension({
})
app.registerExtension({
name: 'Mixlab.GPT.SessionHistory',
name: 'Mixlab.GPT.ShowTextForGPT',
async beforeRegisterNodeDef (nodeType, nodeData, app) {
if (nodeData.name === 'SessionHistory') {
if (nodeData.name === 'ShowTextForGPT') {
function populate (text) {
if (this.widgets) {
// const pos = this.widgets.findIndex((w) => w.name === "text");
@@ -184,7 +185,7 @@ app.registerExtension({
this.widgets.length = 0
}
console.log('SessionHistory', this.widgets, text)
console.log('ShowTextForGPT', this.widgets, text)
for (const list of text) {
const w = ComfyWidgets['STRING'](
+96 -94
View File
@@ -1,6 +1,6 @@
{
"last_node_id": 34,
"last_link_id": 35,
"last_node_id": 46,
"last_link_id": 42,
"nodes": [
{
"id": 27,
@@ -14,7 +14,7 @@
"1": 164.31304931640625
},
"flags": {},
"order": 7,
"order": 5,
"mode": 0,
"inputs": [
{
@@ -25,7 +25,7 @@
{
"name": "text",
"type": "STRING",
"link": 35,
"link": 42,
"widget": {
"name": "text"
}
@@ -136,7 +136,7 @@
"Node name for S&R": "KSampler"
},
"widgets_values": [
264070254513477,
261818020972971,
"randomize",
15,
8,
@@ -294,26 +294,26 @@
}
},
{
"id": 33,
"type": "SessionHistory",
"id": 44,
"type": "ShowTextForGPT",
"pos": [
1300,
430
1171,
425
],
"size": [
580.1640810546876,
223.1105875244142
432.46002197265625,
264.40771484375
],
"flags": {},
"order": 6,
"mode": 0,
"inputs": [
{
"name": "session_history",
"name": "text",
"type": "STRING",
"link": 33,
"link": 40,
"widget": {
"name": "session_history"
"name": "text"
}
}
],
@@ -322,38 +322,37 @@
"name": "STRING",
"type": "STRING",
"links": null,
"shape": 6,
"slot_index": 0
"shape": 6
}
],
"properties": {
"Node name for S&R": "SessionHistory"
"Node name for S&R": "ShowTextForGPT"
},
"widgets_values": [
"[\n {\n \"role\": \"user\",\n \"content\": \"黑客与画家\"\n },\n {\n \"role\": \"assistant\",\n \"content\": \"\\\"Hacker and Painter\\\" is a popular Chinese comic series written and illustrated by Cheng先辈, which has gained a large following worldwide.\\n\\nThe series revolves around the lives of two main characters, a young hacker and an artist, who embark on a journey of self-discovery and personal growth. Set in a futuristic, dystopian world, the story combines elements of science fiction, technology, and action with a touch of humor and satire.\\n\\nThe art style in \\\"Hacker and Painter\\\" is a mix of sci-fi and traditional Chinese ink painting, with bold lines, vibrant colors, and intricate details. Cheng先辈 employs a unique painting technique, using watercolor washes and ink to create a dynamic, expressive, and visually striking visual style.\\n\\nThe artist's use of photography and various camera angles adds an extra layer of depth to the storytelling, allowing the viewer to experience the world from different perspectives and gain a deeper understanding of the characters' emotions and motivations.\\n\\nLighting plays a significant role in the series, with the use of dramatic, contrasting light sources adding to the intensity and emotion of various scenes. Cheng先辈 expertly utilizes lighting to enhance the mood and setting, drawing the audience into the world of \\\"Hacker and Painter\\\" and making them feel like they are part of the action.\\n\\nOverall, \\\"Hacker and Painter\\\" is a visually stunning and thought-provoking series that combines the best of science fiction, action, and art, making it a must-read for fans of all ages.\"\n }\n]"
"[\n {\n \"role\": \"system\",\n \"content\": \"你现在充当stable diffsion 提示词专家,根据我输入的场景或需求描述,生成提示词,由stable diffsion根据你的提示词生成画面。stable diffusion是文本到图像的扩散模型。你的任务是在各种情况下产生适当的提示,引导人工智能创造出所需的图像。\\n\\n一个优秀的提示词需要遵循下面的规范:\\n\\n“““\\n\\n简洁明了:避免过于复杂或模糊的描述,以免造成模型的混乱或错误。\\n\\n具体细致:提供足够的细节,以便模型能够准确地捕捉想要生成的图片的特征。\\n\\n逻辑连贯:避免出现矛盾或不合理的描述,以免影响模型的理解和生成。\\n\\n创意独特:有创意,展示自己的想象力和个性,以便模型能够生成有趣和新颖的图片。\\n\\n我建议你可以参考以下几个步骤思考:\\n\\n• 确定主题:首先,你需要确定想要生成图片的主题,例如风景、动物、人物等。\\n\\n• 确定风格:其次,根据主题要求,确定合适的风格(如极简、现代)或根据主题(人物、风景等)调整提示词的语言风格、词汇和描述角度。\\n\\n• 选择关键词:再次,你需要选择一些能够描述主题的关键词,常用的关键词类别包括:主体、媒介、风格、画家、网站、分辨率、额外细节、色调和光影。 可以使用名人的名字作为关键词,来控制人物形象,因为他们在训练集中出现频次较大而训练充分。\\n\\n• 组合句子:然后,你需要将关键词组合成一个或多个简单句子,提示词的句式通常如:【图片的风格】,【内容主题 】,【 细节描述】,【 绘画风格或者艺术家风格】, 用逗号或分号隔开,例如a blue sky with white clouds, a green field with yellow flowers。\\n\\n• 调整细节:最后,根据告诉你的内容主题,尽可能细致刻画画面,譬如,要画“大海”,你需要给出类似这样的提示:梦幻的大海,白沙滩岸边铺满了粉色的玫瑰花,月光轻柔的人洒在海面上,绿色发光的海浪。对于细节描述,我们可以拆分【形容词】+【视角】+【时间】+【颜色】+【其他】,形容词可以是梦幻,神秘,浪漫或者写实 ……视角可以是:超广角,俯视和仰视 ……,时间:秋天,清晨,黄昏,夜晚 ……,颜色可以是 红黄绿蓝橙紫……,其他可以包含图片的尺寸,4k,8k ,HD,光效,高细节等。\\n\\n• 如果想让生成的图片更加的艺术化、风格化,可以考虑在 提示词中添加绘画风格和艺术家。艺术绘画风格可以是一些美术风格:梵高风格,油画,水彩,古风,CG感,动漫,少女,赛博朋克,卡通画,中国画,黄昏等等,艺术家风格包含:现实主义,印象派,野兽派,新艺术,表现主义,立体主义,未来主义等等\\n\\n• 以简洁的英语输出。输出完整提示词后,把它翻译成中文,然后保留英语版本备用。\\n\\n“““\\n\\n为了让你更好的理解提示词,我收集了一些表现效果较好的提示词案例,你可以对照上面的规则学习吸收:\\n\\n“““\\n\\nMaximalist chaotic buenos aires, birds eye view, illustrated by hergé, style of tin tin comics, pen and ink\\n\\nHyper -realistic girl in blue coat, left in the woods, weird, otherworldly, real, vintage photograph, film set, 85mm lens, f/2.8 aperture\\n\\ninstagram photo of a Japanese and Scandinavian design style living room with lots of golden light, hyperrealistic surrealism, award winning masterpiece with incredible details\\n\\nPortrait of an owl, steampunk, indigo blue, colorful, illustration, highly detailed, simple, smooth, and clean vector, no jagged lines, vector art, smooth, made all with grey colored gears inspired by future technology\\n\\n“““\\n\\n请通过回复 “确认 “来确认你是否理解了这项任务。然后我将向你发送第一条命令。\"\n },\n {\n \"role\": \"user\",\n \"content\": \"证件照,女生,请认真回答噢,很重要这个问题\"\n }\n]"
]
},
{
"id": 34,
"type": "SessionHistory",
"id": 43,
"type": "ShowTextForGPT",
"pos": [
1300,
230
1166,
740
],
"size": [
562.8610810546875,
125.32558752441412
424.00797187258513,
430.6391176555039
],
"flags": {},
"order": 5,
"order": 7,
"mode": 0,
"inputs": [
{
"name": "session_history",
"name": "text",
"type": "STRING",
"link": 34,
"link": 39,
"widget": {
"name": "session_history"
"name": "text"
}
}
],
@@ -361,95 +360,98 @@
{
"name": "STRING",
"type": "STRING",
"links": [
35
],
"shape": 6,
"slot_index": 0
"links": null,
"shape": 6
}
],
"properties": {
"Node name for S&R": "SessionHistory"
"Node name for S&R": "ShowTextForGPT"
},
"widgets_values": [
"\"Hacker and Painter\" is a popular Chinese comic series written and illustrated by Cheng先辈, which has gained a large following worldwide.\n\nThe series revolves around the lives of two main characters, a young hacker and an artist, who embark on a journey of self-discovery and personal growth. Set in a futuristic, dystopian world, the story combines elements of science fiction, technology, and action with a touch of humor and satire.\n\nThe art style in \"Hacker and Painter\" is a mix of sci-fi and traditional Chinese ink painting, with bold lines, vibrant colors, and intricate details. Cheng先辈 employs a unique painting technique, using watercolor washes and ink to create a dynamic, expressive, and visually striking visual style.\n\nThe artist's use of photography and various camera angles adds an extra layer of depth to the storytelling, allowing the viewer to experience the world from different perspectives and gain a deeper understanding of the characters' emotions and motivations.\n\nLighting plays a significant role in the series, with the use of dramatic, contrasting light sources adding to the intensity and emotion of various scenes. Cheng先辈 expertly utilizes lighting to enhance the mood and setting, drawing the audience into the world of \"Hacker and Painter\" and making them feel like they are part of the action.\n\nOverall, \"Hacker and Painter\" is a visually stunning and thought-provoking series that combines the best of science fiction, action, and art, making it a must-read for fans of all ages."
"[\n {\n \"role\": \"user\",\n \"content\": \"\"\n },\n {\n \"role\": \"assistant\",\n \"content\": \"ChatGPT is an artificial intelligence chatbot program launched by OpenAI in November 2022. The program is based on a large language model GPT-3.5, trained with Instruction Tuning and Reinforcement Learning with Human Feedback (RLHF).\"\n },\n {\n \"role\": \"user\",\n \"content\": \"\"\n },\n {\n \"role\": \"assistant\",\n \"content\": \"GPT-3.5 is a language model developed by OpenAI, based on the Transformer architecture. It is designed to perform a wide range of natural language processing tasks, including language translation, text summarization, and text generation.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"\"\n },\n {\n \"role\": \"assistant\",\n \"content\": \"Is there anything specific you would like to know about GPT-3.5? I am here to help.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"今天天气\"\n },\n {\n \"role\": \"assistant\",\n \"content\": \"I'm sorry, I am a text-based AI model and do not have the capability to access the current weather. However, I can tell you that it is likely to be a beautiful day, with the sun shining and a gentle breeze in the air. Enjoy your day!\"\n },\n {\n \"role\": \"user\",\n \"content\": \"今天天气不错噢,小明……\"\n },\n {\n \"role\": \"assistant\",\n \"content\": \"谢谢您的夸奖,不过我是一个人工智能模型,没有能力感知天气,只是通过语言理解回答问题。如果您需要查询当地的天气情况,建议您查询当地的天气预报。\"\n },\n {\n \"role\": \"user\",\n \"content\": \"今天天气不错噢,小明……\"\n },\n {\n \"role\": \"assistant\",\n \"content\": \"今天天气不错噢,小明……(这句话是重复的,之前已经回答过您的问题了。如果您需要查询当地的天气情况,建议您查询当地的天气预报。\"\n },\n {\n \"role\": \"user\",\n \"content\": \"证件照,女生\"\n },\n {\n \"role\": \"assistant\",\n \"content\": \"“女生分别为: Cut out of a colorful plaid skirt and white shirt, faced front, with a friendly smile, blonde-haired girl, age 22, blue eyes, naturalistic, clear, bright, young,以及人像,摄于户外,背景为美丽的自然风光,使用的相机是佳能5D Mark IV,镜头焦距为50mm,拍摄模式为肖像模式,使用的后期处理软件为Adobe Lightroom和Photoshop。\"\n },\n {\n \"role\": \"user\",\n \"content\": \"证件照,女生\"\n },\n {\n \"role\": \"assistant\",\n \"content\": \"• 拍摄证件照,要求提供女生的照片,背景可以是一片白色的天空,或者一片纯色的草地,不能有杂色。\\n• 视角应该从 above,即从上方俯视,让女生显得稳定自信。\\n• 时间应该选择在阳光明媚的早晨,这样可以让女生看起来更加青春活力。\\n• 颜色可以选择蓝色,这种颜色可以让人感到清新自然。\\n• 照片应该有高清清晰的效果,不能有模糊模糊的现象。\\n• 照片的尺寸可以选择2K或者4K,这样可以让照片更加清晰。\\n• 光效可以选择自然光,这样可以让照片看起来更加自然。\\n• 照片的风格可以选择日系或者韩系,这样可以让照片看起来更加时尚。\\n• 照片的背景可以选择浅色系,这样可以让照片看起来更加清新自然。\\n• 照片中不能有重大的人物或者动物,否则需要事先沟通好。\\n• 照片中不能有太强烈的光线或者阴影,需要调整好光线和阴影的平衡,使照片更加均匀。\\n• 照片中不能有太多的文字或者文字的内容,需要将文字或者文字的内容进行处理。\\n• 在拍摄证件照之前,需要让女生进行一些准备,比如保持好心态,调整好光线,保持好角度等等。\\n• 拍摄完证件照之后,需要将照片进行一些处理,比如进行美颜,磨皮,瘦脸等等。\"\n },\n {\n \"role\": \"user\",\n \"content\": \"证件照,女生,请认真回答噢,很重要这个问题\"\n },\n {\n \"role\": \"assistant\",\n \"content\": \"确认\"\n }\n]"
]
},
{
"id": 32,
"type": "PrimitiveNode",
"id": 45,
"type": "ShowTextForGPT",
"pos": [
1314,
1075
1092,
262
],
"size": {
"0": 571.9803466796875,
"1": 100.6700210571289
},
"flags": {},
"order": 2,
"mode": 0,
"outputs": [
{
"name": "STRING",
"type": "STRING",
"links": [
32
],
"widget": {
"name": "prompt"
}
}
"size": [
635.8358236838778,
101.46092513017766
],
"title": "prompt",
"properties": {},
"widgets_values": [
"黑客与画家"
]
},
{
"id": 10,
"type": "ChatGPT",
"pos": [
1300,
720
],
"size": {
"0": 586.7649536132812,
"1": 301.5857849121094
},
"flags": {},
"order": 4,
"mode": 0,
"inputs": [
{
"name": "prompt",
"name": "text",
"type": "STRING",
"link": 32,
"link": 41,
"widget": {
"name": "prompt"
},
"slot_index": 0
"name": "text"
}
}
],
"outputs": [
{
"name": "STRING",
"type": "STRING",
"links": null,
"shape": 6
}
],
"properties": {
"Node name for S&R": "ShowTextForGPT"
},
"widgets_values": [
"确认"
]
},
{
"id": 42,
"type": "ChatGPT",
"pos": [
611,
285
],
"size": [
417.3319772767625,
531.1873476643206
],
"flags": {},
"order": 2,
"mode": 0,
"outputs": [
{
"name": "text",
"type": "STRING",
"links": [
34
41,
42
],
"shape": 3,
"slot_index": 0
},
{
"name": "JSON",
"name": "messages",
"type": "STRING",
"links": [
33
40
],
"shape": 3,
"slot_index": 1
},
{
"name": "session_history",
"type": "STRING",
"links": [
39
],
"shape": 3,
"slot_index": 2
}
],
"properties": {
@@ -579,32 +581,32 @@
"IMAGE"
],
[
32,
32,
0,
10,
39,
42,
2,
43,
0,
"STRING"
],
[
33,
10,
40,
42,
1,
33,
44,
0,
"STRING"
],
[
34,
10,
41,
42,
0,
34,
45,
0,
"STRING"
],
[
35,
34,
42,
42,
0,
27,
1,