Compare commits
22
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8ff9a64888 | ||
|
|
23f77cdd1d | ||
|
|
fe649c94f8 | ||
|
|
b9414c0a32 | ||
|
|
22b536cd06 | ||
|
|
506cf662e3 | ||
|
|
18836122ff | ||
|
|
e406d40ad6 | ||
|
|
f6960d29c2 | ||
|
|
283c84d24a | ||
|
|
0a39d125cb | ||
|
|
f1f0975caa | ||
|
|
5d501642d5 | ||
|
|
195b3f102b | ||
|
|
fe0c5390b2 | ||
|
|
5940fcfaa9 | ||
|
|
e17f683e18 | ||
|
|
d5f769042d | ||
|
|
80254b9126 | ||
|
|
cf65c09ea4 | ||
|
|
a8c663e083 | ||
|
|
48f443714b |
@@ -31,9 +31,9 @@ https://github.com/talesofai/comfyui-browser/assets/828837/803ce57a-1cf2-4e1c-be
|
||||
|
||||
- Simple XYZ Plot by selecting inputs and filling in the values.
|
||||
|
||||
<img width="256" alt="image" src="https://github.com/talesofai/comfyui-browser/assets/828837/23ce6a4d-3311-4058-9b46-ddb50d07e22a">
|
||||
<img width="512" alt="image" src="https://github.com/talesofai/comfyui-browser/assets/828837/23ce6a4d-3311-4058-9b46-ddb50d07e22a">
|
||||
|
||||
<img width="256" alt="image" src="https://github.com/talesofai/comfyui-browser/assets/828837/347cad17-17c0-46f1-8df3-4b188b16a354">
|
||||
<img width="768" alt="image" src="https://github.com/talesofai/comfyui-browser/assets/828837/d46461ac-3fb3-4037-b1be-048a7ae5e89a">
|
||||
|
||||
|
||||
## Preview
|
||||
@@ -61,6 +61,37 @@ https://github.com/talesofai/comfyui-browser/assets/828837/803ce57a-1cf2-4e1c-be
|
||||
|
||||
Install [ComfyUI Manager](https://github.com/ltdrdata/ComfyUI-Manager), search `comfyui-browser` in Install Custom Node and install it.
|
||||
|
||||
#### Configuring
|
||||
|
||||
In your `comfyui-browser` directory, you can add a `config.json` to override
|
||||
the directories that `comfyui-browser` uses. Ex:
|
||||
|
||||
``` json
|
||||
{
|
||||
"collections": "/var/lib/comfyui/comfyui-browser-collections",
|
||||
"download_logs": "/var/lib/comfyui/comfyui-browser-download-logs",
|
||||
"outputs": "/var/lib/comfyui/outputs",
|
||||
"sources": "/var/lib/comfyui/comfyui-browser-sources"
|
||||
}
|
||||
```
|
||||
|
||||
The default configuration values are:
|
||||
|
||||
``` json
|
||||
{
|
||||
"collections": "[comfyui-browser]/collections",
|
||||
"download_logs": "[comfyui-browser]/download-logs",
|
||||
"outputs": "[comfyui]/outputs",
|
||||
"sources": "[comfyui-browser]/sources"
|
||||
}
|
||||
```
|
||||
|
||||
Where `[comfyui-browser]` is the automatically determined path of your
|
||||
`comfyui-browser` installation, and `[comfyui]` is the automatically determined
|
||||
path of your `comfyui` server. Notably, the `outputs` directory defaults to the
|
||||
`--output-directory` argument to `comfyui` itself, or the default path that
|
||||
`comfyui` wishes to use for the `--output-directory` argument.
|
||||
|
||||
### Manually
|
||||
|
||||
Clone this repo into the `custom_nodes` folder and restart the ComfyUI.
|
||||
@@ -71,7 +102,9 @@ cd custom_nodes && git clone https://github.com/tzwm/comfyui-browser.git
|
||||
|
||||
## Notes
|
||||
|
||||
- Your 'Saves' are stored in the `ComfyUI/custom_nodes/comfyui-browser/collections`.
|
||||
- Your 'Saves' are stored in the `collections` configuration value. See <a
|
||||
href="#Configuring">Configuring</a> for its default, and how to set the path
|
||||
to something different.
|
||||
- Press 'B' to toggle the Browser dialog in the ComfyUI.
|
||||
|
||||
|
||||
|
||||
+3
-3
@@ -37,9 +37,9 @@ browser_app.add_routes([
|
||||
|
||||
web.static("/web", os.path.join(browser_path, 'web/build')),
|
||||
|
||||
web.static("/s/outputs", outputs_path),
|
||||
web.static("/s/collections", collections_path),
|
||||
web.static("/s/sources", sources_path),
|
||||
web.static("/s/outputs", outputs_path()),
|
||||
web.static("/s/collections", collections_path()),
|
||||
web.static("/s/sources", sources_path()),
|
||||
])
|
||||
server.PromptServer.instance.app.add_subapp("/browser/", browser_app)
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import requests
|
||||
import json
|
||||
from ..utils import http_client
|
||||
|
||||
class DifyTextGenerator:
|
||||
CATEGORY = "Browser"
|
||||
@@ -39,7 +39,7 @@ class DifyTextGenerator:
|
||||
# something weird, I have to add '{' and '}' manually
|
||||
data["inputs"] = json.loads("{" + inputs_json_str + "}")
|
||||
|
||||
r = requests.post(
|
||||
r = http_client().post(
|
||||
dify_api_endpoint,
|
||||
headers=header,
|
||||
data=json.dumps(data),
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import hashlib
|
||||
import requests
|
||||
import os
|
||||
from PIL import Image, ImageSequence, ImageOps
|
||||
import numpy as np
|
||||
import torch
|
||||
from ..utils import http_client
|
||||
|
||||
|
||||
import folder_paths
|
||||
@@ -22,6 +22,9 @@ class LoadImageByUrl:
|
||||
"required": {
|
||||
"url": ["STRING", {}],
|
||||
},
|
||||
"optional": {
|
||||
"cache": ["BOOLEAN", {"default": True}],
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -29,23 +32,23 @@ class LoadImageByUrl:
|
||||
self.url = ""
|
||||
|
||||
def filename(self):
|
||||
return hashlib.md5(self.url.encode()).hexdigest()[:24] + '.jpg'
|
||||
return hashlib.md5(self.url.encode()).hexdigest()[:48] + '.jpg'
|
||||
|
||||
def download_by_url(self):
|
||||
input_dir = folder_paths.get_input_directory()
|
||||
res = requests.get(self.url)
|
||||
res = http_client().get(self.url)
|
||||
if res.status_code == 200:
|
||||
download_path = os.path.join(input_dir, self.filename())
|
||||
with open(download_path, 'wb') as file:
|
||||
file.write(res.content)
|
||||
else:
|
||||
raise ValueError(f"Failed to load image from {self.url}: {res.status_code}")
|
||||
raise ValueError(f"Failed to load image from {self.url}: {res.status_code} {res.text}")
|
||||
|
||||
def run(self, url):
|
||||
def run(self, url, cache=True):
|
||||
self.url = url
|
||||
input_dir = folder_paths.get_input_directory()
|
||||
image_path = os.path.join(input_dir, self.filename())
|
||||
if not os.path.isfile(image_path):
|
||||
if cache == False or not os.path.isfile(image_path):
|
||||
self.download_by_url()
|
||||
|
||||
img = Image.open(image_path)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import requests
|
||||
import threading
|
||||
import asyncio
|
||||
import json
|
||||
@@ -7,6 +6,7 @@ from PIL.PngImagePlugin import PngInfo
|
||||
import numpy as np
|
||||
import io
|
||||
import base64
|
||||
from ..utils import http_client, log
|
||||
|
||||
class UploadToRemote:
|
||||
CATEGORY = "Browser"
|
||||
@@ -61,9 +61,9 @@ class UploadToRemote:
|
||||
|
||||
output = io.BytesIO()
|
||||
if extension in ["jpg", "jpeg"]:
|
||||
img.save(output, quality=quality, optimize=True, format="JPEG")
|
||||
img.convert('RGB').save(output, quality=quality, optimize=True, format="JPEG")
|
||||
elif extension == 'webp':
|
||||
img.save(output, quality=quality, exif=exif_data, format="WEBP")
|
||||
img.convert('RGB').save(output, quality=quality, exif=exif_data, format="WEBP")
|
||||
else:
|
||||
img.save(output, pnginfo=exif_data, optimize=True, format="PNG")
|
||||
image_bytes = output.getvalue()
|
||||
@@ -87,7 +87,9 @@ class UploadToRemote:
|
||||
"Content-Type": "application/json",
|
||||
}
|
||||
data = json.dumps(data).encode('utf-8')
|
||||
res = requests.post(remote_url, data=data, headers=headers)
|
||||
log(f"uploading {track_id} to {remote_url}")
|
||||
res = http_client().post(remote_url, data=data, headers=headers)
|
||||
log(f"uploaded {track_id}: {res.status_code} {res.text}")
|
||||
# TODO: check the response
|
||||
|
||||
|
||||
|
||||
+8
-11
@@ -1,6 +1,5 @@
|
||||
import shutil
|
||||
import time
|
||||
import requests
|
||||
import json
|
||||
from PIL import Image
|
||||
import numpy as np
|
||||
@@ -9,7 +8,7 @@ import copy
|
||||
|
||||
import folder_paths
|
||||
|
||||
from ..utils import SERVER_BASE_URL
|
||||
from ..utils import SERVER_BASE_URL, http_client
|
||||
|
||||
class XyzPlot:
|
||||
CATEGORY = "Browser"
|
||||
@@ -71,8 +70,7 @@ class XyzPlot:
|
||||
return f"/browser/files/view?folder_type=outputs&filename={filename}&folder_path={folder_name}"
|
||||
|
||||
def save_images(self, images):
|
||||
if not os.path.exists(self.output_folder_name):
|
||||
os.mkdir(self.output_folder_name)
|
||||
os.makedirs(self.output_folder_name, exist_ok=True)
|
||||
|
||||
for index, image in enumerate(images):
|
||||
i = 255. * image.cpu().numpy()
|
||||
@@ -108,7 +106,7 @@ class XyzPlot:
|
||||
|
||||
# for some special network environments like AutoDL
|
||||
proxies = {"http": "", "https": ""}
|
||||
return requests.post(SERVER_BASE_URL + '/prompt', data=data, proxies=proxies)
|
||||
return http_client().post(SERVER_BASE_URL + '/prompt', data=data, proxies=proxies)
|
||||
|
||||
|
||||
batch_size = len(images)
|
||||
@@ -178,11 +176,10 @@ class XyzPlot:
|
||||
})
|
||||
|
||||
# Check if the directory exists
|
||||
if not os.path.exists(self.output_folder_name):
|
||||
try:
|
||||
os.makedirs(self.output_folder_name)
|
||||
except Exception as e:
|
||||
raise Exception(f"Failed to create directory: {e}")
|
||||
try:
|
||||
os.makedirs(self.output_folder_name, exist_ok=True)
|
||||
except Exception as e:
|
||||
raise Exception(f"Failed to create directory: {e}")
|
||||
|
||||
browser_base_url = f"/browser/s/outputs/{output_folder_name}"
|
||||
retData = {
|
||||
@@ -191,7 +188,7 @@ class XyzPlot:
|
||||
if extra_pnginfo:
|
||||
workflow_filename = "workflow.json"
|
||||
with open(f"{self.output_folder_name}/{workflow_filename}", "w", encoding="utf-8") as f:
|
||||
json.dump(extra_pnginfo, f)
|
||||
json.dump(extra_pnginfo['workflow'], f)
|
||||
retData["workflow"] = {
|
||||
"url": f'{browser_base_url}/{workflow_filename}',
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
tqdm
|
||||
pandas
|
||||
numpy
|
||||
requests
|
||||
urllib3
|
||||
|
||||
+10
-11
@@ -1,4 +1,4 @@
|
||||
from os import path, mkdir
|
||||
from os import path, makedirs
|
||||
from aiohttp import web
|
||||
import shutil
|
||||
import time
|
||||
@@ -19,15 +19,14 @@ async def api_add_to_collections(request):
|
||||
folder_type = json_data.get("folder_type", "outputs")
|
||||
parent_path = get_parent_path(folder_type)
|
||||
|
||||
if not path.exists(collections_path):
|
||||
mkdir(collections_path)
|
||||
makedirs(collections_path(), exist_ok=True)
|
||||
|
||||
source_file_path = path.join(parent_path, folder_path, filename)
|
||||
if not path.exists(source_file_path):
|
||||
return web.Response(status=404)
|
||||
|
||||
new_filepath = path.join(
|
||||
collections_path,
|
||||
collections_path(),
|
||||
add_uuid_to_filename(filename)
|
||||
)
|
||||
|
||||
@@ -48,7 +47,7 @@ async def api_create_new_workflow(request):
|
||||
return web.Response(status=404)
|
||||
|
||||
new_filepath = path.join(
|
||||
collections_path,
|
||||
collections_path(),
|
||||
add_uuid_to_filename(filename)
|
||||
)
|
||||
with open(new_filepath, 'w', encoding='utf-8') as f:
|
||||
@@ -68,10 +67,10 @@ async def api_sync_my_collections(_):
|
||||
git_init()
|
||||
|
||||
cmd = 'git status -s'
|
||||
ret = run_cmd(cmd, collections_path)
|
||||
ret = run_cmd(cmd, collections_path())
|
||||
if len(ret.stdout) > 0:
|
||||
cmd = f'git add . && git commit -m "sync by comfyui-browser at {int(time.time())}"'
|
||||
ret = run_cmd(cmd, collections_path)
|
||||
ret = run_cmd(cmd, collections_path())
|
||||
if not ret.returncode == 0:
|
||||
return web.json_response(
|
||||
{ 'message': "\n".join([ret.stdout, ret.stderr]) },
|
||||
@@ -79,7 +78,7 @@ async def api_sync_my_collections(_):
|
||||
)
|
||||
|
||||
cmd = f'git fetch {git_remote_name} -v'
|
||||
ret = run_cmd(cmd, collections_path)
|
||||
ret = run_cmd(cmd, collections_path())
|
||||
if not ret.returncode == 0:
|
||||
return web.json_response(
|
||||
{ 'message': "\n".join([ret.stdout, ret.stderr]) },
|
||||
@@ -87,14 +86,14 @@ async def api_sync_my_collections(_):
|
||||
)
|
||||
|
||||
cmd = 'git branch --show-current'
|
||||
ret = run_cmd(cmd, collections_path)
|
||||
ret = run_cmd(cmd, collections_path())
|
||||
branch = ret.stdout.replace('\n', '')
|
||||
|
||||
cmd = f'git merge {git_remote_name}/{branch}'
|
||||
ret = run_cmd(cmd, collections_path, log_code=False)
|
||||
ret = run_cmd(cmd, collections_path(), log_code=False)
|
||||
|
||||
cmd = f'git push {git_remote_name} {branch}'
|
||||
ret = run_cmd(cmd, collections_path)
|
||||
ret = run_cmd(cmd, collections_path())
|
||||
if not ret.returncode == 0:
|
||||
return web.json_response(
|
||||
{ 'message': "\n".join([ret.stdout, ret.stderr]) },
|
||||
|
||||
+2
-2
@@ -18,7 +18,7 @@ async def api_update_browser_config(request):
|
||||
git_init()
|
||||
|
||||
if git_repo == '':
|
||||
ret = run_cmd(f'git remote remove {git_remote_name}', collections_path)
|
||||
ret = run_cmd(f'git remote remove {git_remote_name}', collections_path())
|
||||
if not ret.returncode == 0:
|
||||
return web.json_response(
|
||||
{ 'message': ret.stderr },
|
||||
@@ -42,7 +42,7 @@ def set_config(config):
|
||||
with open(config_path, 'w', encoding='utf-8') as f:
|
||||
json.dump(config, f)
|
||||
|
||||
def git_set_remote_url(remote_url, run_path = collections_path):
|
||||
def git_set_remote_url(remote_url, run_path = collections_path()):
|
||||
ret = run_cmd('git remote', run_path)
|
||||
|
||||
if git_remote_name in ret.stdout.split('\n'):
|
||||
|
||||
+5
-6
@@ -1,7 +1,6 @@
|
||||
from os import path
|
||||
import os
|
||||
import shutil
|
||||
import requests
|
||||
import time
|
||||
import asyncio
|
||||
import json
|
||||
@@ -11,7 +10,7 @@ from tqdm import tqdm
|
||||
|
||||
import folder_paths
|
||||
|
||||
from ..utils import download_logs_path, log
|
||||
from ..utils import download_logs_path, log, http_client
|
||||
|
||||
def parse_options_header(content_disposition):
|
||||
param, options = '', {}
|
||||
@@ -34,7 +33,7 @@ def parse_options_header(content_disposition):
|
||||
|
||||
# credit: https://gist.github.com/phineas-pta/d73f9a035b05f8e923af8c01df057175
|
||||
async def download_by_requests(uuid:str, download_url:str, save_in:str, filename:str="", overwrite:bool=False, chunk_size:int=1):
|
||||
log_file_path = path.join(download_logs_path, uuid + '.json')
|
||||
log_file_path = path.join(download_logs_path(), uuid + '.json')
|
||||
base_info = {
|
||||
'uuid': uuid,
|
||||
'download_url': download_url,
|
||||
@@ -53,7 +52,7 @@ async def download_by_requests(uuid:str, download_url:str, save_in:str, filename
|
||||
|
||||
HEADERS = {"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36"}
|
||||
|
||||
with requests.get(download_url, headers=HEADERS, stream=True) as resp:
|
||||
with http_client().get(download_url, headers=HEADERS, stream=True) as resp:
|
||||
MISSING_FILENAME = f"unkwown_{uuid}"
|
||||
# get file name
|
||||
if filename == "":
|
||||
@@ -129,7 +128,7 @@ async def api_create_new_download(request):
|
||||
|
||||
async def api_list_downloads(_):
|
||||
download_logs = []
|
||||
folder_listing = os.scandir(download_logs_path)
|
||||
folder_listing = os.scandir(download_logs_path())
|
||||
folder_listing = sorted(folder_listing, key=lambda f: (f.is_file(), -f.stat().st_ctime))
|
||||
for item in folder_listing:
|
||||
if not path.exists(item.path):
|
||||
@@ -162,7 +161,7 @@ async def api_show_download(request):
|
||||
if uuid == '':
|
||||
return web.Response(status=400)
|
||||
|
||||
target_path = path.join(download_logs_path, uuid + '.json')
|
||||
target_path = path.join(download_logs_path(), uuid + '.json')
|
||||
if not path.exists(target_path):
|
||||
return web.Response(status=404)
|
||||
|
||||
|
||||
+8
-9
@@ -1,4 +1,4 @@
|
||||
from os import path, scandir, mkdir
|
||||
from os import path, scandir, makedirs
|
||||
import json
|
||||
from aiohttp import web, ClientSession, ClientTimeout
|
||||
import re
|
||||
@@ -17,13 +17,13 @@ def handle_remove_readonly(func, path, exc):
|
||||
raise
|
||||
|
||||
async def api_get_sources(_):
|
||||
if not path.exists(sources_path):
|
||||
if not path.exists(sources_path()):
|
||||
return web.json_response({
|
||||
'sources': []
|
||||
})
|
||||
|
||||
sources = []
|
||||
source_list = scandir(sources_path)
|
||||
source_list = scandir(sources_path())
|
||||
source_list = sorted(source_list, key=lambda f: (-f.stat().st_ctime))
|
||||
for item in source_list:
|
||||
if not path.exists(item.path):
|
||||
@@ -58,8 +58,7 @@ async def api_create_source(request):
|
||||
if not repo_url:
|
||||
return web.Response(status=400)
|
||||
|
||||
if not path.exists(sources_path):
|
||||
mkdir(sources_path)
|
||||
makedirs(sources_path(), exist_ok=True)
|
||||
|
||||
pattern = r'[\:\/]([a-zA-Z0-9-_]+)\/([a-zA-Z0-9-_]+)(\.git)?'
|
||||
ret = re.search(pattern, repo_url)
|
||||
@@ -69,7 +68,7 @@ async def api_create_source(request):
|
||||
return web.Response(status=400, text='wrong url')
|
||||
|
||||
cmd = f'git clone --depth 1 {repo_url} {author}-{name}'
|
||||
ret = run_cmd(cmd, sources_path)
|
||||
ret = run_cmd(cmd, sources_path())
|
||||
if ret.returncode != 0:
|
||||
return web.Response(status=400, text=ret.stdout + ret.stderr)
|
||||
|
||||
@@ -83,7 +82,7 @@ async def api_delete_source(request):
|
||||
if not name:
|
||||
return web.Response(status=401)
|
||||
|
||||
target_path = path.join(sources_path, name)
|
||||
target_path = path.join(sources_path(), name)
|
||||
if not path.exists(target_path):
|
||||
return web.Response(status=404)
|
||||
|
||||
@@ -96,11 +95,11 @@ async def api_sync_source(request):
|
||||
|
||||
if not name:
|
||||
return web.Response(status=401)
|
||||
if not path.exists(path.join(sources_path, name)):
|
||||
if not path.exists(path.join(sources_path(), name)):
|
||||
return web.Response(status=404)
|
||||
|
||||
cmd = f'git pull'
|
||||
ret = run_cmd(cmd, path.join(sources_path, name))
|
||||
ret = run_cmd(cmd, path.join(sources_path(), name))
|
||||
|
||||
if ret.returncode == 0:
|
||||
return web.Response(status=200)
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
@tailwind base
|
||||
@tailwind components
|
||||
@tailwind utilities
|
||||
|
||||
.table-zebra-grey
|
||||
tbody
|
||||
tr:nth-child(even)
|
||||
background-color: #424242
|
||||
th
|
||||
background-color: #424242
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<input id="my-drawer-3" type="checkbox" class="drawer-toggle" />
|
||||
<div class="drawer-content flex flex-col">
|
||||
<!-- Navbar -->
|
||||
<div class="w-full navbar bg-base-300">
|
||||
<div class="w-full navbar p-0 bg-base-300 min-h-0">
|
||||
<div class="flex-none">
|
||||
{#if sidebarItems}
|
||||
<label
|
||||
@@ -57,21 +57,14 @@
|
||||
<div>
|
||||
<input
|
||||
type="range"
|
||||
min="30"
|
||||
max="300"
|
||||
min="50"
|
||||
max="500"
|
||||
bind:value={_imageWidth}
|
||||
class="range"
|
||||
/>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
{#each extraItems as item}
|
||||
<li>
|
||||
<button on:click={item.onClick}>
|
||||
{item.label}
|
||||
</button>
|
||||
</li>
|
||||
{/each}
|
||||
<li>
|
||||
<button
|
||||
on:click={() => {
|
||||
@@ -82,9 +75,17 @@
|
||||
}
|
||||
}}
|
||||
>
|
||||
{_mode === TableMode.Score ? 'Score' : 'View'}
|
||||
{_mode === TableMode.Score ? 'Score Mode' : 'View Mode'}
|
||||
</button>
|
||||
</li>
|
||||
|
||||
{#each extraItems as item}
|
||||
<li>
|
||||
<button on:click={item.onClick}>
|
||||
{item.label}
|
||||
</button>
|
||||
</li>
|
||||
{/each}
|
||||
</ul>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
export let score: number;
|
||||
</script>
|
||||
|
||||
<span>
|
||||
<span class="text-accent">
|
||||
({score})
|
||||
</span>
|
||||
|
||||
@@ -2,24 +2,23 @@
|
||||
import Score from './score.svelte';
|
||||
import type { Axis, AxisScore } from './models';
|
||||
import TableHolder from './table-holder.svelte';
|
||||
import { el } from '@faker-js/faker';
|
||||
import { zip } from './utils';
|
||||
export let axis: Axis;
|
||||
export let score: AxisScore | undefined;
|
||||
</script>
|
||||
|
||||
<tr>
|
||||
<tr class="p-0 even:bg-stone-800 odd:bg-base-100">
|
||||
<!-- prompts -->
|
||||
<th style="max-width:30vw" class="z-10">
|
||||
{axis.value}
|
||||
<th class="z-10 p-0 max-w-44 bg-inherit">
|
||||
{#if score}
|
||||
<Score score={score.score} />
|
||||
{/if}
|
||||
{axis.value}
|
||||
</th>
|
||||
{#if score && score.children}
|
||||
{#each zip(axis.children, score.children) as [dim2, score2]}
|
||||
{#if dim2.type === 'axis' && score2.children}
|
||||
<td>
|
||||
<td class="p-0">
|
||||
{#each zip(dim2.children, score2.children) as [dim3, score3]}
|
||||
<TableHolder value={dim3} score={score3}></TableHolder>
|
||||
{/each}
|
||||
@@ -29,7 +28,7 @@
|
||||
{:else}
|
||||
{#each axis.children as dim2}
|
||||
{#if dim2.type === 'axis'}
|
||||
<td>
|
||||
<td class="p-0">
|
||||
{#each dim2.children as dim3}
|
||||
<TableHolder value={dim3} score={undefined}></TableHolder>
|
||||
{/each}
|
||||
|
||||
@@ -6,14 +6,14 @@
|
||||
export let score: AxisScore | undefined;
|
||||
</script>
|
||||
|
||||
<div class="m-1 border box-border inline-block">
|
||||
<div class="border box-border inline-block">
|
||||
<div class="text-center font-bold">
|
||||
{value.value}
|
||||
{#if score}
|
||||
<Score score={score.score} />
|
||||
{/if}
|
||||
{value.value}
|
||||
</div>
|
||||
<div class="flex justify-around my-1">
|
||||
<div class="flex justify-around">
|
||||
{#each value.children as item}
|
||||
<TableHolder value={item} {score} />
|
||||
{/each}
|
||||
|
||||
@@ -95,12 +95,14 @@
|
||||
</script>
|
||||
|
||||
<div class="px-0.5 box-border inline-block relative" style={`width:${width}px`}>
|
||||
<img
|
||||
class="w-full"
|
||||
src={value.src}
|
||||
alt={value.uuid}
|
||||
style={`width:${width}px`}
|
||||
/>
|
||||
<a href={value.src} target="_blank">
|
||||
<img
|
||||
class="w-full"
|
||||
src={value.src}
|
||||
alt={value.uuid}
|
||||
style={`width:${width}px`}
|
||||
/>
|
||||
</a>
|
||||
{#if _mode === TableMode.Score}
|
||||
<button
|
||||
class="absolute w-full h-full top-0 left-0 flex justify-end items-end p-1"
|
||||
|
||||
@@ -31,22 +31,26 @@
|
||||
class="overflow-x-auto max-w-full inline-block"
|
||||
style={`max-height: ${height}px`}
|
||||
>
|
||||
<table class="table table-xs table-pin-rows table-pin-cols table-zebra-grey">
|
||||
<table class="table table-sm table-pin-rows table-pin-cols">
|
||||
<thead>
|
||||
<tr>
|
||||
<tr class="p-0">
|
||||
<th></th>
|
||||
{#if headScore}
|
||||
{#each zip(payload.result[0].children, headScore) as [axis, score]}
|
||||
{#if axis.type === 'axis'}
|
||||
<td class="text-wrap">
|
||||
{axis.value}<Score score={score.score} />
|
||||
<td class="p-0">
|
||||
<p class="max-h-16 text-wrap overflow-auto hover:overflow-y-scroll">
|
||||
<Score score={score.score} />{axis.value}
|
||||
</p>
|
||||
</td>
|
||||
{/if}
|
||||
{/each}
|
||||
{:else}
|
||||
{#each payload.result[0].children as axis}
|
||||
{#if axis.type === 'axis'}
|
||||
<td class="text-wrap">{axis.value}</td>
|
||||
<td class="p-0">
|
||||
<p class="max-h-12 text-wrap overflow-auto hover:overflow-y-scroll">{axis.value}</p>
|
||||
</td>
|
||||
{/if}
|
||||
{/each}
|
||||
{/if}
|
||||
|
||||
@@ -311,6 +311,14 @@
|
||||
{/each}
|
||||
</ul>
|
||||
|
||||
<div class="flex justify-center">
|
||||
{#if files.length > showCursor}
|
||||
<button on:click={() => showCursor += 10} class="btn btn-neutral btn-outline">Load more</button>
|
||||
{:else}
|
||||
<p class="text-neutral-content">No more content.</p>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
{#if files.length === 0}
|
||||
<div class="w-full h-full flex items-center justify-center">
|
||||
<span class="font-bold text-4xl">
|
||||
|
||||
@@ -184,6 +184,14 @@
|
||||
{/each}
|
||||
</div>
|
||||
|
||||
<div class="flex justify-center">
|
||||
{#if files.length > showCursor}
|
||||
<button on:click={() => showCursor += 10} class="btn btn-neutral btn-outline">Load more</button>
|
||||
{:else}
|
||||
<p class="text-neutral-content">No more content.</p>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
{#if files.length === 0}
|
||||
<div class="w-full h-full flex items-center justify-center">
|
||||
<span class="font-bold text-4xl">
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
<div slot="title">
|
||||
XYZ Plot
|
||||
<div
|
||||
class="tooltip tooltip-bottom z-10 before:whitespace-pre-wrap"
|
||||
class="tooltip before:pl-20 before:text-left before:max-w-96 tooltip-bottom z-40 before:whitespace-pre-wrap"
|
||||
data-tip={payload.annotations
|
||||
.map((d) => `${d.axis}: ${d.key} - ${d.type}`)
|
||||
.join('\n')}
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
import functools
|
||||
import json
|
||||
from os import path, scandir, mkdir
|
||||
from os import path, scandir, makedirs
|
||||
import subprocess
|
||||
import time
|
||||
from typing import TypedDict, List
|
||||
import requests
|
||||
from requests.adapters import HTTPAdapter, Retry
|
||||
|
||||
import folder_paths
|
||||
from comfy.cli_args import args
|
||||
@@ -13,18 +16,7 @@ if ':' in args.listen:
|
||||
SERVER_BASE_URL = f'http://[{args.listen}]:{args.port}'
|
||||
|
||||
browser_path = path.dirname(__file__)
|
||||
collections_path = path.join(browser_path, 'collections')
|
||||
config_path = path.join(browser_path, 'config.json')
|
||||
sources_path = path.join(browser_path, 'sources')
|
||||
download_logs_path = path.join(browser_path, 'download_logs')
|
||||
outputs_path = folder_paths.get_output_directory()
|
||||
if args.output_directory:
|
||||
outputs_path = path.abspath(args.output_directory)
|
||||
|
||||
for dir in [collections_path, sources_path, download_logs_path, outputs_path]:
|
||||
if not path.exists(dir):
|
||||
mkdir(dir)
|
||||
|
||||
|
||||
image_extensions = ['.jpg', '.jpeg', '.png', '.gif', '.webp']
|
||||
video_extensions = ['.mp4', '.mov', '.avi', '.webm', '.mkv']
|
||||
@@ -34,6 +26,48 @@ info_file_suffix = '.info'
|
||||
|
||||
git_remote_name = 'origin'
|
||||
|
||||
def http_client():
|
||||
adapter = HTTPAdapter(max_retries=Retry(3, backoff_factor=0.1))
|
||||
http = requests.session()
|
||||
http.mount('http://', adapter)
|
||||
http.mount('https://', adapter)
|
||||
|
||||
return http
|
||||
|
||||
|
||||
@functools.cache
|
||||
def get_config():
|
||||
return {
|
||||
"collections": path.join(browser_path, 'collections'),
|
||||
"download_logs": path.join(browser_path, 'download_logs'),
|
||||
"outputs": output_directory_from_comfyui(),
|
||||
"sources": path.join(browser_path, 'sources'),
|
||||
} | load_config()
|
||||
|
||||
def load_config():
|
||||
if not path.exists(config_path):
|
||||
return {}
|
||||
else:
|
||||
with open(config_path, 'r') as f:
|
||||
return json.load(f)
|
||||
|
||||
@functools.cache
|
||||
def collections_path():
|
||||
return get_config()['collections']
|
||||
|
||||
@functools.cache
|
||||
def download_logs_path():
|
||||
return get_config()['download_logs']
|
||||
|
||||
@functools.cache
|
||||
def outputs_path():
|
||||
return get_config()['outputs']
|
||||
|
||||
@functools.cache
|
||||
def sources_path():
|
||||
return get_config()['sources']
|
||||
|
||||
|
||||
class FileInfoDict(TypedDict):
|
||||
type: str
|
||||
name: str
|
||||
@@ -70,12 +104,12 @@ def run_cmd(cmd, run_path, log_cmd=True, log_code=True, log_message=True):
|
||||
# folder_type = 'outputs', 'collections', 'sources'
|
||||
def get_parent_path(folder_type: str):
|
||||
if folder_type == 'collections':
|
||||
return collections_path
|
||||
return collections_path()
|
||||
if folder_type == 'sources':
|
||||
return sources_path
|
||||
return sources_path()
|
||||
|
||||
# outputs
|
||||
return outputs_path
|
||||
return outputs_path()
|
||||
|
||||
# folder_type = 'outputs', 'collections', 'sources'
|
||||
def get_target_folder_files(folder_path: str, folder_type: str = 'outputs'):
|
||||
@@ -138,29 +172,36 @@ def add_uuid_to_filename(filename):
|
||||
name, ext = path.splitext(filename)
|
||||
return f'{name}_{int(time.time())}{ext}'
|
||||
|
||||
def get_config():
|
||||
if not path.exists(config_path):
|
||||
return {}
|
||||
def output_directory_from_comfyui():
|
||||
if args.output_directory:
|
||||
return path.abspath(args.output_directory)
|
||||
else:
|
||||
return folder_paths.get_output_directory()
|
||||
|
||||
with open(config_path, 'r') as f:
|
||||
return json.load(f)
|
||||
def git_init():
|
||||
if not path.exists(path.join(collections_path(), '.git')):
|
||||
run_cmd('git init', collections_path())
|
||||
|
||||
def git_init(run_path = collections_path):
|
||||
if not path.exists(path.join(run_path, '.git')):
|
||||
run_cmd('git init', collections_path)
|
||||
|
||||
ret = run_cmd('git config user.name', collections_path,
|
||||
ret = run_cmd('git config user.name', collections_path(),
|
||||
log_cmd=False, log_code=False, log_message=False)
|
||||
if len(ret.stdout) == 0:
|
||||
ret = run_cmd('whoami', collections_path,
|
||||
ret = run_cmd('whoami', collections_path(),
|
||||
log_cmd=False, log_code=False, log_message=False)
|
||||
username = ret.stdout.rstrip("\n")
|
||||
run_cmd(f'git config user.name "{username}"', collections_path)
|
||||
run_cmd(f'git config user.name "{username}"', collections_path())
|
||||
|
||||
ret = run_cmd('git config user.email', collections_path,
|
||||
ret = run_cmd('git config user.email', collections_path(),
|
||||
log_cmd=False, log_code=False, log_message=False)
|
||||
if len(ret.stdout) == 0:
|
||||
ret = run_cmd('hostname', collections_path,
|
||||
ret = run_cmd('hostname', collections_path(),
|
||||
log_cmd=False, log_code=False, log_message=False)
|
||||
hostname = ret.stdout.rstrip("\n")
|
||||
run_cmd(f'git config user.email "{hostname}"', collections_path)
|
||||
run_cmd(f'git config user.email "{hostname}"', collections_path())
|
||||
|
||||
for dir in [
|
||||
collections_path(),
|
||||
sources_path(),
|
||||
download_logs_path(),
|
||||
outputs_path(),
|
||||
]:
|
||||
makedirs(dir, exist_ok=True)
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
import{n as f,l as w,r as m,s as q,k as x}from"./scheduler.Tg1fnMp_.js";const a=[];function z(e,i){return{subscribe:A(e,i).subscribe}}function A(e,i=f){let r;const n=new Set;function u(t){if(q(e,t)&&(e=t,r)){const o=!a.length;for(const s of n)s[1](),a.push(s,e);if(o){for(let s=0;s<a.length;s+=2)a[s][0](a[s+1]);a.length=0}}}function l(t){u(t(e))}function b(t,o=f){const s=[t,o];return n.add(s),n.size===1&&(r=i(u,l)||f),t(e),()=>{n.delete(s),n.size===0&&r&&(r(),r=null)}}return{set:u,update:l,subscribe:b}}function B(e,i,r){const n=!Array.isArray(e),u=n?[e]:e;if(!u.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const l=i.length<2;return z(r,(b,t)=>{let o=!1;const s=[];let d=0,p=f;const h=()=>{if(d)return;p();const c=i(n?s[0]:s,b,t);l?b(c):p=x(c)?c:f},y=u.map((c,g)=>w(c,_=>{s[g]=_,d&=~(1<<g),o&&h()},()=>{d|=1<<g}));return o=!0,h(),function(){m(y),p(),o=!1}})}export{B as d,A as w};
|
||||
import{n as f,l as w,r as m,s as q,k as x}from"./scheduler.DD_VFgMU.js";const a=[];function z(e,i){return{subscribe:A(e,i).subscribe}}function A(e,i=f){let r;const n=new Set;function u(t){if(q(e,t)&&(e=t,r)){const o=!a.length;for(const s of n)s[1](),a.push(s,e);if(o){for(let s=0;s<a.length;s+=2)a[s][0](a[s+1]);a.length=0}}}function l(t){u(t(e))}function b(t,o=f){const s=[t,o];return n.add(s),n.size===1&&(r=i(u,l)||f),t(e),()=>{n.delete(s),n.size===0&&r&&(r(),r=null)}}return{set:u,update:l,subscribe:b}}function B(e,i,r){const n=!Array.isArray(e),u=n?[e]:e;if(!u.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const l=i.length<2;return z(r,(b,t)=>{let o=!1;const s=[];let d=0,p=f;const h=()=>{if(d)return;p();const c=i(n?s[0]:s,b,t);l?b(c):p=x(c)?c:f},y=u.map((c,g)=>w(c,_=>{s[g]=_,d&=~(1<<g),o&&h()},()=>{d|=1<<g}));return o=!0,h(),function(){m(y),p(),o=!1}})}export{B as d,A as w};
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
const d="modulepreload",m=function(a,l){return new URL(a,l).href},f={},E=function(l,i,c){let u=Promise.resolve();if(i&&i.length>0){const n=document.getElementsByTagName("link");u=Promise.all(i.map(e=>{if(e=m(e,c),e in f)return;f[e]=!0;const r=e.endsWith(".css"),h=r?'[rel="stylesheet"]':"";if(!!c)for(let s=n.length-1;s>=0;s--){const o=n[s];if(o.href===e&&(!r||o.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${e}"]${h}`))return;const t=document.createElement("link");if(t.rel=r?"stylesheet":d,r||(t.as="script",t.crossOrigin=""),t.href=e,document.head.appendChild(t),r)return new Promise((s,o)=>{t.addEventListener("load",s),t.addEventListener("error",()=>o(new Error(`Unable to preload CSS for ${e}`)))})}))}return u.then(()=>l()).catch(n=>{const e=new Event("vite:preloadError",{cancelable:!0});if(e.payload=n,window.dispatchEvent(e),!e.defaultPrevented)throw n})};export{E as _};
|
||||
@@ -0,0 +1 @@
|
||||
const v="modulepreload",y=function(a,i){return new URL(a,i).href},d={},p=function(i,l,u){let f=Promise.resolve();if(l&&l.length>0){const r=document.getElementsByTagName("link"),n=document.querySelector("meta[property=csp-nonce]"),h=n?.nonce||n?.getAttribute("nonce");f=Promise.all(l.map(e=>{if(e=y(e,u),e in d)return;d[e]=!0;const s=e.endsWith(".css"),m=s?'[rel="stylesheet"]':"";if(!!u)for(let o=r.length-1;o>=0;o--){const c=r[o];if(c.href===e&&(!s||c.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${e}"]${m}`))return;const t=document.createElement("link");if(t.rel=s?"stylesheet":v,s||(t.as="script",t.crossOrigin=""),t.href=e,h&&t.setAttribute("nonce",h),document.head.appendChild(t),s)return new Promise((o,c)=>{t.addEventListener("load",o),t.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${e}`)))})}))}return f.then(()=>i()).catch(r=>{const n=new Event("vite:preloadError",{cancelable:!0});if(n.payload=r,window.dispatchEvent(n),!n.defaultPrevented)throw r})};export{p as _};
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
import{w as u}from"./index.BlOrB6Vx.js";const b=globalThis.__sveltekit_sim1g4?.base??"",v=globalThis.__sveltekit_sim1g4?.assets??b,k="1714203421307",R="sveltekit:snapshot",T="sveltekit:scroll",w="sveltekit:states",I="sveltekit:pageurl",S="sveltekit:history",y="sveltekit:navigation",f={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},_=location.origin;function N(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){const n=document.getElementsByTagName("base");t=n.length?n[0].href:document.URL}return new URL(e,t)}function U(){return{x:pageXOffset,y:pageYOffset}}function c(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const d={...f,"":f.hover};function g(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function L(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=g(e)}}function O(e,t){let n;try{n=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI)}catch{}const a=e instanceof SVGAElement?e.target.baseVal:e.target,r=!n||!!a||E(n,t)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),l=n?.origin===_&&e.hasAttribute("download");return{url:n,external:r,target:a,download:l}}function Y(e){let t=null,n=null,a=null,r=null,l=null,o=null,s=e;for(;s&&s!==document.documentElement;)a===null&&(a=c(s,"preload-code")),r===null&&(r=c(s,"preload-data")),t===null&&(t=c(s,"keepfocus")),n===null&&(n=c(s,"noscroll")),l===null&&(l=c(s,"reload")),o===null&&(o=c(s,"replacestate")),s=g(s);function i(h){switch(h){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:d[a??"off"],preload_data:d[r??"off"],keepfocus:i(t),noscroll:i(n),reload:i(l),replace_state:i(o)}}function p(e){const t=u(e);let n=!0;function a(){n=!0,t.update(o=>o)}function r(o){n=!1,t.set(o)}function l(o){let s;return t.subscribe(i=>{(s===void 0||n&&i!==s)&&o(s=i)})}return{notify:a,set:r,subscribe:l}}function m(){const{set:e,subscribe:t}=u(!1);let n;async function a(){clearTimeout(n);try{const r=await fetch(`${v}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!r.ok)return!1;const o=(await r.json()).version!==k;return o&&(e(!0),clearTimeout(n)),o}catch{return!1}}return{subscribe:t,check:a}}function E(e,t){return e.origin!==_||!e.pathname.startsWith(t)}function x(e){e.client}const P={url:p({}),page:p({}),navigating:u(null),updated:m()};export{S as H,y as N,I as P,T as S,w as a,R as b,Y as c,P as d,b as e,L as f,O as g,f as h,E as i,x as j,_ as o,N as r,U as s};
|
||||
@@ -1 +0,0 @@
|
||||
import{w as u}from"./index.Bo7-JXlm.js";const b=globalThis.__sveltekit_19afu?.base??"",v=globalThis.__sveltekit_19afu?.assets??b,k="1711098245920",R="sveltekit:snapshot",T="sveltekit:scroll",w="sveltekit:states",I="sveltekit:pageurl",S="sveltekit:history",y="sveltekit:navigation",f={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},_=location.origin;function N(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){const n=document.getElementsByTagName("base");t=n.length?n[0].href:document.URL}return new URL(e,t)}function U(){return{x:pageXOffset,y:pageYOffset}}function c(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const d={...f,"":f.hover};function g(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function L(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=g(e)}}function O(e,t){let n;try{n=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI)}catch{}const o=e instanceof SVGAElement?e.target.baseVal:e.target,r=!n||!!o||m(n,t)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),l=n?.origin===_&&e.hasAttribute("download");return{url:n,external:r,target:o,download:l}}function Y(e){let t=null,n=null,o=null,r=null,l=null,a=null,s=e;for(;s&&s!==document.documentElement;)o===null&&(o=c(s,"preload-code")),r===null&&(r=c(s,"preload-data")),t===null&&(t=c(s,"keepfocus")),n===null&&(n=c(s,"noscroll")),l===null&&(l=c(s,"reload")),a===null&&(a=c(s,"replacestate")),s=g(s);function i(h){switch(h){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:d[o??"off"],preload_data:d[r??"off"],keepfocus:i(t),noscroll:i(n),reload:i(l),replace_state:i(a)}}function p(e){const t=u(e);let n=!0;function o(){n=!0,t.update(a=>a)}function r(a){n=!1,t.set(a)}function l(a){let s;return t.subscribe(i=>{(s===void 0||n&&i!==s)&&a(s=i)})}return{notify:o,set:r,subscribe:l}}function E(){const{set:e,subscribe:t}=u(!1);let n;async function o(){clearTimeout(n);try{const r=await fetch(`${v}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!r.ok)return!1;const a=(await r.json()).version!==k;return a&&(e(!0),clearTimeout(n)),a}catch{return!1}}return{subscribe:t,check:o}}function m(e,t){return e.origin!==_||!e.pathname.startsWith(t)}function x(e){e.client}const P={url:p({}),page:p({}),navigating:u(null),updated:E()};export{S as H,y as N,I as P,T as S,w as a,R as b,Y as c,P as d,b as e,L as f,O as g,f as h,m as i,x as j,_ as o,N as r,U as s};
|
||||
+2
-7
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
import{_ as c}from"../chunks/preload-helper.Dch09mLN.js";import{r as u,g as n,i as _,$ as f,w as m}from"../chunks/runtime.CA0Siqq1.js";import{s as p,c as g,u as d,g as $,d as L}from"../chunks/scheduler.DD_VFgMU.js";import{S as y,i as S,d as v,t as b}from"../chunks/index.m7aY60kV.js";u("en-US",()=>c(()=>import("../chunks/en-US.3ZgkfkIk.js"),[],import.meta.url));u("zh-CN",()=>c(()=>import("../chunks/zh-CN.BEOSgdra.js"),[],import.meta.url));const r="lang",h="en-US";let i=window.navigator.language;n()&&(i=n());localStorage.getItem(r)&&(i=localStorage.getItem(r));_({fallbackLocale:h,initialLocale:i,handleMissingMessage:o=>o.id.split(".").pop()});f.subscribe(o=>{localStorage.setItem(r,o)});const w=!0;async function I({url:o}){await m();let a="";return typeof process>"u"&&(a=o.searchParams.get("comfyUrl")||""),{comfyUrl:a}}const j=Object.freeze(Object.defineProperty({__proto__:null,load:I,prerender:w},Symbol.toStringTag,{value:"Module"}));function P(o){let a;const s=o[1].default,t=g(s,o,o[0],null);return{c(){t&&t.c()},l(e){t&&t.l(e)},m(e,l){t&&t.m(e,l),a=!0},p(e,[l]){t&&t.p&&(!a||l&1)&&d(t,s,e,e[0],a?L(s,e[0],l,null):$(e[0]),null)},i(e){a||(v(t,e),a=!0)},o(e){b(t,e),a=!1},d(e){t&&t.d(e)}}}function E(o,a,s){let{$$slots:t={},$$scope:e}=a;return o.$$set=l=>{"$$scope"in l&&s(0,e=l.$$scope)},[e,t]}class z extends y{constructor(a){super(),S(this,a,E,P,p,{})}}export{z as component,j as universal};
|
||||
@@ -1,7 +0,0 @@
|
||||
import{_ as c}from"../chunks/preload-helper.0HuHagjb.js";import{r as u,g as n,i as _,$ as f,w as m}from"../chunks/runtime.bOPOS4G5.js";import{s as p,c as g,u as d,g as $,d as L}from"../chunks/scheduler.Tg1fnMp_.js";import{S as y,i as S,d as v,t as b}from"../chunks/index.xa2X6v7V.js";u("en-US",()=>c(()=>import("../chunks/en-US.JAQIzv30.js"),__vite__mapDeps([]),import.meta.url));u("zh-CN",()=>c(()=>import("../chunks/zh-CN.giVTFcLQ.js"),__vite__mapDeps([]),import.meta.url));const r="lang",h="en-US";let i=window.navigator.language;n()&&(i=n());localStorage.getItem(r)&&(i=localStorage.getItem(r));_({fallbackLocale:h,initialLocale:i,handleMissingMessage:o=>o.id.split(".").pop()});f.subscribe(o=>{localStorage.setItem(r,o)});const w=!0;async function I({url:o}){await m();let a="";return typeof process>"u"&&(a=o.searchParams.get("comfyUrl")||""),{comfyUrl:a}}const j=Object.freeze(Object.defineProperty({__proto__:null,load:I,prerender:w},Symbol.toStringTag,{value:"Module"}));function P(o){let a;const s=o[1].default,t=g(s,o,o[0],null);return{c(){t&&t.c()},l(e){t&&t.l(e)},m(e,l){t&&t.m(e,l),a=!0},p(e,[l]){t&&t.p&&(!a||l&1)&&d(t,s,e,e[0],a?L(s,e[0],l,null):$(e[0]),null)},i(e){a||(v(t,e),a=!0)},o(e){b(t,e),a=!1},d(e){t&&t.d(e)}}}function E(o,a,s){let{$$slots:t={},$$scope:e}=a;return o.$$set=l=>{"$$scope"in l&&s(0,e=l.$$scope)},[e,t]}class z extends y{constructor(a){super(),S(this,a,E,P,p,{})}}export{z as component,j as universal};
|
||||
function __vite__mapDeps(indexes) {
|
||||
if (!__vite__mapDeps.viteFileDeps) {
|
||||
__vite__mapDeps.viteFileDeps = []
|
||||
}
|
||||
return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
|
||||
}
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{s as E,n as b,e as x}from"../chunks/scheduler.Tg1fnMp_.js";import{S,i as j,g as _,m as f,s as q,h as d,j as g,n as h,f as p,c as y,a as l,x as v,o as $}from"../chunks/index.xa2X6v7V.js";import{d as C}from"../chunks/singletons.b6n7ppVR.js";const H=()=>{const s=C;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},P={subscribe(s){return H().page.subscribe(s)}};function k(s){let t,r=s[0].status+"",o,n,i,c=s[0].error?.message+"",u;return{c(){t=_("h1"),o=f(r),n=q(),i=_("p"),u=f(c)},l(e){t=d(e,"H1",{});var a=g(t);o=h(a,r),a.forEach(p),n=y(e),i=d(e,"P",{});var m=g(i);u=h(m,c),m.forEach(p)},m(e,a){l(e,t,a),v(t,o),l(e,n,a),l(e,i,a),v(i,u)},p(e,[a]){a&1&&r!==(r=e[0].status+"")&&$(o,r),a&1&&c!==(c=e[0].error?.message+"")&&$(u,c)},i:b,o:b,d(e){e&&(p(t),p(n),p(i))}}}function w(s,t,r){let o;return x(s,P,n=>r(0,o=n)),[o]}let D=class extends S{constructor(t){super(),j(this,t,w,k,E,{})}};export{D as component};
|
||||
import{s as E,n as b,e as x}from"../chunks/scheduler.DD_VFgMU.js";import{S,i as j,g as _,m as f,s as q,h as d,j as g,n as h,f as p,c as y,a as l,x as v,o as $}from"../chunks/index.m7aY60kV.js";import{d as C}from"../chunks/singletons.Bc_UULDX.js";const H=()=>{const s=C;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},P={subscribe(s){return H().page.subscribe(s)}};function k(s){let t,r=s[0].status+"",o,n,i,c=s[0].error?.message+"",u;return{c(){t=_("h1"),o=f(r),n=q(),i=_("p"),u=f(c)},l(e){t=d(e,"H1",{});var a=g(t);o=h(a,r),a.forEach(p),n=y(e),i=d(e,"P",{});var m=g(i);u=h(m,c),m.forEach(p)},m(e,a){l(e,t,a),v(t,o),l(e,n,a),l(e,i,a),v(i,u)},p(e,[a]){a&1&&r!==(r=e[0].status+"")&&$(o,r),a&1&&c!==(c=e[0].error?.message+"")&&$(u,c)},i:b,o:b,d(e){e&&(p(t),p(n),p(i))}}}function w(s,t,r){let o;return x(s,P,n=>r(0,o=n)),[o]}let D=class extends S{constructor(t){super(),j(this,t,w,k,E,{})}};export{D as component};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{w as r}from"../chunks/runtime.bOPOS4G5.js";import{s as l,c as i,u,g as f,d as c}from"../chunks/scheduler.Tg1fnMp_.js";import{S as _,i as p,d as m,t as d}from"../chunks/index.xa2X6v7V.js";async function g({url:o}){return await r(),typeof process>"u"?{path:o.searchParams.get("path")}:{}}const v=Object.freeze(Object.defineProperty({__proto__:null,load:g},Symbol.toStringTag,{value:"Module"}));function $(o){let s;const n=o[1].default,e=i(n,o,o[0],null);return{c(){e&&e.c()},l(t){e&&e.l(t)},m(t,a){e&&e.m(t,a),s=!0},p(t,[a]){e&&e.p&&(!s||a&1)&&u(e,n,t,t[0],s?c(n,t[0],a,null):f(t[0]),null)},i(t){s||(m(e,t),s=!0)},o(t){d(e,t),s=!1},d(t){e&&e.d(t)}}}function h(o,s,n){let{$$slots:e={},$$scope:t}=s;return o.$$set=a=>{"$$scope"in a&&n(0,t=a.$$scope)},[t,e]}class w extends _{constructor(s){super(),p(this,s,h,$,l,{})}}export{w as component,v as universal};
|
||||
import{w as r}from"../chunks/runtime.CA0Siqq1.js";import{s as l,c as i,u,g as f,d as c}from"../chunks/scheduler.DD_VFgMU.js";import{S as _,i as p,d as m,t as d}from"../chunks/index.m7aY60kV.js";async function g({url:o}){return await r(),typeof process>"u"?{path:o.searchParams.get("path")}:{}}const v=Object.freeze(Object.defineProperty({__proto__:null,load:g},Symbol.toStringTag,{value:"Module"}));function $(o){let s;const n=o[1].default,e=i(n,o,o[0],null);return{c(){e&&e.c()},l(t){e&&e.l(t)},m(t,a){e&&e.m(t,a),s=!0},p(t,[a]){e&&e.p&&(!s||a&1)&&u(e,n,t,t[0],s?c(n,t[0],a,null):f(t[0]),null)},i(t){s||(m(e,t),s=!0)},o(t){d(e,t),s=!1},d(t){e&&e.d(t)}}}function h(o,s,n){let{$$slots:e={},$$scope:t}=s;return o.$$set=a=>{"$$scope"in a&&n(0,t=a.$$scope)},[t,e]}class w extends _{constructor(s){super(),p(this,s,h,$,l,{})}}export{w as component,v as universal};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+10
-10
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
{"version":"1711098245920"}
|
||||
{"version":"1714203421307"}
|
||||
+17
-17
File diff suppressed because one or more lines are too long
+17
-17
@@ -5,27 +5,27 @@
|
||||
<link rel="icon" href="./favicon.png" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
|
||||
<link href="./_app/immutable/assets/0.sGZW4pel.css" rel="stylesheet">
|
||||
<link rel="modulepreload" href="./_app/immutable/entry/start.WorQkyMw.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/chunks/scheduler.Tg1fnMp_.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/chunks/singletons.b6n7ppVR.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/chunks/index.Bo7-JXlm.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/entry/app.qKAh-8tw.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/chunks/preload-helper.0HuHagjb.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/chunks/index.xa2X6v7V.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/nodes/0.DDyQKHBy.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/chunks/runtime.bOPOS4G5.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/chunks/_commonjsHelpers.5-cIlDoe.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/nodes/2.R9w-bO9C.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/nodes/4.L8Hmv_u7.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/chunks/each.-oqiv04n.js">
|
||||
<link href="./_app/immutable/assets/0.yjAznyz0.css" rel="stylesheet">
|
||||
<link rel="modulepreload" href="./_app/immutable/entry/start.BUrJroT3.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/chunks/scheduler.DD_VFgMU.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/chunks/singletons.Bc_UULDX.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/chunks/index.BlOrB6Vx.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/entry/app.D5ml1A7d.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/chunks/preload-helper.Dch09mLN.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/chunks/index.m7aY60kV.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/nodes/0.BLschTxR.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/chunks/runtime.CA0Siqq1.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/chunks/_commonjsHelpers.Cpj98o6Y.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/nodes/2.-Y4AVwMq.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/nodes/4.DteQa3LM.js">
|
||||
<link rel="modulepreload" href="./_app/immutable/chunks/each.-gASlQSi.js">
|
||||
</head>
|
||||
<body data-sveltekit-preload-data="hover">
|
||||
<div style="display: contents"> Invalid Path
|
||||
|
||||
<script>
|
||||
{
|
||||
__sveltekit_19afu = {
|
||||
__sveltekit_sim1g4 = {
|
||||
base: new URL(".", location).pathname.slice(0, -1),
|
||||
env: null
|
||||
};
|
||||
@@ -35,8 +35,8 @@
|
||||
const data = [null,null,null];
|
||||
|
||||
Promise.all([
|
||||
import("./_app/immutable/entry/start.WorQkyMw.js"),
|
||||
import("./_app/immutable/entry/app.qKAh-8tw.js")
|
||||
import("./_app/immutable/entry/start.BUrJroT3.js"),
|
||||
import("./_app/immutable/entry/app.D5ml1A7d.js")
|
||||
]).then(([kit, app]) => {
|
||||
kit.start(app, element, {
|
||||
node_ids: [0, 2, 4],
|
||||
|
||||
@@ -32,14 +32,21 @@ function refreshPreview(node) {
|
||||
|
||||
function refreshInputs(node, app) {
|
||||
const inputs = getGraphInputs(app.graph);
|
||||
node.widgets.forEach(w => {
|
||||
|
||||
let index = -1;
|
||||
for (const w of node.widgets) {
|
||||
index += 1;
|
||||
if (w.type != 'combo') {
|
||||
return;
|
||||
}
|
||||
|
||||
w.options.values = inputs;
|
||||
w.value = inputs[0];
|
||||
});
|
||||
if (node.widgets_values) {
|
||||
w.value = node.widgets_values[index]
|
||||
} else {
|
||||
w.value = inputs[0];
|
||||
}
|
||||
}
|
||||
const size = node.computeSize();
|
||||
node.setSize([size[0] * 1.5, size[1]]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user