Compare commits
13 Commits
restore-pa
...
test-wod
| Author | SHA1 | Date | |
|---|---|---|---|
| 595410adac | |||
| 8c0912ec66 | |||
| ffa73b8419 | |||
| 8674db6523 | |||
| f58ba2d54d | |||
| 04aa72aafe | |||
| afbd240779 | |||
|
|
abd31401f0 | ||
|
|
2f48f96830 | ||
|
|
63d51e9119 | ||
|
|
6f02912d2e | ||
|
|
3b49bac47b | ||
|
|
33ed379a98 |
11
.woodpecker.yml
Normal file
11
.woodpecker.yml
Normal file
@@ -0,0 +1,11 @@
|
||||
steps:
|
||||
- name: Prepare
|
||||
image: node:18-slim
|
||||
commands:
|
||||
- apt-get update -y
|
||||
- apt-get install -yy git
|
||||
- corepack enable
|
||||
- corepack prepare pnpm@latest --activate
|
||||
- pnpm install --frozen-lockfile
|
||||
- pnpm prebuild
|
||||
- pnpm build
|
||||
59
bin/serve.py
59
bin/serve.py
@@ -2,15 +2,19 @@
|
||||
|
||||
import http.server
|
||||
import socketserver
|
||||
import argparse
|
||||
|
||||
PORT = 8000
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("-l", "--listen", type=str, default="localhost", help="Listen address for ComfyBox server")
|
||||
parser.add_argument("-p", "--port", type=int, default=8000, help="Port for ComfyBox server")
|
||||
args = parser.parse_args()
|
||||
|
||||
message = f"""Starting ComfyBox.
|
||||
Be sure you've started ComfyUI already using this command:
|
||||
|
||||
python main.py --enable-cors-header
|
||||
|
||||
Serving at http://localhost:{PORT}...
|
||||
Serving at http://{args.listen}:{args.port}...
|
||||
"""
|
||||
|
||||
# python -m http.server will sometimes send incorrect MIME types.
|
||||
@@ -19,33 +23,34 @@ Serving at http://localhost:{PORT}...
|
||||
# Hopefully this will cover everything.
|
||||
class HttpRequestHandler(http.server.SimpleHTTPRequestHandler):
|
||||
extensions_map = {
|
||||
'': 'application/octet-stream',
|
||||
'.manifest': 'text/cache-manifest',
|
||||
'.html': 'text/html',
|
||||
'.png': 'image/png',
|
||||
'.jpg': 'image/jpg',
|
||||
'.jpeg': 'image/jpeg',
|
||||
'.gif': 'image/gif',
|
||||
'.svg': 'image/svg+xml',
|
||||
'.css': 'text/css',
|
||||
'.js': 'application/x-javascript',
|
||||
'.mjs': 'application/x-javascript',
|
||||
'.cjs': 'application/x-javascript',
|
||||
'.wasm': 'application/wasm',
|
||||
'.json': 'application/json',
|
||||
'.xml': 'application/xml',
|
||||
'.xml': 'application/xml',
|
||||
'.pdf': 'application/pdf',
|
||||
'.webp': 'image/webp',
|
||||
'.avif': 'image/avif',
|
||||
'.heic': 'image/heic',
|
||||
'.heif': 'image/heif',
|
||||
'.mp3': 'audio/mpeg',
|
||||
'.mp4': 'video/mp4',
|
||||
'.m4v': 'video/mp4'
|
||||
"": "application/octet-stream",
|
||||
".manifest": "text/cache-manifest",
|
||||
".html": "text/html",
|
||||
".png": "image/png",
|
||||
".jpg": "image/jpg",
|
||||
".jpeg": "image/jpeg",
|
||||
".gif": "image/gif",
|
||||
".svg": "image/svg+xml",
|
||||
".css": "text/css",
|
||||
".js": "application/x-javascript",
|
||||
".mjs": "application/x-javascript",
|
||||
".cjs": "application/x-javascript",
|
||||
".wasm": "application/wasm",
|
||||
".json": "application/json",
|
||||
".xml": "application/xml",
|
||||
".xml": "application/xml",
|
||||
".pdf": "application/pdf",
|
||||
".webp": "image/webp",
|
||||
".avif": "image/avif",
|
||||
".heic": "image/heic",
|
||||
".heif": "image/heif",
|
||||
".mp3": "audio/mpeg",
|
||||
".mp4": "video/mp4",
|
||||
".m4v": "video/mp4",
|
||||
}
|
||||
|
||||
httpd = socketserver.TCPServer(("localhost", PORT), HttpRequestHandler)
|
||||
|
||||
httpd = socketserver.TCPServer((args.listen, args.port), HttpRequestHandler)
|
||||
|
||||
try:
|
||||
print(message)
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
import {cubicIn} from 'svelte/easing';
|
||||
import { flip } from 'svelte/animate';
|
||||
import { type ContainerLayout, type WidgetLayout, type IDragItem } from "$lib/stores/layoutStates";
|
||||
import { startDrag, stopDrag } from "$lib/utils"
|
||||
import { startDrag, stopDrag, vibrateIfPossible } from "$lib/utils"
|
||||
import { writable, type Writable } from "svelte/store";
|
||||
import { isHidden } from "$lib/widgets/utils";
|
||||
import { handleContainerConsider, handleContainerFinalize } from "./utils";
|
||||
@@ -56,7 +56,7 @@
|
||||
};
|
||||
|
||||
function handleClick(e: CustomEvent<boolean>) {
|
||||
navigator.vibrate(20)
|
||||
vibrateIfPossible(20)
|
||||
$isOpen = e.detail
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
import {cubicIn} from 'svelte/easing';
|
||||
import { flip } from 'svelte/animate';
|
||||
import { type ContainerLayout, type WidgetLayout, type IDragItem, type WritableLayoutStateStore } from "$lib/stores/layoutStates";
|
||||
import { startDrag, stopDrag } from "$lib/utils"
|
||||
import { startDrag, stopDrag, vibrateIfPossible } from "$lib/utils"
|
||||
import type { Writable } from "svelte/store";
|
||||
import { isHidden } from "$lib/widgets/utils";
|
||||
import { handleContainerConsider, handleContainerFinalize } from "./utils";
|
||||
@@ -62,7 +62,7 @@
|
||||
}
|
||||
|
||||
function handleSelect() {
|
||||
navigator.vibrate(20)
|
||||
vibrateIfPossible(20)
|
||||
}
|
||||
|
||||
function _startDrag(e: MouseEvent | TouchEvent) {
|
||||
|
||||
@@ -828,3 +828,9 @@ const MOBILE_USER_AGENTS = ["iPhone", "iPad", "Android", "BlackBerry", "WebOs"].
|
||||
export function isMobileBrowser(userAgent: string): boolean {
|
||||
return MOBILE_USER_AGENTS.some(a => userAgent.match(a))
|
||||
}
|
||||
|
||||
export function vibrateIfPossible(strength: number | Array<number>) {
|
||||
if (window.navigator.vibrate) {
|
||||
window.navigator.vibrate(strength);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import { Button } from "@gradio/button";
|
||||
import { get, type Writable, writable } from "svelte/store";
|
||||
import { isDisabled } from "./utils"
|
||||
import { vibrateIfPossible } from "$lib/utils";
|
||||
import type { ComfyButtonNode } from "$lib/nodes/widgets";
|
||||
|
||||
export let widget: WidgetLayout | null = null;
|
||||
@@ -24,7 +25,7 @@
|
||||
|
||||
function onClick(e: MouseEvent) {
|
||||
node.onClick();
|
||||
navigator.vibrate(20)
|
||||
vibrateIfPossible(20)
|
||||
}
|
||||
|
||||
const style = {
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
import { Checkbox } from "@gradio/form";
|
||||
import { get, type Writable, writable } from "svelte/store";
|
||||
import { isDisabled } from "./utils"
|
||||
import { vibrateIfPossible } from "$lib/utils";
|
||||
import type { SelectData } from "@gradio/utils";
|
||||
import type { ComfyCheckboxNode } from "$lib/nodes/widgets";
|
||||
|
||||
@@ -25,7 +26,7 @@
|
||||
|
||||
function onSelect(e: CustomEvent<SelectData>) {
|
||||
$nodeValue = e.detail.selected
|
||||
navigator.vibrate(20)
|
||||
vibrateIfPossible(20)
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import { type WidgetLayout } from "$lib/stores/layoutStates";
|
||||
import { get, writable, type Writable } from "svelte/store";
|
||||
import { isDisabled } from "./utils"
|
||||
import { clamp, getSafetensorsMetadata } from '$lib/utils';
|
||||
import { clamp, getSafetensorsMetadata, vibrateIfPossible } from '$lib/utils';
|
||||
export let widget: WidgetLayout | null = null;
|
||||
export let isMobile: boolean = false;
|
||||
let node: ComfyComboNode | null = null;
|
||||
@@ -70,7 +70,7 @@
|
||||
function onFocus() {
|
||||
// console.warn("FOCUS")
|
||||
if (listOpen) {
|
||||
navigator.vibrate(20)
|
||||
vibrateIfPossible(20)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
|
||||
function handleSelect(index: number) {
|
||||
// console.warn("SEL", index)
|
||||
navigator.vibrate(20)
|
||||
vibrateIfPossible(20)
|
||||
const item = $valuesForCombo[index]
|
||||
activeIndex = index;
|
||||
$nodeValue = item.value
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { type WidgetLayout } from "$lib/stores/layoutStates";
|
||||
import { Range } from "$lib/components/gradio/form";
|
||||
import { get, type Writable } from "svelte/store";
|
||||
import { debounce } from "$lib/utils";
|
||||
import { debounce, vibrateIfPossible } from "$lib/utils";
|
||||
import interfaceState from "$lib/stores/interfaceState";
|
||||
import { isDisabled } from "./utils"
|
||||
export let widget: WidgetLayout | null = null;
|
||||
@@ -96,7 +96,7 @@
|
||||
lastDisplayValue = option;
|
||||
canVibrate = false;
|
||||
setTimeout(() => { canVibrate = true }, 30)
|
||||
navigator.vibrate(10)
|
||||
vibrateIfPossible(10)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import { get, type Writable, writable } from "svelte/store";
|
||||
import { isDisabled } from "./utils"
|
||||
import type { SelectData } from "@gradio/utils";
|
||||
import { clamp } from "$lib/utils";
|
||||
import { clamp, vibrateIfPossible } from "$lib/utils";
|
||||
import type { ComfyRadioNode } from "$lib/nodes/widgets";
|
||||
|
||||
export let widget: WidgetLayout | null = null;
|
||||
@@ -34,7 +34,7 @@
|
||||
function onSelect(e: CustomEvent<SelectData>) {
|
||||
node.setValue(e.detail.value)
|
||||
node.index = e.detail.index as number
|
||||
navigator.vibrate(20)
|
||||
vibrateIfPossible(20)
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script lang="ts">
|
||||
import ComfyApp, { type SerializedAppState } from "$lib/components/ComfyApp";
|
||||
import workflowState, { ComfyBoxWorkflow } from "$lib/stores/workflowState";
|
||||
import { vibrateIfPossible } from "$lib/utils";
|
||||
|
||||
import { Link, Toolbar } from "framework7-svelte"
|
||||
|
||||
@@ -11,7 +12,7 @@
|
||||
$: workflow = $workflowState.activeWorkflow;
|
||||
|
||||
function queuePrompt() {
|
||||
navigator.vibrate(20)
|
||||
vibrateIfPossible(20)
|
||||
app.runDefaultQueueAction()
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import ComfyApp, { type SerializedAppState } from "$lib/components/ComfyApp";
|
||||
import queueState from "$lib/stores/queueState";
|
||||
import workflowState, { ComfyBoxWorkflow } from "$lib/stores/workflowState";
|
||||
import { getNodeInfo } from "$lib/utils"
|
||||
import { getNodeInfo, vibrateIfPossible } from "$lib/utils"
|
||||
import { LayoutTextSidebarReverse, Image, Grid } from "svelte-bootstrap-icons";
|
||||
|
||||
import { Link, Toolbar } from "framework7-svelte"
|
||||
@@ -21,12 +21,12 @@
|
||||
$: workflow = $workflowState.activeWorkflow;
|
||||
|
||||
function queuePrompt() {
|
||||
navigator.vibrate(20)
|
||||
vibrateIfPossible(20)
|
||||
app.runDefaultQueueAction()
|
||||
}
|
||||
|
||||
async function refreshCombos() {
|
||||
navigator.vibrate(20)
|
||||
vibrateIfPossible(20)
|
||||
await app.refreshComboInNodes()
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
if (!fileInput)
|
||||
return;
|
||||
|
||||
navigator.vibrate(20)
|
||||
vibrateIfPossible(20)
|
||||
app.querySave()
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
if (!fileInput)
|
||||
return;
|
||||
|
||||
navigator.vibrate(20)
|
||||
vibrateIfPossible(20)
|
||||
fileInput.value = null;
|
||||
fileInput.click();
|
||||
}
|
||||
@@ -52,7 +52,7 @@
|
||||
}
|
||||
|
||||
function doSaveLocal(): void {
|
||||
navigator.vibrate(20)
|
||||
vibrateIfPossible(20)
|
||||
app.saveStateToLocalStorage();
|
||||
}
|
||||
|
||||
|
||||
@@ -34,12 +34,12 @@
|
||||
}
|
||||
|
||||
async function refreshCombos() {
|
||||
navigator.vibrate(20)
|
||||
vibrateIfPossible(20)
|
||||
await app.refreshComboInNodes()
|
||||
}
|
||||
|
||||
function doSaveLocal(): void {
|
||||
navigator.vibrate(20)
|
||||
vibrateIfPossible(20)
|
||||
app.saveStateToLocalStorage();
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import workflowState, { ComfyBoxWorkflow, type WorkflowInstID } from "$lib/stores/workflowState";
|
||||
import { onMount } from "svelte";
|
||||
import interfaceState from "$lib/stores/interfaceState";
|
||||
import { vibrateIfPossible } from "$lib/utils";
|
||||
import { f7 } from 'framework7-svelte';
|
||||
import { XCircle } from 'svelte-bootstrap-icons';
|
||||
|
||||
@@ -31,7 +32,7 @@
|
||||
if (!fileInput)
|
||||
return;
|
||||
|
||||
navigator.vibrate(20)
|
||||
vibrateIfPossible(20);
|
||||
fileInput.value = null;
|
||||
fileInput.click();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user