Queuing from mobile UI

This commit is contained in:
space-nuko
2023-04-28 16:50:16 -07:00
parent eec4fcaf2e
commit 234c280959
11 changed files with 553 additions and 57 deletions

View File

@@ -1,3 +1,9 @@
import ComfyApp from "./components/ComfyApp";
import ComboWidget from "$lib/widgets/ComboWidget.svelte";
import RangeWidget from "$lib/widgets/RangeWidget.svelte";
import TextWidget from "$lib/widgets/TextWidget.svelte";
import widgetState, { type WidgetDrawState, type WidgetUIState } from "$lib/stores/widgetState";
export function download(filename: string, text: string, type: string = "text/plain") {
const blob = new Blob([text], { type: type });
const url = URL.createObjectURL(blob);
@@ -11,3 +17,25 @@ export function download(filename: string, text: string, type: string = "text/pl
window.URL.revokeObjectURL(url);
}, 0);
}
export function getComponentForWidgetState(item: WidgetUIState): any {
let ctor: any = null;
// custom widgets with TypeScript sources
let override = ComfyApp.widget_type_overrides[item.widget.type]
if (override) {
return override;
}
// litegraph.ts built-in widgets
switch (item.widget.type) {
case "combo":
return ComboWidget;
case "number":
return RangeWidget;
case "text":
return TextWidget;
}
return null;
}