add default comfy workflow

This commit is contained in:
LenAnderson 2023-11-20 15:59:38 +00:00
parent 9c41a9d2ac
commit 46cc04c798
5 changed files with 94 additions and 2 deletions

View File

@ -0,0 +1,86 @@
{
"3": {
"class_type": "KSampler",
"inputs": {
"cfg": "%scale%",
"denoise": 1,
"latent_image": [
"5",
0
],
"model": [
"4",
0
],
"negative": [
"7",
0
],
"positive": [
"6",
0
],
"sampler_name": "%sampler%",
"scheduler": "%scheduler%",
"seed": "%seed%",
"steps": "%steps%"
}
},
"4": {
"class_type": "CheckpointLoaderSimple",
"inputs": {
"ckpt_name": "%model%"
}
},
"5": {
"class_type": "EmptyLatentImage",
"inputs": {
"batch_size": 1,
"height": "%height%",
"width": "%width%"
}
},
"6": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"4",
1
],
"text": "%prompt%"
}
},
"7": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"4",
1
],
"text": "%negative_prompt%"
}
},
"8": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"3",
0
],
"vae": [
"4",
2
]
}
},
"9": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "SillyTavern",
"images": [
"8",
0
]
}
}
}

View File

@ -22,5 +22,9 @@
{
"filename": "user-default.png",
"type": "avatar"
},
{
"filename": "Default_Comfy_Workflow.json",
"type": "workflow"
}
]

View File

@ -243,7 +243,7 @@ const defaultSettings = {
// ComyUI settings
comfy_url: 'http://127.0.0.1:8188',
comfy_workflow: 'Default.json',
comfy_workflow: 'Default_Comfy_Workflow.json',
}
function processTriggers(chat, _, abort) {

View File

@ -71,6 +71,8 @@ function getTargetByType(type) {
return 'public/User Avatars';
case 'theme':
return 'public/themes';
case 'workflow':
return 'public/user/workflows';
default:
return null;
}

View File

@ -463,7 +463,7 @@ function registerEndpoints(app, jsonParser) {
try {
let path = `public/user/workflows/${sanitize(String(request.body.file_name))}`;
if (!fs.existsSync(path)) {
path = 'public/user/workflows/Default.json';
path = 'public/user/workflows/Default_Comfy_Workflow.json';
}
const data = fs.readFileSync(
path,