mirror of
https://github.com/vladmandic/automatic
synced 2026-09-06 04:50:44 +02:00
-138
@@ -1,138 +0,0 @@
|
||||
{
|
||||
"root": true,
|
||||
"parserOptions": {
|
||||
"ecmaVersion": "latest",
|
||||
"sourceType": "module"
|
||||
},
|
||||
"plugins": [
|
||||
"html",
|
||||
"json"
|
||||
],
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"airbnb-base",
|
||||
"plugin:css/recommended",
|
||||
"plugin:json/recommended",
|
||||
"plugin:node/recommended"
|
||||
],
|
||||
"env": {
|
||||
"browser": true,
|
||||
"commonjs": true,
|
||||
"node": true,
|
||||
"jquery": true,
|
||||
"es2024": true
|
||||
},
|
||||
"rules": {
|
||||
"max-len": [1, 275, 3],
|
||||
"camelcase":"off",
|
||||
"default-case":"off",
|
||||
"no-await-in-loop":"off",
|
||||
"no-bitwise":"off",
|
||||
"no-continue":"off",
|
||||
"no-confusing-arrow":"off",
|
||||
"no-console":"off",
|
||||
"no-empty":"off",
|
||||
"no-loop-func":"off",
|
||||
"no-mixed-operators":"off",
|
||||
"no-param-reassign":"off",
|
||||
"no-process-exit":"off",
|
||||
"no-plusplus":"off",
|
||||
"no-restricted-globals":"off",
|
||||
"no-restricted-syntax":"off",
|
||||
"no-return-assign":"off",
|
||||
"no-unused-vars":"off",
|
||||
"no-useless-escape":"off",
|
||||
"object-curly-newline":"off",
|
||||
"prefer-rest-params":"off",
|
||||
"prefer-destructuring":"off",
|
||||
"radix":"off",
|
||||
"node/shebang": "off"
|
||||
},
|
||||
"globals": {
|
||||
"panzoom": "readonly",
|
||||
"authFetch": "readonly",
|
||||
"log": "readonly",
|
||||
"debug": "readonly",
|
||||
"error": "readonly",
|
||||
"xhrGet": "readonly",
|
||||
"xhrPost": "readonly",
|
||||
"gradioApp": "readonly",
|
||||
"executeCallbacks": "readonly",
|
||||
"onAfterUiUpdate": "readonly",
|
||||
"onOptionsChanged": "readonly",
|
||||
"optionsChangedCallbacks": "readonly",
|
||||
"onUiLoaded": "readonly",
|
||||
"onUiUpdate": "readonly",
|
||||
"onUiTabChange": "readonly",
|
||||
"onUiReady": "readonly",
|
||||
"uiCurrentTab": "writable",
|
||||
"uiElementIsVisible": "readonly",
|
||||
"uiElementInSight": "readonly",
|
||||
"getUICurrentTabContent": "readonly",
|
||||
"waitForFlag": "readonly",
|
||||
"logFn": "readonly",
|
||||
"generateForever": "readonly",
|
||||
"showContributors": "readonly",
|
||||
"opts": "writable",
|
||||
"sortUIElements": "readonly",
|
||||
"all_gallery_buttons": "readonly",
|
||||
"selected_gallery_button": "readonly",
|
||||
"selected_gallery_index": "readonly",
|
||||
"switch_to_txt2img": "readonly",
|
||||
"switch_to_img2img_tab": "readonly",
|
||||
"switch_to_img2img": "readonly",
|
||||
"switch_to_sketch": "readonly",
|
||||
"switch_to_inpaint": "readonly",
|
||||
"witch_to_inpaint_sketch": "readonly",
|
||||
"switch_to_extras": "readonly",
|
||||
"get_tab_index": "readonly",
|
||||
"create_submit_args": "readonly",
|
||||
"restartReload": "readonly",
|
||||
"markSelectedCards": "readonly",
|
||||
"updateInput": "readonly",
|
||||
"toggleCompact": "readonly",
|
||||
"setFontSize": "readonly",
|
||||
"setTheme": "readonly",
|
||||
"registerDragDrop": "readonly",
|
||||
"getToken": "readonly",
|
||||
"getENActiveTab": "readonly",
|
||||
"quickApplyStyle": "readonly",
|
||||
"quickSaveStyle": "readonly",
|
||||
"setupExtraNetworks": "readonly",
|
||||
"showNetworks": "readonly",
|
||||
"localization": "readonly",
|
||||
"randomId": "readonly",
|
||||
"requestProgress": "readonly",
|
||||
"setRefreshInterval": "readonly",
|
||||
"modalPrevImage": "readonly",
|
||||
"modalNextImage": "readonly",
|
||||
"galleryClickEventHandler": "readonly",
|
||||
"getExif": "readonly",
|
||||
"jobStatusEl": "readonly",
|
||||
"removeSplash": "readonly",
|
||||
"initGPU": "readonly",
|
||||
"startGPU": "readonly",
|
||||
"disableNVML": "readonly",
|
||||
"idbGet": "readonly",
|
||||
"idbPut": "readonly",
|
||||
"idbDel": "readonly",
|
||||
"idbAdd": "readonly",
|
||||
"idbCount": "readonly",
|
||||
"idbFolderCleanup": "readonly",
|
||||
"initChangelog": "readonly",
|
||||
"sendNotification": "readonly",
|
||||
"monitorConnection": "readonly"
|
||||
},
|
||||
"ignorePatterns": [
|
||||
"node_modules",
|
||||
"extensions",
|
||||
"repositories",
|
||||
"venv",
|
||||
"panzoom.js",
|
||||
"split.js",
|
||||
"exifr.js",
|
||||
"jquery.js",
|
||||
"sparkline.js",
|
||||
"iframeResizer.min.js"
|
||||
]
|
||||
}
|
||||
Vendored
+10
-1
@@ -2,5 +2,14 @@
|
||||
"python.analysis.extraPaths": [".", "./modules", "./scripts", "./pipelines"],
|
||||
"python.analysis.typeCheckingMode": "off",
|
||||
"editor.formatOnSave": false,
|
||||
"python.REPL.enableREPLSmartSend": false
|
||||
"python.REPL.enableREPLSmartSend": false,
|
||||
"eslint.enable": true,
|
||||
"eslint.validate": [
|
||||
"javascript",
|
||||
"typescript",
|
||||
"html",
|
||||
"css",
|
||||
"json",
|
||||
"markdown"
|
||||
]
|
||||
}
|
||||
|
||||
+3
-3
@@ -2,9 +2,9 @@
|
||||
|
||||
// simple nodejs script to test sdnext api
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const process = require('process');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
|
||||
const argparse = require('argparse');
|
||||
|
||||
const sd_url = process.env.SDAPI_URL || 'http://127.0.0.1:7860';
|
||||
|
||||
+1
-2
@@ -2,8 +2,7 @@
|
||||
|
||||
// simple nodejs script to test sdnext api
|
||||
|
||||
const fs = require('fs'); // eslint-disable-line no-undef
|
||||
const process = require('process'); // eslint-disable-line no-undef
|
||||
const fs = require('node:fs');
|
||||
|
||||
const sd_url = process.env.SDAPI_URL || 'http://127.0.0.1:7860';
|
||||
const sd_username = process.env.SDAPI_USR;
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
#!/usr/bin/env node
|
||||
// script used to localize sdnext ui and hints to multiple languages using google gemini ai
|
||||
|
||||
const fs = require('fs');
|
||||
const process = require('process');
|
||||
const fs = require('node:fs');
|
||||
|
||||
const { GoogleGenerativeAI } = require('@google/generative-ai');
|
||||
|
||||
const api_key = process.env.GOOGLE_AI_API_KEY;
|
||||
|
||||
@@ -0,0 +1,343 @@
|
||||
import path from 'node:path';
|
||||
|
||||
import { includeIgnoreFile } from '@eslint/compat';
|
||||
import css from '@eslint/css';
|
||||
import js from '@eslint/js';
|
||||
import json from '@eslint/json';
|
||||
import markdown from '@eslint/markdown';
|
||||
import html from '@html-eslint/eslint-plugin';
|
||||
import { configs, helpers, plugins, rules } from 'eslint-config-airbnb-extended';
|
||||
import pluginPromise from 'eslint-plugin-promise';
|
||||
import { defineConfig, globalIgnores } from 'eslint/config';
|
||||
import globals from 'globals';
|
||||
|
||||
const gitignorePath = path.resolve('.', '.gitignore');
|
||||
|
||||
const jsConfig = defineConfig([
|
||||
// ESLint recommended config
|
||||
{
|
||||
name: 'js/config',
|
||||
files: helpers.extensions.allFiles,
|
||||
...js.configs.recommended,
|
||||
languageOptions: {
|
||||
ecmaVersion: 'latest',
|
||||
parserOptions: {
|
||||
ecmaVersion: 'latest',
|
||||
},
|
||||
globals: { // Set per project
|
||||
...globals.builtin,
|
||||
...globals.browser,
|
||||
...globals.jquery,
|
||||
panzoom: 'readonly',
|
||||
authFetch: 'readonly',
|
||||
log: 'readonly',
|
||||
debug: 'readonly',
|
||||
error: 'readonly',
|
||||
xhrGet: 'readonly',
|
||||
xhrPost: 'readonly',
|
||||
gradioApp: 'readonly',
|
||||
executeCallbacks: 'readonly',
|
||||
onAfterUiUpdate: 'readonly',
|
||||
onOptionsChanged: 'readonly',
|
||||
optionsChangedCallbacks: 'readonly',
|
||||
onUiLoaded: 'readonly',
|
||||
onUiUpdate: 'readonly',
|
||||
onUiTabChange: 'readonly',
|
||||
onUiReady: 'readonly',
|
||||
uiCurrentTab: 'writable',
|
||||
uiElementIsVisible: 'readonly',
|
||||
uiElementInSight: 'readonly',
|
||||
getUICurrentTabContent: 'readonly',
|
||||
waitForFlag: 'readonly',
|
||||
logFn: 'readonly',
|
||||
generateForever: 'readonly',
|
||||
showContributors: 'readonly',
|
||||
opts: 'writable',
|
||||
sortUIElements: 'readonly',
|
||||
all_gallery_buttons: 'readonly',
|
||||
selected_gallery_button: 'readonly',
|
||||
selected_gallery_index: 'readonly',
|
||||
switch_to_txt2img: 'readonly',
|
||||
switch_to_img2img_tab: 'readonly',
|
||||
switch_to_img2img: 'readonly',
|
||||
switch_to_sketch: 'readonly',
|
||||
switch_to_inpaint: 'readonly',
|
||||
witch_to_inpaint_sketch: 'readonly',
|
||||
switch_to_extras: 'readonly',
|
||||
get_tab_index: 'readonly',
|
||||
create_submit_args: 'readonly',
|
||||
restartReload: 'readonly',
|
||||
markSelectedCards: 'readonly',
|
||||
updateInput: 'readonly',
|
||||
toggleCompact: 'readonly',
|
||||
setFontSize: 'readonly',
|
||||
setTheme: 'readonly',
|
||||
registerDragDrop: 'readonly',
|
||||
getToken: 'readonly',
|
||||
getENActiveTab: 'readonly',
|
||||
quickApplyStyle: 'readonly',
|
||||
quickSaveStyle: 'readonly',
|
||||
setupExtraNetworks: 'readonly',
|
||||
showNetworks: 'readonly',
|
||||
localization: 'readonly',
|
||||
randomId: 'readonly',
|
||||
requestProgress: 'readonly',
|
||||
setRefreshInterval: 'readonly',
|
||||
modalPrevImage: 'readonly',
|
||||
modalNextImage: 'readonly',
|
||||
galleryClickEventHandler: 'readonly',
|
||||
getExif: 'readonly',
|
||||
jobStatusEl: 'readonly',
|
||||
removeSplash: 'readonly',
|
||||
initGPU: 'readonly',
|
||||
startGPU: 'readonly',
|
||||
disableNVML: 'readonly',
|
||||
idbGet: 'readonly',
|
||||
idbPut: 'readonly',
|
||||
idbDel: 'readonly',
|
||||
idbAdd: 'readonly',
|
||||
idbCount: 'readonly',
|
||||
idbFolderCleanup: 'readonly',
|
||||
initChangelog: 'readonly',
|
||||
sendNotification: 'readonly',
|
||||
monitorConnection: 'readonly',
|
||||
},
|
||||
},
|
||||
},
|
||||
pluginPromise.configs['flat/recommended'],
|
||||
// Stylistic plugin
|
||||
plugins.stylistic,
|
||||
// Import X plugin
|
||||
plugins.importX,
|
||||
// Airbnb base recommended config
|
||||
...configs.base.recommended,
|
||||
{
|
||||
name: 'sdnext/js',
|
||||
files: helpers.extensions.allFiles,
|
||||
languageOptions: {
|
||||
ecmaVersion: 'latest',
|
||||
parserOptions: {
|
||||
ecmaVersion: 'latest',
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
camelcase: 'off',
|
||||
'default-case': 'off',
|
||||
'max-classes-per-file': 'warn',
|
||||
'no-await-in-loop': 'off',
|
||||
'no-bitwise': 'off',
|
||||
'no-continue': 'off',
|
||||
'no-console': 'off',
|
||||
'no-loop-func': 'off',
|
||||
'no-param-reassign': 'off',
|
||||
'no-plusplus': 'off',
|
||||
'no-redeclare': 'off',
|
||||
'no-restricted-globals': 'off',
|
||||
'no-restricted-syntax': 'off',
|
||||
'no-unused-vars': 'off',
|
||||
'no-use-before-define': 'warn',
|
||||
'no-useless-escape': 'warn',
|
||||
'prefer-destructuring': 'off',
|
||||
'prefer-rest-params': 'off',
|
||||
'prefer-template': 'warn',
|
||||
radix: 'off',
|
||||
'@stylistic/brace-style': [
|
||||
'error',
|
||||
'1tbs',
|
||||
{
|
||||
allowSingleLine: true,
|
||||
},
|
||||
],
|
||||
'@stylistic/indent': ['error', 2],
|
||||
'@stylistic/lines-between-class-members': [
|
||||
'error',
|
||||
'always',
|
||||
{
|
||||
exceptAfterSingleLine: true,
|
||||
},
|
||||
],
|
||||
'@stylistic/max-len': [
|
||||
'warn',
|
||||
{
|
||||
code: 275,
|
||||
tabWidth: 2,
|
||||
},
|
||||
],
|
||||
'@stylistic/max-statements-per-line': 'off',
|
||||
'@stylistic/no-mixed-operators': 'off',
|
||||
'@stylistic/object-curly-newline': [
|
||||
'error',
|
||||
{
|
||||
multiline: true,
|
||||
consistent: true,
|
||||
},
|
||||
],
|
||||
'@stylistic/quotes': [
|
||||
'error',
|
||||
'single',
|
||||
{
|
||||
avoidEscape: true,
|
||||
},
|
||||
],
|
||||
'@stylistic/semi': [
|
||||
'error',
|
||||
'always',
|
||||
{
|
||||
omitLastInOneLineBlock: false,
|
||||
},
|
||||
],
|
||||
'promise/always-return': 'off',
|
||||
'promise/catch-or-return': 'off',
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
||||
// const typescriptConfig = defineConfig([
|
||||
// // TypeScript ESLint plugin
|
||||
// plugins.typescriptEslint,
|
||||
// // Airbnb base TypeScript config
|
||||
// ...configs.base.typescript,
|
||||
// {
|
||||
// name: 'sdnext/typescript',
|
||||
// files: helpers.extensions.tsFiles,
|
||||
// rules: {
|
||||
// '@typescript-eslint/ban-ts-comment': 'off',
|
||||
// '@typescript-eslint/explicit-module-boundary-types': 'off',
|
||||
// '@typescript-eslint/no-shadow': 'error',
|
||||
// '@typescript-eslint/no-var-requires': 'off',
|
||||
// },
|
||||
// },
|
||||
// ]);
|
||||
|
||||
const nodeConfig = defineConfig([
|
||||
// Node plugin
|
||||
plugins.node,
|
||||
{
|
||||
name: 'sdnext/node',
|
||||
files: ['**/cli/*.js'],
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.node,
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
// Import as rule sets to override the `files` setting from default config
|
||||
...rules.node.base.rules,
|
||||
...rules.node.globals.rules,
|
||||
...rules.node.noUnsupportedFeatures.rules,
|
||||
...rules.node.promises.rules,
|
||||
'n/no-sync': 'off',
|
||||
'n/no-process-exit': 'off',
|
||||
'n/hashbang': 'off',
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
||||
const jsonConfig = defineConfig([
|
||||
{
|
||||
files: ['**/*.json'],
|
||||
ignores: ['package-lock.json'],
|
||||
plugins: { json },
|
||||
language: 'json/json',
|
||||
extends: ['json/recommended'],
|
||||
},
|
||||
]);
|
||||
|
||||
const markdownConfig = defineConfig([
|
||||
{
|
||||
files: ['**/*.md'],
|
||||
plugins: { markdown },
|
||||
language: 'markdown/gfm',
|
||||
processor: 'markdown/markdown',
|
||||
extends: ['markdown/recommended'],
|
||||
},
|
||||
]);
|
||||
|
||||
const cssConfig = defineConfig([
|
||||
{
|
||||
files: ['**/*.css'],
|
||||
language: 'css/css',
|
||||
plugins: { css },
|
||||
extends: ['css/recommended'],
|
||||
// languageOptions: {
|
||||
// tolerant: true,
|
||||
// },
|
||||
rules: {
|
||||
'css/font-family-fallbacks': 'off',
|
||||
'css/no-invalid-properties': [
|
||||
'error',
|
||||
{
|
||||
allowUnknownVariables: true,
|
||||
},
|
||||
],
|
||||
'css/no-important': 'off',
|
||||
'css/use-baseline': 'off',
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
||||
const htmlConfig = defineConfig([
|
||||
{
|
||||
files: ['**/*.html'],
|
||||
plugins: {
|
||||
html,
|
||||
},
|
||||
extends: ['html/recommended'],
|
||||
language: 'html/html',
|
||||
rules: {
|
||||
'html/attrs-newline': 'off',
|
||||
'html/element-newline': [
|
||||
'error',
|
||||
{
|
||||
inline: ['$inline'],
|
||||
},
|
||||
],
|
||||
'html/indent': [
|
||||
'warn',
|
||||
2,
|
||||
],
|
||||
'html/no-duplicate-class': 'error',
|
||||
'html/no-extra-spacing-attrs': [
|
||||
'error',
|
||||
{
|
||||
enforceBeforeSelfClose: true,
|
||||
disallowMissing: true,
|
||||
disallowTabs: true,
|
||||
disallowInAssignment: true,
|
||||
},
|
||||
],
|
||||
'html/require-closing-tags': [
|
||||
'error',
|
||||
{
|
||||
selfClosing: 'always',
|
||||
},
|
||||
],
|
||||
'html/use-baseline': 'off',
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
||||
export default defineConfig([
|
||||
// Ignore files and folders listed in .gitignore
|
||||
includeIgnoreFile(gitignorePath),
|
||||
globalIgnores([
|
||||
'**/node_modules',
|
||||
'**/extensions',
|
||||
'**/extensions-builtin',
|
||||
'**/repositories',
|
||||
'**/venv',
|
||||
'**/panZoom.js',
|
||||
'**/split.js',
|
||||
'**/exifr.js',
|
||||
'**/jquery.js',
|
||||
'**/sparkline.js',
|
||||
'**/iframeResizer.min.js',
|
||||
]),
|
||||
...jsConfig,
|
||||
// ...typescriptConfig,
|
||||
...nodeConfig,
|
||||
...jsonConfig,
|
||||
...markdownConfig,
|
||||
...cssConfig,
|
||||
...htmlConfig,
|
||||
]);
|
||||
@@ -20,7 +20,7 @@ async function setupControlUI() {
|
||||
const tabs = ['input', 'output', 'preview'];
|
||||
for (const tab of tabs) {
|
||||
const btn = gradioApp().getElementById(`control-${tab}-button`);
|
||||
if (!btn) continue; // eslint-disable-line no-continue
|
||||
if (!btn) continue;
|
||||
btn.style.cursor = 'pointer';
|
||||
btn.onclick = () => {
|
||||
const t = gradioApp().getElementById(`control-tab-${tab}`);
|
||||
|
||||
+43
-27
@@ -140,39 +140,55 @@ async function filterExtraNetworksForTab(searchTerm) {
|
||||
const cards = Array.from(pg.querySelectorAll('.card') || []);
|
||||
items += cards.length;
|
||||
if (searchTerm === '' || searchTerm === 'all/') {
|
||||
cards.forEach((elem) => elem.style.display = '');
|
||||
cards.forEach((elem) => { elem.style.display = ''; });
|
||||
} else if (searchTerm === 'reference/') {
|
||||
cards.forEach((elem) => elem.style.display = elem.dataset.name
|
||||
.toLowerCase()
|
||||
.includes('reference/') && elem.dataset.tags === '' ? '' : 'none');
|
||||
cards.forEach((elem) => {
|
||||
elem.style.display = elem.dataset.name
|
||||
.toLowerCase()
|
||||
.includes('reference/') && elem.dataset.tags === '' ? '' : 'none';
|
||||
});
|
||||
} else if (searchTerm === 'distilled/') {
|
||||
cards.forEach((elem) => elem.style.display = elem.dataset.tags
|
||||
.toLowerCase()
|
||||
.includes('distilled') ? '' : 'none');
|
||||
cards.forEach((elem) => {
|
||||
elem.style.display = elem.dataset.tags
|
||||
.toLowerCase()
|
||||
.includes('distilled') ? '' : 'none';
|
||||
});
|
||||
} else if (searchTerm === 'community/') {
|
||||
cards.forEach((elem) => elem.style.display = elem.dataset.tags
|
||||
.toLowerCase()
|
||||
.includes('community') ? '' : 'none');
|
||||
cards.forEach((elem) => {
|
||||
elem.style.display = elem.dataset.tags
|
||||
.toLowerCase()
|
||||
.includes('community') ? '' : 'none';
|
||||
});
|
||||
} else if (searchTerm === 'cloud/') {
|
||||
cards.forEach((elem) => elem.style.display = elem.dataset.tags
|
||||
.toLowerCase()
|
||||
.includes('cloud') ? '' : 'none');
|
||||
cards.forEach((elem) => {
|
||||
elem.style.display = elem.dataset.tags
|
||||
.toLowerCase()
|
||||
.includes('cloud') ? '' : 'none';
|
||||
});
|
||||
} else if (searchTerm === 'quantized/') {
|
||||
cards.forEach((elem) => elem.style.display = elem.dataset.tags
|
||||
.toLowerCase()
|
||||
.includes('quantized') ? '' : 'none');
|
||||
cards.forEach((elem) => {
|
||||
elem.style.display = elem.dataset.tags
|
||||
.toLowerCase()
|
||||
.includes('quantized') ? '' : 'none';
|
||||
});
|
||||
} else if (searchTerm === 'local/') {
|
||||
cards.forEach((elem) => elem.style.display = elem.dataset.name
|
||||
.toLowerCase()
|
||||
.includes('reference/') ? 'none' : '');
|
||||
cards.forEach((elem) => {
|
||||
elem.style.display = elem.dataset.name
|
||||
.toLowerCase()
|
||||
.includes('reference/') ? 'none' : '';
|
||||
});
|
||||
} else if (searchTerm === 'diffusers/') {
|
||||
cards.forEach((elem) => elem.style.display = elem.dataset.name
|
||||
.toLowerCase().replace('models--', 'diffusers').replaceAll('\\', '/')
|
||||
.includes('diffusers/') ? '' : 'none');
|
||||
cards.forEach((elem) => {
|
||||
elem.style.display = elem.dataset.name
|
||||
.toLowerCase().replace('models--', 'diffusers').replaceAll('\\', '/')
|
||||
.includes('diffusers/') ? '' : 'none';
|
||||
});
|
||||
} else if (searchTerm.startsWith('r#')) {
|
||||
searchTerm = searchTerm.substring(2);
|
||||
const re = new RegExp(searchTerm, 'i');
|
||||
cards.forEach((elem) => elem.style.display = re.test(`filename: ${elem.dataset.filename}|name: ${elem.dataset.name}|tags: ${elem.dataset.tags}`) ? '' : 'none');
|
||||
cards.forEach((elem) => {
|
||||
elem.style.display = re.test(`filename: ${elem.dataset.filename}|name: ${elem.dataset.name}|tags: ${elem.dataset.tags}`) ? '' : 'none';
|
||||
});
|
||||
} else {
|
||||
const searchList = searchTerm.split('|').filter((s) => s !== '' && !s.startsWith('-')).map((s) => s.trim());
|
||||
const excludeList = searchTerm.split('|').filter((s) => s !== '' && s.trim().startsWith('-')).map((s) => s.trim().substring(1).trim());
|
||||
@@ -198,8 +214,8 @@ async function filterExtraNetworksForTab(searchTerm) {
|
||||
}
|
||||
|
||||
function tryToRemoveExtraNetworkFromPrompt(textarea, text) {
|
||||
const re_extranet = /<([^:]+:[^:]+):[\d\.]+>/;
|
||||
const re_extranet_g = /\s+<([^:]+:[^:]+):[\d\.]+>/g;
|
||||
const re_extranet = /<([^:]+:[^:]+):[\d.]+>/;
|
||||
const re_extranet_g = /\s+<([^:]+:[^:]+):[\d.]+>/g;
|
||||
let m = text.match(re_extranet);
|
||||
let replaced = false;
|
||||
let newTextareaText;
|
||||
@@ -243,7 +259,7 @@ function sortExtraNetworks(fixed = 'no') {
|
||||
const cards = Array.from(pg.querySelectorAll('.card') || []);
|
||||
if (cards.length === 0) return 'sort: no cards';
|
||||
num += cards.length;
|
||||
cards.sort((a, b) => { // eslint-disable-line no-loop-func
|
||||
cards.sort((a, b) => {
|
||||
switch (sortVal) {
|
||||
case 0: return 0;
|
||||
case 1: return a.dataset.name ? a.dataset.name.localeCompare(b.dataset.name) : 0;
|
||||
@@ -318,7 +334,7 @@ function extraNetworksFilterVersion(event) {
|
||||
if (!cardContainer) return;
|
||||
if (cardContainer.dataset.activeVersion === version) {
|
||||
cardContainer.dataset.activeVersion = '';
|
||||
cardContainer.querySelectorAll('.card').forEach((card) => card.style.display = '');
|
||||
cardContainer.querySelectorAll('.card').forEach((card) => { card.style.display = ''; });
|
||||
} else {
|
||||
cardContainer.dataset.activeVersion = version;
|
||||
cardContainer.querySelectorAll('.card').forEach((card) => {
|
||||
|
||||
+12
-12
@@ -1,5 +1,4 @@
|
||||
/* eslint-disable max-classes-per-file */
|
||||
/* eslint lines-between-class-members: ["error", "always", { "exceptAfterSingleLine": true }] */
|
||||
let ws;
|
||||
let url;
|
||||
let currentImage;
|
||||
@@ -220,7 +219,7 @@ async function handleSeparator(separator) {
|
||||
if (!f.name) continue; // Skip separators
|
||||
|
||||
// Check if file belongs to this exact directory
|
||||
const fileDir = f.name.match(/(.*)[\/\\]/);
|
||||
const fileDir = f.name.match(/(.*)[/\\]/);
|
||||
const fileDirPath = fileDir ? fileDir[1] : '';
|
||||
|
||||
if (separator.title.length > 0 && fileDirPath === separator.title) {
|
||||
@@ -232,14 +231,14 @@ async function handleSeparator(separator) {
|
||||
}
|
||||
|
||||
async function addSeparators() {
|
||||
document.querySelectorAll('.gallery-separator').forEach((node) => el.files.removeChild(node));
|
||||
document.querySelectorAll('.gallery-separator').forEach((node) => { el.files.removeChild(node); });
|
||||
const all = Array.from(el.files.children);
|
||||
let lastDir;
|
||||
let isFirstSeparator = true; // Flag to open the first separator by default
|
||||
|
||||
// First pass: create separators
|
||||
for (const f of all) {
|
||||
let dir = f.name?.match(/(.*)[\/\\]/);
|
||||
let dir = f.name?.match(/(.*)[/\\]/);
|
||||
if (!dir) dir = '';
|
||||
else dir = dir[1];
|
||||
if (dir !== lastDir) {
|
||||
@@ -249,7 +248,7 @@ async function addSeparators() {
|
||||
let fileCount = 0;
|
||||
for (const file of all) {
|
||||
if (!file.name) continue;
|
||||
const fileDir = file.name.match(/(.*)[\/\\]/);
|
||||
const fileDir = file.name.match(/(.*)[/\\]/);
|
||||
const fileDirPath = fileDir ? fileDir[1] : '';
|
||||
if (fileDirPath === dir) fileCount++;
|
||||
}
|
||||
@@ -299,7 +298,7 @@ async function addSeparators() {
|
||||
for (const f of all) {
|
||||
if (!f.name) continue; // Skip separators
|
||||
|
||||
const dir = f.name.match(/(.*)[\/\\]/);
|
||||
const dir = f.name.match(/(.*)[/\\]/);
|
||||
if (dir && dir[1]) {
|
||||
const dirPath = dir[1];
|
||||
const isOpen = separatorStates.get(dirPath);
|
||||
@@ -357,7 +356,7 @@ class GalleryFile extends HTMLElement {
|
||||
}
|
||||
|
||||
// Check separator state early to hide the element immediately
|
||||
const dir = this.name.match(/(.*)[\/\\]/);
|
||||
const dir = this.name.match(/(.*)[/\\]/);
|
||||
if (dir && dir[1]) {
|
||||
const dirPath = dir[1];
|
||||
const isOpen = separatorStates.get(dirPath);
|
||||
@@ -538,7 +537,7 @@ async function wsConnect(socket, timeout = 5000) {
|
||||
|
||||
let loop = 0;
|
||||
while (socket.readyState === WebSocket.CONNECTING && loop < ttl) {
|
||||
await new Promise((resolve) => setTimeout(resolve, intrasleep)); // eslint-disable-line no-promise-executor-return
|
||||
await new Promise((resolve) => { setTimeout(resolve, intrasleep); });
|
||||
loop++;
|
||||
}
|
||||
return isOpened();
|
||||
@@ -569,7 +568,7 @@ async function gallerySearch() {
|
||||
});
|
||||
|
||||
allFiles.forEach((f) => {
|
||||
const dir = f.name.match(/(.*)[\/\\]/);
|
||||
const dir = f.name.match(/(.*)[/\\]/);
|
||||
const dirPath = (dir && dir[1]) ? dir[1] : '';
|
||||
const isOpen = separatorStates.get(dirPath);
|
||||
f.style.display = (!dirPath || isOpen) ? 'unset' : 'none';
|
||||
@@ -603,7 +602,7 @@ async function gallerySearch() {
|
||||
if (isMatch) {
|
||||
fileMatches.add(f);
|
||||
totalFound++;
|
||||
const dir = f.name.match(/(.*)[\/\\]/);
|
||||
const dir = f.name.match(/(.*)[/\\]/);
|
||||
const dirPath = (dir && dir[1]) ? dir[1] : '';
|
||||
directoryMatches.set(dirPath, (directoryMatches.get(dirPath) || 0) + 1);
|
||||
}
|
||||
@@ -716,7 +715,7 @@ async function gallerySort(btn) {
|
||||
for (const f of all) {
|
||||
if (!f.name) continue; // Skip separators
|
||||
|
||||
const dir = f.name.match(/(.*)[\/\\]/);
|
||||
const dir = f.name.match(/(.*)[/\\]/);
|
||||
if (dir && dir[1]) {
|
||||
const dirPath = dir[1];
|
||||
const isOpen = separatorStates.get(dirPath);
|
||||
@@ -973,7 +972,8 @@ async function monitorGalleries() {
|
||||
|
||||
async function setOverlayAnimation() {
|
||||
const busyAnimation = document.createElement('style');
|
||||
busyAnimation.textContent = '.idbBusyAnim{width:16px;height:16px;border-radius:50%;display:block;margin:40px;position:relative;background:#ff3d00;color:#fff;box-shadow:-24px 0,24px 0;box-sizing:border-box;animation:2s ease-in-out infinite overlayRotation}@keyframes overlayRotation{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}'; // eslint-disable-line max-len
|
||||
// eslint-disable-next-line @stylistic/max-len
|
||||
busyAnimation.textContent = '.idbBusyAnim{width:16px;height:16px;border-radius:50%;display:block;margin:40px;position:relative;background:#ff3d00;color:#fff;box-shadow:-24px 0,24px 0;box-sizing:border-box;animation:2s ease-in-out infinite overlayRotation}@keyframes overlayRotation{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}';
|
||||
document.head.append(busyAnimation);
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -1,9 +1,9 @@
|
||||
let gpuInterval = null; // eslint-disable-line prefer-const
|
||||
let gpuInterval = null;
|
||||
const chartData = { mem: [], load: [] };
|
||||
|
||||
async function updateGPUChart(mem, load) {
|
||||
const maxLen = 120;
|
||||
const colorRangeMap = $.range_map({ // eslint-disable-line no-undef
|
||||
const colorRangeMap = $.range_map({
|
||||
'0:5': '#fffafa',
|
||||
'6:10': '#fff7ed',
|
||||
'11:20': '#fed7aa',
|
||||
@@ -22,8 +22,8 @@ async function updateGPUChart(mem, load) {
|
||||
chartData.load.push(load);
|
||||
if (chartData.mem.length > maxLen) chartData.mem.shift();
|
||||
chartData.mem.push(mem);
|
||||
$('#gpuChart').sparkline(chartData.load, sparklineConfigLOAD); // eslint-disable-line no-undef
|
||||
$('#gpuChart').sparkline(chartData.mem, sparklineConfigMEM); // eslint-disable-line no-undef
|
||||
$('#gpuChart').sparkline(chartData.load, sparklineConfigLOAD);
|
||||
$('#gpuChart').sparkline(chartData.mem, sparklineConfigMEM);
|
||||
}
|
||||
|
||||
async function updateGPU() {
|
||||
|
||||
@@ -56,7 +56,7 @@ async function logMonitor() {
|
||||
if (imgGallery) imgGallery.style.height = opts.logmonitor_show ? '50vh' : '55vh';
|
||||
|
||||
if (!opts.logmonitor_show) {
|
||||
Array.from(document.getElementsByClassName('log-monitor')).forEach((el) => el.style.display = 'none');
|
||||
Array.from(document.getElementsByClassName('log-monitor')).forEach((el) => { el.style.display = 'none'; });
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ const log = async (...msg) => {
|
||||
window.logger.innerHTML += window.logPrettyPrint(...msg);
|
||||
scrollBottom(window.logger);
|
||||
}
|
||||
console.log(ts, ...msg); // eslint-disable-line no-console
|
||||
console.log(ts, ...msg);
|
||||
};
|
||||
|
||||
const debug = async (...msg) => {
|
||||
@@ -20,7 +20,7 @@ const debug = async (...msg) => {
|
||||
window.logger.innerHTML += window.logPrettyPrint(...msg);
|
||||
scrollBottom(window.logger);
|
||||
}
|
||||
console.debug(ts, ...msg); // eslint-disable-line no-console
|
||||
console.debug(ts, ...msg);
|
||||
};
|
||||
|
||||
const error = async (...msg) => {
|
||||
@@ -30,7 +30,7 @@ const error = async (...msg) => {
|
||||
window.logger.innerHTML += window.logPrettyPrint(...msg);
|
||||
scrollBottom(window.logger);
|
||||
}
|
||||
console.error(ts, ...msg); // eslint-disable-line no-console
|
||||
console.error(ts, ...msg);
|
||||
// const txt = msg.join(' ');
|
||||
// if (!txt.includes('asctime') && !txt.includes('xhr.')) xhrPost('/sdapi/v1/log', { error: txt }); // eslint-disable-line no-use-before-define
|
||||
};
|
||||
|
||||
@@ -173,7 +173,7 @@ async function initModels() {
|
||||
`;
|
||||
el.innerHTML = res.length > 0 ? ready() : warn();
|
||||
el.style.display = 'block';
|
||||
setTimeout(() => el.style.display = 'none', res.length === 0 ? 30000 : 1500);
|
||||
setTimeout(() => { el.style.display = 'none'; }, res.length === 0 ? 30000 : 1500);
|
||||
if (res.length === 0) {
|
||||
if (en.classList.contains('hide')) gradioApp().getElementById('txt2img_extra_networks_btn').click();
|
||||
const repeat = setInterval(() => {
|
||||
|
||||
@@ -6,7 +6,7 @@ async function waitForOpts() {
|
||||
// make sure all of the ui is ready and options are loaded
|
||||
const t0 = performance.now();
|
||||
let t1 = performance.now();
|
||||
while (true) { // eslint-disable-line no-constant-condition
|
||||
while (true) {
|
||||
if (t1 - t0 > 120000) {
|
||||
log('waitForOpts timeout');
|
||||
break;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
function startTrainMonitor() {
|
||||
gradioApp().querySelector('#train_error').innerHTML = '';
|
||||
const id = randomId();
|
||||
const onProgress = (progress) => gradioApp().getElementById('train_progress').innerHTML = progress.textinfo;
|
||||
const onProgress = (progress) => { gradioApp().getElementById('train_progress').innerHTML = progress.textinfo; };
|
||||
requestProgress(id, gradioApp().getElementById('train_gallery'), null, onProgress, false);
|
||||
const res = Array.from(arguments);
|
||||
res[0] = id;
|
||||
|
||||
@@ -14,7 +14,7 @@ async function getUIDefaults() {
|
||||
const btn = gradioApp().getElementById('ui_defaults_view');
|
||||
if (!btn) return;
|
||||
const intersectionObserver = new IntersectionObserver((entries) => {
|
||||
if (entries[0].intersectionRatio <= 0) { }
|
||||
if (entries[0].intersectionRatio <= 0) { /* Pass */ }
|
||||
if (entries[0].intersectionRatio > 0) btn.click();
|
||||
});
|
||||
intersectionObserver.observe(btn); // monitor visibility of tab
|
||||
|
||||
+19
-12
@@ -34,19 +34,26 @@
|
||||
"test": ". venv/bin/activate; python launch.py --debug --test"
|
||||
},
|
||||
"devDependencies": {
|
||||
"esbuild": "^0.18.20"
|
||||
"@eslint/compat": "^2.0.0",
|
||||
"@eslint/css": "^0.14.1",
|
||||
"@eslint/js": "^9.39.2",
|
||||
"@eslint/json": "^0.14.0",
|
||||
"@eslint/markdown": "^7.5.1",
|
||||
"@html-eslint/eslint-plugin": "^0.52.1",
|
||||
"esbuild": "^0.27.2",
|
||||
"eslint": "^9.39.2",
|
||||
"eslint-config-airbnb-extended": "^3.0.0",
|
||||
"eslint-plugin-promise": "^7.2.1",
|
||||
"globals": "^17.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@google/generative-ai": "^0.21.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.47.0",
|
||||
"argparse": "^2.0.1",
|
||||
"eslint": "^8.57.1",
|
||||
"eslint-config-airbnb-base": "^15.0.0",
|
||||
"eslint-plugin-css": "^0.9.2",
|
||||
"eslint-plugin-html": "^8.1.3",
|
||||
"eslint-plugin-import": "^2.32.0",
|
||||
"eslint-plugin-json": "^3.1.0",
|
||||
"eslint-plugin-markdown": "^4.0.1",
|
||||
"eslint-plugin-node": "^11.1.0"
|
||||
"@google/generative-ai": "^0.24.1",
|
||||
"argparse": "^2.0.1"
|
||||
},
|
||||
"//": {
|
||||
"disabled": {
|
||||
"typescript": "^5.9.3",
|
||||
"@types/node": "^25.0.3"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user