mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 09:14:35 +02:00
@@ -14,7 +14,6 @@
|
||||
/outputs/*
|
||||
/package-lock.json
|
||||
/params.txt
|
||||
/pnpm-lock.yaml
|
||||
/styles.csv
|
||||
/tmp
|
||||
/ui-config.json
|
||||
|
||||
@@ -12,7 +12,7 @@ applyTo: "launch.py, webui.py, installer.py, modules/**/*.py, pipelines/**/*.py,
|
||||
5. Keep extension and script loading resilient: when adding startup scans/hooks, preserve partial-failure tolerance and logging.
|
||||
6. Follow existing API/server patterns under `modules/api/` and reuse shared queue/state helpers rather than ad-hoc request handling.
|
||||
7. Reuse established model-loading and pipeline patterns (`modules/sd_*`, `pipelines/`) instead of creating parallel abstractions.
|
||||
8. For substantial Python changes, run at least relevant checks: `npm run ruff` and `npm run pylint` (or narrower equivalents when appropriate).
|
||||
8. For substantial Python changes, run at least relevant checks: `pnpm run ruff` and `pnpm run pylint` (or narrower equivalents when appropriate).
|
||||
|
||||
## Build And Test
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ If rules conflict, prioritize earlier rules over later ones unless explicitly st
|
||||
3. Keep localization-friendly UI text changes synchronized with locale resources in `ui/locale/locale_*.json` when user-facing strings are added or changed. For dynamically generated UI text, ensure that localization keys are pre-defined and referenced appropriately in the codebase.
|
||||
4. Avoid combining visual changes that do not directly support the functional fixes being implemented; ensure UI PRs are scoped to a single purpose and remain reviewable.
|
||||
5. For extension UI work, respect each extension's boundaries and avoid cross-extension coupling.
|
||||
6. Validate TypeScript and JavaScript changes with `npm run eslint` and `npm run tsc` from the repository root, or the equivalent extension-level command when working inside an extension.
|
||||
6. Validate TypeScript and JavaScript changes with `pnpm run eslint` and `pnpm run tsc` from the repository root, or the equivalent extension-level command when working inside an extension.
|
||||
7. Maintain mobile compatibility when touching layout or interaction behavior.
|
||||
|
||||
## UI code locations
|
||||
@@ -31,37 +31,41 @@ If rules conflict, prioritize earlier rules over later ones unless explicitly st
|
||||
|
||||
## Build and development commands
|
||||
|
||||
Ensure `pnpm` is installed:
|
||||
|
||||
- `npm install -g pnpm`
|
||||
|
||||
Install dependencies from the repository root:
|
||||
|
||||
- `npm install`
|
||||
- `pnpm install`
|
||||
|
||||
Build UI components:
|
||||
|
||||
- `npm run build:core` - build the core UI
|
||||
- `npm run build:modernui` - build ModernUI
|
||||
- `npm run build:kanvas` - build Kanvas
|
||||
- `npm run build` - build all UI components
|
||||
- `pnpm run build:core` - build the core UI
|
||||
- `pnpm run build:modernui` - build ModernUI
|
||||
- `pnpm run build:kanvas` - build Kanvas
|
||||
- `pnpm run build` - build all UI components
|
||||
|
||||
Run development builds with watch mode:
|
||||
|
||||
- `npm run dev:core` - development build for core UI
|
||||
- `npm run dev:modernui` - development build for ModernUI
|
||||
- `npm run dev:kanvas` - development build for Kanvas
|
||||
- `pnpm run dev:core` - development build for core UI
|
||||
- `pnpm run dev:modernui` - development build for ModernUI
|
||||
- `pnpm run dev:kanvas` - development build for Kanvas
|
||||
|
||||
## Lint and validation
|
||||
|
||||
UI checks are required for all frontend contributions:
|
||||
|
||||
- `npm run eslint:core` - lint core UI files
|
||||
- `npm run eslint:modernui` - lint ModernUI files
|
||||
- `npm run eslint:kanvas` - lint Kanvas files
|
||||
- `npm run eslint` - lint all UI code
|
||||
- `npm run tsc:core` - type-check core UI files
|
||||
- `npm run tsc:modernui` - type-check ModernUI files
|
||||
- `npm run tsc:kanvas` - type-check Kanvas files
|
||||
- `npm run tsc` - type-check all UI code
|
||||
- `npm run precommit` - run pre-commit checks across the repository
|
||||
- `npm run ui` - run full UI lint/type/build sequence
|
||||
- `pnpm run eslint:core` - lint core UI files
|
||||
- `pnpm run eslint:modernui` - lint ModernUI files
|
||||
- `pnpm run eslint:kanvas` - lint Kanvas files
|
||||
- `pnpm run eslint` - lint all UI code
|
||||
- `pnpm run tsc:core` - type-check core UI files
|
||||
- `pnpm run tsc:modernui` - type-check ModernUI files
|
||||
- `pnpm run tsc:kanvas` - type-check Kanvas files
|
||||
- `pnpm run tsc` - type-check all UI code
|
||||
- `pnpm run precommit` - run pre-commit checks across the repository
|
||||
- `pnpm run ui` - run full UI lint/type/build sequence
|
||||
|
||||
## Notes
|
||||
|
||||
|
||||
+1
-1
@@ -19,7 +19,6 @@ __pycache__
|
||||
/data/installer.json
|
||||
/data/rocm.json
|
||||
node_modules
|
||||
pnpm-lock.yaml
|
||||
package-lock.json
|
||||
|
||||
# all models and temp files
|
||||
@@ -60,6 +59,7 @@ tunableop_results*.csv
|
||||
!package.json
|
||||
!requirements.txt
|
||||
!constraints.txt
|
||||
!pnpm-lock.yaml
|
||||
!/data
|
||||
!/models/VAE-approx
|
||||
!/models/VAE-approx/model.pt
|
||||
|
||||
@@ -158,7 +158,7 @@ TODO: Investigate which models are diffusers-compatible and prioritize!
|
||||
|
||||
## Code TODO
|
||||
|
||||
> npm run todo
|
||||
> pnpm run todo
|
||||
|
||||
```code
|
||||
installer.py:652:15: W0511: TODO rocm: switch to pytorch source when it becomes available (fixme)
|
||||
|
||||
Submodule extensions-builtin/sdnext-kanvas updated: dc8ac5aa18...501c89c871
Submodule extensions-builtin/sdnext-modernui updated: 406eed3510...ae0e523485
@@ -35,7 +35,7 @@ def html_head():
|
||||
if '.esm' in script.filename or '.mjs' in script.filename:
|
||||
head += f'<script type="module" src="{webpath(script.path)}"></script>\n'
|
||||
else:
|
||||
head += f'<script type="text/javascript" src="{webpath(script.path)}"></script>\n'
|
||||
head += f'<script type="text/javascript" defer src="{webpath(script.path)}"></script>\n'
|
||||
added.append(script.path)
|
||||
for script in scripts_manager.list_scripts('javascript', ".mjs"):
|
||||
head += f'<script type="module" src="{webpath(script.path)}"></script>\n'
|
||||
|
||||
Generated
+5793
File diff suppressed because it is too large
Load Diff
@@ -70,6 +70,9 @@ const contextMenuInit = () => {
|
||||
});
|
||||
}
|
||||
|
||||
window.appendContextMenuOption = appendContextMenuOption;
|
||||
window.removeContextMenuOption = removeContextMenuOption;
|
||||
|
||||
async function addContextMenuEventListener(): Promise<void> {
|
||||
if (eventListenerApplied) return;
|
||||
log('initContextMenu');
|
||||
|
||||
Vendored
+6
-1
@@ -11123,6 +11123,8 @@ function requestProgress(id_task = "undefined", progressEl = null, galleryEl = n
|
||||
}
|
||||
window.checkPaused = checkPaused;
|
||||
window.requestInterrupt = requestInterrupt;
|
||||
window.randomId = randomId;
|
||||
window.requestProgress = requestProgress;
|
||||
|
||||
// ui/ui.ts
|
||||
window.opts = {};
|
||||
@@ -11754,6 +11756,7 @@ window.getDesiredCheckpointName = getDesiredCheckpointName;
|
||||
window.currentImageResolutionimg2img = currentImageResolutionimg2img;
|
||||
window.currentImageResolutioncontrol = currentImageResolutioncontrol;
|
||||
window.updateImg2imgResizeToTextAfterChangingImage = updateImg2imgResizeToTextAfterChangingImage;
|
||||
window.create_submit_args = create_submit_args;
|
||||
|
||||
// ui/inputAccordion.ts
|
||||
function inputAccordionChecked(id, checked) {
|
||||
@@ -15555,6 +15558,8 @@ var contextMenuInit = () => {
|
||||
if (index >= 0) v.splice(index, 1);
|
||||
});
|
||||
}
|
||||
window.appendContextMenuOption = appendContextMenuOption2;
|
||||
window.removeContextMenuOption = removeContextMenuOption2;
|
||||
async function addContextMenuEventListener2() {
|
||||
if (eventListenerApplied) return;
|
||||
log("initContextMenu");
|
||||
@@ -16452,7 +16457,7 @@ function keyupEditAttention(event2) {
|
||||
function selectCurrentWord() {
|
||||
if (selectionStart !== selectionEnd) return false;
|
||||
const delimiters = `${window.opts.keyedit_delimiters} \r
|
||||
`;
|
||||
`;
|
||||
while (!delimiters.includes(text[selectionStart - 1]) && selectionStart > 0) selectionStart--;
|
||||
while (!delimiters.includes(text[selectionEnd]) && selectionEnd < text.length) selectionEnd++;
|
||||
target.setSelectionRange(selectionStart, selectionEnd);
|
||||
|
||||
Vendored
+2
-2
File diff suppressed because one or more lines are too long
Vendored
+6
-1
@@ -74,6 +74,7 @@ declare global {
|
||||
recalculate_prompts_inpaint?: (...args: unknown[]) => unknown[]; // ui/ui.ts
|
||||
recalculate_prompts_control?: (...args: unknown[]) => unknown[]; // ui/ui.ts
|
||||
consumeDesiredCheckpointName?: (...args: unknown[]) => unknown[]; // ui/ui.ts
|
||||
create_submit_args?: (args: unknown[]) => unknown[]; // ui/ui.ts
|
||||
selectCheckpoint?: (name: string) => void; // ui/ui.ts
|
||||
selectVAE?: (name: string) => void; // ui/ui.ts
|
||||
selectUNet?: (name: string) => void; // ui/ui.ts
|
||||
@@ -122,6 +123,8 @@ declare global {
|
||||
xhrPost?: (url: string, data: unknown, handler?: (json: unknown) => void, errorHandler?: (xhrObj: XMLHttpRequest) => void, ignore?: boolean, serverTimeout?: number) => void; // ui/logger.ts
|
||||
checkPaused?: (state?: boolean) => void; // ui/progressBar.ts
|
||||
requestInterrupt?: () => void; // ui/progressBar.ts
|
||||
randomId?: () => string; // ui/progressBar.ts
|
||||
requestProgress?: (id_task?: string, progressEl?: HTMLElement | null, galleryEl?: HTMLElement | null, atEnd?: (() => void) | null, onProgress?: ((progress: unknown) => void) | null, once?: boolean) => void; // ui/progressBar.ts
|
||||
deleteFile?: (filename: string) => Promise<void>; // ui/script.ts
|
||||
gradioApp: () => Document | Element | ShadowRoot; // ui/script.ts
|
||||
onAfterUiUpdate?: (callback: () => void) => void; // ui/script.ts
|
||||
@@ -132,7 +135,8 @@ declare global {
|
||||
onUiUpdate?: (callback: () => void) => void; // ui/script.ts
|
||||
timer?: (name: string, elapsed: number) => Promise<void>; // ui/timers.ts
|
||||
markIfModified?: (setting_name: string, value: unknown) => void; // ui/settings.ts
|
||||
waitForUiReady?: () => Promise<void>; // extensions-builtin/sdnext-modernui/src/index.ts
|
||||
appendContextMenuOption?: (targetElementSelector: string, entryName: string, entryFunction: () => void, primary?: boolean) => string; // ui/contextMenus.ts
|
||||
removeContextMenuOption?: (id: string) => void; // ui/contextMenus.ts
|
||||
|
||||
// legacy module
|
||||
Hash?: any; // ui/js/sha256.ts
|
||||
@@ -144,6 +148,7 @@ declare global {
|
||||
logger?: HTMLElement; // extensions-builtin/sdnext-modernui/src/logger.ts
|
||||
setupLogger?: () => Promise<void>; // extensions-builtin/sdnext-modernui/src/logger.ts
|
||||
logPrettyPrint?: (...args: unknown[]) => string; // extensions-builtin/sdnext-modernui/src/logger.ts
|
||||
waitForUiReady?: () => Promise<void>; // extensions-builtin/sdnext-modernui/src/index.ts
|
||||
|
||||
// kanvas
|
||||
Kanvas?: new (containerId: string, opts?: { width?: number; height?: number }) => {
|
||||
|
||||
@@ -197,3 +197,5 @@ export function requestProgress(id_task = 'undefined', progressEl = null, galler
|
||||
|
||||
window.checkPaused = checkPaused;
|
||||
window.requestInterrupt = requestInterrupt;
|
||||
window.randomId = randomId;
|
||||
window.requestProgress = requestProgress;
|
||||
|
||||
@@ -253,7 +253,7 @@ function get_img2img_tab_index(...args) {
|
||||
return res;
|
||||
}
|
||||
|
||||
function create_submit_args(args) {
|
||||
export function create_submit_args(args) {
|
||||
const res = Array.from<any>(args);
|
||||
if (Array.isArray(res[res.length - 3])) res[res.length - 3] = null;
|
||||
return res;
|
||||
@@ -844,3 +844,4 @@ window.getDesiredCheckpointName = getDesiredCheckpointName;
|
||||
window.currentImageResolutionimg2img = currentImageResolutionimg2img;
|
||||
window.currentImageResolutioncontrol = currentImageResolutioncontrol;
|
||||
window.updateImg2imgResizeToTextAfterChangingImage = updateImg2imgResizeToTextAfterChangingImage;
|
||||
window.create_submit_args = create_submit_args;
|
||||
|
||||
+1
-1
Submodule wiki updated: 3e5f0ea7dd...557abd5d50
Reference in New Issue
Block a user