13 Commits

Author SHA1 Message Date
595410adac Apt update in cont
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2024-02-26 20:33:14 +03:00
8c0912ec66 Git install in cont
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2024-02-26 20:32:04 +03:00
ffa73b8419 Drop alpine
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2024-02-26 20:29:49 +03:00
8674db6523 Drop corepack
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2024-02-26 20:27:39 +03:00
f58ba2d54d Another libc compat. Alpine latest
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2024-02-26 20:26:42 +03:00
04aa72aafe Libc compat
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2024-02-26 20:25:01 +03:00
afbd240779 Initial Woodpecker conf
Some checks failed
ci/woodpecker/manual/woodpecker Pipeline failed
2024-02-26 20:21:15 +03:00
space-nuko
abd31401f0 Merge pull request #148 from haze/hb/vibrateIfPossible
`vibrateIfPossible`: fixes iOS safari uncaught exceptions & etc
2023-08-25 23:43:22 -05:00
haze
2f48f96830 Update CheckboxWidget.svelte 2023-08-25 15:26:15 -04:00
Haze Booth
63d51e9119 Introduce vibrateIfPossible into the utils package. This will check if the browser
has support for vibrating. This fixes a number of bugs for iOS safari & friends.
2023-08-24 12:02:22 -04:00
space-nuko
6f02912d2e Merge pull request #125 from space-nuko/restore-params2
Upgrade Svelte and dependency versions
2023-07-07 09:49:39 -05:00
space-nuko
3b49bac47b Merge pull request #126 from space-nuko/server-args
Add arguments to serve.py
2023-07-07 09:49:27 -05:00
space-nuko
33ed379a98 Add arguments to serve.py 2023-07-07 09:12:28 -05:00
14 changed files with 76 additions and 50 deletions

11
.woodpecker.yml Normal file
View 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

View File

@@ -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)

View File

@@ -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
}

View File

@@ -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) {

View File

@@ -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);
}
}

View File

@@ -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 = {

View File

@@ -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>

View File

@@ -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

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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();
}

View File

@@ -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();
}

View File

@@ -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();
}