mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Code lint
This commit is contained in:
@ -1,86 +1,86 @@
|
|||||||
{
|
{
|
||||||
"3": {
|
"3": {
|
||||||
"class_type": "KSampler",
|
"class_type": "KSampler",
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"cfg": "%scale%",
|
"cfg": "%scale%",
|
||||||
"denoise": 1,
|
"denoise": 1,
|
||||||
"latent_image": [
|
"latent_image": [
|
||||||
"5",
|
"5",
|
||||||
0
|
0
|
||||||
],
|
],
|
||||||
"model": [
|
"model": [
|
||||||
"4",
|
"4",
|
||||||
0
|
0
|
||||||
],
|
],
|
||||||
"negative": [
|
"negative": [
|
||||||
"7",
|
"7",
|
||||||
0
|
0
|
||||||
],
|
],
|
||||||
"positive": [
|
"positive": [
|
||||||
"6",
|
"6",
|
||||||
0
|
0
|
||||||
],
|
],
|
||||||
"sampler_name": "%sampler%",
|
"sampler_name": "%sampler%",
|
||||||
"scheduler": "%scheduler%",
|
"scheduler": "%scheduler%",
|
||||||
"seed": "%seed%",
|
"seed": "%seed%",
|
||||||
"steps": "%steps%"
|
"steps": "%steps%"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"4": {
|
"4": {
|
||||||
"class_type": "CheckpointLoaderSimple",
|
"class_type": "CheckpointLoaderSimple",
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"ckpt_name": "%model%"
|
"ckpt_name": "%model%"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"5": {
|
"5": {
|
||||||
"class_type": "EmptyLatentImage",
|
"class_type": "EmptyLatentImage",
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"batch_size": 1,
|
"batch_size": 1,
|
||||||
"height": "%height%",
|
"height": "%height%",
|
||||||
"width": "%width%"
|
"width": "%width%"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"6": {
|
"6": {
|
||||||
"class_type": "CLIPTextEncode",
|
"class_type": "CLIPTextEncode",
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"clip": [
|
"clip": [
|
||||||
"4",
|
"4",
|
||||||
1
|
1
|
||||||
],
|
],
|
||||||
"text": "%prompt%"
|
"text": "%prompt%"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"7": {
|
"7": {
|
||||||
"class_type": "CLIPTextEncode",
|
"class_type": "CLIPTextEncode",
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"clip": [
|
"clip": [
|
||||||
"4",
|
"4",
|
||||||
1
|
1
|
||||||
],
|
],
|
||||||
"text": "%negative_prompt%"
|
"text": "%negative_prompt%"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"8": {
|
"8": {
|
||||||
"class_type": "VAEDecode",
|
"class_type": "VAEDecode",
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"samples": [
|
"samples": [
|
||||||
"3",
|
"3",
|
||||||
0
|
0
|
||||||
],
|
],
|
||||||
"vae": [
|
"vae": [
|
||||||
"4",
|
"4",
|
||||||
2
|
2
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"9": {
|
"9": {
|
||||||
"class_type": "SaveImage",
|
"class_type": "SaveImage",
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"filename_prefix": "SillyTavern",
|
"filename_prefix": "SillyTavern",
|
||||||
"images": [
|
"images": [
|
||||||
"8",
|
"8",
|
||||||
0
|
0
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,31 +1,31 @@
|
|||||||
<div id="sd_comfy_workflow_editor_template">
|
<div id="sd_comfy_workflow_editor_template">
|
||||||
<div class="sd_comfy_workflow_editor">
|
<div class="sd_comfy_workflow_editor">
|
||||||
<h3><strong>ComfyUI Workflow Editor: <span id="sd_comfy_workflow_editor_name"></span></strong></h3>
|
<h3><strong>ComfyUI Workflow Editor: <span id="sd_comfy_workflow_editor_name"></span></strong></h3>
|
||||||
<div class="sd_comfy_workflow_editor_content">
|
<div class="sd_comfy_workflow_editor_content">
|
||||||
<div class="flex-container flexFlowColumn sd_comfy_workflow_editor_workflow_container">
|
<div class="flex-container flexFlowColumn sd_comfy_workflow_editor_workflow_container">
|
||||||
<label for="sd_comfy_workflow_editor_workflow">Workflow (JSON)</label>
|
<label for="sd_comfy_workflow_editor_workflow">Workflow (JSON)</label>
|
||||||
<textarea id="sd_comfy_workflow_editor_workflow" class="text_pole wide100p textarea_compact flex1" placeholder="Put the ComfyUI's workflow (JSON) here and replace the variable settings with placeholders."></textarea>
|
<textarea id="sd_comfy_workflow_editor_workflow" class="text_pole wide100p textarea_compact flex1" placeholder="Put the ComfyUI's workflow (JSON) here and replace the variable settings with placeholders."></textarea>
|
||||||
</div>
|
</div>
|
||||||
<div class="sd_comfy_workflow_editor_placeholder_container">
|
<div class="sd_comfy_workflow_editor_placeholder_container">
|
||||||
<div>Placeholders</div>
|
<div>Placeholders</div>
|
||||||
<ul class="sd_comfy_workflow_editor_placeholder_list">
|
<ul class="sd_comfy_workflow_editor_placeholder_list">
|
||||||
<li data-placeholder="prompt" class="sd_comfy_workflow_editor_not_found">"%prompt%"</li>
|
<li data-placeholder="prompt" class="sd_comfy_workflow_editor_not_found">"%prompt%"</li>
|
||||||
<li data-placeholder="negative_prompt" class="sd_comfy_workflow_editor_not_found">"%negative_prompt%"</li>
|
<li data-placeholder="negative_prompt" class="sd_comfy_workflow_editor_not_found">"%negative_prompt%"</li>
|
||||||
<li data-placeholder="model" class="sd_comfy_workflow_editor_not_found">"%model%"</li>
|
<li data-placeholder="model" class="sd_comfy_workflow_editor_not_found">"%model%"</li>
|
||||||
<li data-placeholder="vae" class="sd_comfy_workflow_editor_not_found">"%vae%"</li>
|
<li data-placeholder="vae" class="sd_comfy_workflow_editor_not_found">"%vae%"</li>
|
||||||
<li data-placeholder="sampler" class="sd_comfy_workflow_editor_not_found">"%sampler%"</li>
|
<li data-placeholder="sampler" class="sd_comfy_workflow_editor_not_found">"%sampler%"</li>
|
||||||
<li data-placeholder="scheduler" class="sd_comfy_workflow_editor_not_found">"%scheduler%"</li>
|
<li data-placeholder="scheduler" class="sd_comfy_workflow_editor_not_found">"%scheduler%"</li>
|
||||||
<li data-placeholder="steps" class="sd_comfy_workflow_editor_not_found">"%steps%"</li>
|
<li data-placeholder="steps" class="sd_comfy_workflow_editor_not_found">"%steps%"</li>
|
||||||
<li data-placeholder="scale" class="sd_comfy_workflow_editor_not_found">"%scale%"</li>
|
<li data-placeholder="scale" class="sd_comfy_workflow_editor_not_found">"%scale%"</li>
|
||||||
<li data-placeholder="width" class="sd_comfy_workflow_editor_not_found">"%width%"</li>
|
<li data-placeholder="width" class="sd_comfy_workflow_editor_not_found">"%width%"</li>
|
||||||
<li data-placeholder="height" class="sd_comfy_workflow_editor_not_found">"%height%"</li>
|
<li data-placeholder="height" class="sd_comfy_workflow_editor_not_found">"%height%"</li>
|
||||||
<li><hr></li>
|
<li><hr></li>
|
||||||
<li data-placeholder="seed" class="sd_comfy_workflow_editor_not_found">
|
<li data-placeholder="seed" class="sd_comfy_workflow_editor_not_found">
|
||||||
"%seed%"
|
"%seed%"
|
||||||
<a href="javascript:;" class="notes-link"><span class="note-link-span" title="Will generate a new random seed in SillyTavern that is then used in the ComfyUI workflow.">?</span></a>
|
<a href="javascript:;" class="notes-link"><span class="note-link-span" title="Will generate a new random seed in SillyTavern that is then used in the ComfyUI workflow.">?</span></a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -659,7 +659,7 @@ async function onSourceChange() {
|
|||||||
extension_settings.sd.sampler = null;
|
extension_settings.sd.sampler = null;
|
||||||
toggleSourceControls();
|
toggleSourceControls();
|
||||||
saveSettingsDebounced();
|
saveSettingsDebounced();
|
||||||
await Promise.all([loadModels(), loadSamplers()]);
|
await loadSettingOptions();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onOpenAiStyleSelect() {
|
async function onOpenAiStyleSelect() {
|
||||||
@ -791,8 +791,7 @@ async function validateAutoUrl() {
|
|||||||
throw new Error('SD WebUI returned an error.');
|
throw new Error('SD WebUI returned an error.');
|
||||||
}
|
}
|
||||||
|
|
||||||
await loadSamplers();
|
await loadSettingOptions();
|
||||||
await loadModels();
|
|
||||||
toastr.success('SD WebUI API connected.');
|
toastr.success('SD WebUI API connected.');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
toastr.error(`Could not validate SD WebUI API: ${error.message}`);
|
toastr.error(`Could not validate SD WebUI API: ${error.message}`);
|
||||||
@ -815,8 +814,7 @@ async function validateVladUrl() {
|
|||||||
throw new Error('SD.Next returned an error.');
|
throw new Error('SD.Next returned an error.');
|
||||||
}
|
}
|
||||||
|
|
||||||
await loadSamplers();
|
await loadSettingOptions();
|
||||||
await loadModels();
|
|
||||||
toastr.success('SD.Next API connected.');
|
toastr.success('SD.Next API connected.');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
toastr.error(`Could not validate SD.Next API: ${error.message}`);
|
toastr.error(`Could not validate SD.Next API: ${error.message}`);
|
||||||
@ -840,11 +838,7 @@ async function validateComfyUrl() {
|
|||||||
throw new Error('ComfyUI returned an error.');
|
throw new Error('ComfyUI returned an error.');
|
||||||
}
|
}
|
||||||
|
|
||||||
await loadSamplers();
|
await loadSettingOptions();
|
||||||
await loadSchedulers();
|
|
||||||
await loadModels();
|
|
||||||
await loadVaes();
|
|
||||||
await loadComfyWorkflows();
|
|
||||||
toastr.success('ComfyUI API connected.');
|
toastr.success('ComfyUI API connected.');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
toastr.error(`Could not validate ComfyUI API: ${error.message}`);
|
toastr.error(`Could not validate ComfyUI API: ${error.message}`);
|
||||||
@ -2444,7 +2438,7 @@ jQuery(async () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
eventSource.on(event_types.EXTRAS_CONNECTED, async () => {
|
eventSource.on(event_types.EXTRAS_CONNECTED, async () => {
|
||||||
await Promise.all([loadSamplers(), loadModels()]);
|
await loadSettingOptions();
|
||||||
});
|
});
|
||||||
|
|
||||||
eventSource.on(event_types.CHAT_CHANGED, onChatChanged);
|
eventSource.on(event_types.CHAT_CHANGED, onChatChanged);
|
||||||
|
@ -45,7 +45,7 @@ function removePattern(x, pattern) {
|
|||||||
function getComfyWorkflows() {
|
function getComfyWorkflows() {
|
||||||
return fs
|
return fs
|
||||||
.readdirSync(DIRECTORIES.comfyWorkflows)
|
.readdirSync(DIRECTORIES.comfyWorkflows)
|
||||||
.filter(file => file[0]!='.' && file.toLowerCase().endsWith('.json'))
|
.filter(file => file[0] != '.' && file.toLowerCase().endsWith('.json'))
|
||||||
.sort(Intl.Collator().compare);
|
.sort(Intl.Collator().compare);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -465,7 +465,7 @@ function registerEndpoints(app, jsonParser) {
|
|||||||
}
|
}
|
||||||
const data = fs.readFileSync(
|
const data = fs.readFileSync(
|
||||||
path,
|
path,
|
||||||
{encoding:'utf-8'}
|
{ encoding: 'utf-8' }
|
||||||
);
|
);
|
||||||
return response.send(JSON.stringify(data));
|
return response.send(JSON.stringify(data));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
Reference in New Issue
Block a user