Updates for mobile

This commit is contained in:
space-nuko
2023-05-07 11:54:54 -05:00
parent 5018200266
commit 71c9617133
15 changed files with 162 additions and 54 deletions

View File

@@ -6,6 +6,7 @@ import { toast } from '@zerodevx/svelte-toast'
import type { GalleryOutput } from "./ComfyWidgetNodes";
import { get } from "svelte/store";
import queueState from "$lib/stores/queueState";
import notify from "$lib/notify";
export interface ComfyQueueEventsProperties extends Record<any, any> {
}
@@ -199,7 +200,7 @@ export class ComfyNotifyAction extends ComfyGraphNode {
override onAction(action: any, param: any) {
const message = this.getInputData(0);
if (message) {
toast.push(message);
notify(message);
}
};
}

View File

@@ -113,7 +113,7 @@ export class ComfyBackendNode extends ComfyGraphNode {
}
}
else {
console.error("[ComfyBackendNode] Missing input config in onConfigure()!", input, configs)
console.debug("[ComfyBackendNode] Missing input config in onConfigure()", input, configs)
input.config = {}
}
}

View File

@@ -158,7 +158,7 @@ export default class ComfyImageCacheNode extends ComfyGraphNode {
else {
this.properties.filenames[newIndex] = { filename: null, status: "uploading" }
this.onPropertyChanged("filenames", this.properties.filenames)
const url = "http://localhost:8188" // TODO make configurable
const url = `http://${location.hostname}:8188` // TODO make configurable
const params = new URLSearchParams(data)
const promise = fetch(url + "/view?" + params)

View File

@@ -516,11 +516,11 @@ export class ComfyGalleryNode extends ComfyWidgetNode<GradioFileData[]> {
private convertItems(output: GalleryOutput): GradioFileData[] {
return output.images.map(r => {
// TODO configure backend URL
const url = "http://localhost:8188/view?"
const url = `http://${location.hostname}:8188` // TODO make configurable
const params = new URLSearchParams(r)
return {
name: null,
data: url + params
data: url + "/view?" + params
}
});
}