Compare commits
2 Commits
base-path-
...
model_mana
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fde9fdddff | ||
|
|
7bf381bc9e |
2
.github/workflows/test-build.yml
vendored
2
.github/workflows/test-build.yml
vendored
@@ -18,7 +18,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
python-version: ["3.9", "3.10", "3.11", "3.12"]
|
||||
python-version: ["3.8", "3.9", "3.10", "3.11"]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
# Python web server
|
||||
/api_server/ @yoland68 @robinjhuang @huchenlei @webfiltered @pythongosssss @ltdrdata
|
||||
/app/ @yoland68 @robinjhuang @huchenlei @webfiltered @pythongosssss @ltdrdata
|
||||
/utils/ @yoland68 @robinjhuang @huchenlei @webfiltered @pythongosssss @ltdrdata
|
||||
|
||||
# Frontend assets
|
||||
/web/ @huchenlei @webfiltered @pythongosssss @yoland68 @robinjhuang
|
||||
|
||||
@@ -52,7 +52,6 @@ This ui will let you design and execute advanced stable diffusion pipelines usin
|
||||
- [Mochi](https://comfyanonymous.github.io/ComfyUI_examples/mochi/)
|
||||
- [LTX-Video](https://comfyanonymous.github.io/ComfyUI_examples/ltxv/)
|
||||
- [Hunyuan Video](https://comfyanonymous.github.io/ComfyUI_examples/hunyuan_video/)
|
||||
- [Nvidia Cosmos](https://comfyanonymous.github.io/ComfyUI_examples/cosmos/)
|
||||
- [Stable Audio](https://comfyanonymous.github.io/ComfyUI_examples/audio/)
|
||||
- Asynchronous Queue system
|
||||
- Many optimizations: Only re-executes the parts of the workflow that changes between executions.
|
||||
|
||||
119
alembic.ini
Normal file
119
alembic.ini
Normal file
@@ -0,0 +1,119 @@
|
||||
# A generic, single database configuration.
|
||||
|
||||
[alembic]
|
||||
# path to migration scripts
|
||||
# Use forward slashes (/) also on windows to provide an os agnostic path
|
||||
script_location = alembic_db
|
||||
|
||||
# template used to generate migration file names; The default value is %%(rev)s_%%(slug)s
|
||||
# Uncomment the line below if you want the files to be prepended with date and time
|
||||
# see https://alembic.sqlalchemy.org/en/latest/tutorial.html#editing-the-ini-file
|
||||
# for all available tokens
|
||||
# file_template = %%(year)d_%%(month).2d_%%(day).2d_%%(hour).2d%%(minute).2d-%%(rev)s_%%(slug)s
|
||||
|
||||
# sys.path path, will be prepended to sys.path if present.
|
||||
# defaults to the current working directory.
|
||||
prepend_sys_path = .
|
||||
|
||||
# timezone to use when rendering the date within the migration file
|
||||
# as well as the filename.
|
||||
# If specified, requires the python>=3.9 or backports.zoneinfo library and tzdata library.
|
||||
# Any required deps can installed by adding `alembic[tz]` to the pip requirements
|
||||
# string value is passed to ZoneInfo()
|
||||
# leave blank for localtime
|
||||
# timezone =
|
||||
|
||||
# max length of characters to apply to the "slug" field
|
||||
# truncate_slug_length = 40
|
||||
|
||||
# set to 'true' to run the environment during
|
||||
# the 'revision' command, regardless of autogenerate
|
||||
# revision_environment = false
|
||||
|
||||
# set to 'true' to allow .pyc and .pyo files without
|
||||
# a source .py file to be detected as revisions in the
|
||||
# versions/ directory
|
||||
# sourceless = false
|
||||
|
||||
# version location specification; This defaults
|
||||
# to alembic_db/versions. When using multiple version
|
||||
# directories, initial revisions must be specified with --version-path.
|
||||
# The path separator used here should be the separator specified by "version_path_separator" below.
|
||||
# version_locations = %(here)s/bar:%(here)s/bat:alembic_db/versions
|
||||
|
||||
# version path separator; As mentioned above, this is the character used to split
|
||||
# version_locations. The default within new alembic.ini files is "os", which uses os.pathsep.
|
||||
# If this key is omitted entirely, it falls back to the legacy behavior of splitting on spaces and/or commas.
|
||||
# Valid values for version_path_separator are:
|
||||
#
|
||||
# version_path_separator = :
|
||||
# version_path_separator = ;
|
||||
# version_path_separator = space
|
||||
# version_path_separator = newline
|
||||
#
|
||||
# Use os.pathsep. Default configuration used for new projects.
|
||||
version_path_separator = os
|
||||
|
||||
# set to 'true' to search source files recursively
|
||||
# in each "version_locations" directory
|
||||
# new in Alembic version 1.10
|
||||
# recursive_version_locations = false
|
||||
|
||||
# the output encoding used when revision files
|
||||
# are written from script.py.mako
|
||||
# output_encoding = utf-8
|
||||
|
||||
sqlalchemy.url = sqlite:///user/comfyui.db
|
||||
|
||||
|
||||
[post_write_hooks]
|
||||
# post_write_hooks defines scripts or Python functions that are run
|
||||
# on newly generated revision scripts. See the documentation for further
|
||||
# detail and examples
|
||||
|
||||
# format using "black" - use the console_scripts runner, against the "black" entrypoint
|
||||
# hooks = black
|
||||
# black.type = console_scripts
|
||||
# black.entrypoint = black
|
||||
# black.options = -l 79 REVISION_SCRIPT_FILENAME
|
||||
|
||||
# lint with attempts to fix using "ruff" - use the exec runner, execute a binary
|
||||
# hooks = ruff
|
||||
# ruff.type = exec
|
||||
# ruff.executable = %(here)s/.venv/bin/ruff
|
||||
# ruff.options = check --fix REVISION_SCRIPT_FILENAME
|
||||
|
||||
# Logging configuration
|
||||
[loggers]
|
||||
keys = root,sqlalchemy,alembic
|
||||
|
||||
[handlers]
|
||||
keys = console
|
||||
|
||||
[formatters]
|
||||
keys = generic
|
||||
|
||||
[logger_root]
|
||||
level = WARNING
|
||||
handlers = console
|
||||
qualname =
|
||||
|
||||
[logger_sqlalchemy]
|
||||
level = WARNING
|
||||
handlers =
|
||||
qualname = sqlalchemy.engine
|
||||
|
||||
[logger_alembic]
|
||||
level = INFO
|
||||
handlers =
|
||||
qualname = alembic
|
||||
|
||||
[handler_console]
|
||||
class = StreamHandler
|
||||
args = (sys.stderr,)
|
||||
level = NOTSET
|
||||
formatter = generic
|
||||
|
||||
[formatter_generic]
|
||||
format = %(levelname)-5.5s [%(name)s] %(message)s
|
||||
datefmt = %H:%M:%S
|
||||
3
alembic_db/README.md
Normal file
3
alembic_db/README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## Generate new revision
|
||||
1. Update models in `/app/database/models.py`
|
||||
2. Run `alembic revision --autogenerate -m "{your message}"`
|
||||
75
alembic_db/env.py
Normal file
75
alembic_db/env.py
Normal file
@@ -0,0 +1,75 @@
|
||||
from logging.config import fileConfig
|
||||
|
||||
from sqlalchemy import engine_from_config
|
||||
from sqlalchemy import pool
|
||||
|
||||
from alembic import context
|
||||
|
||||
# this is the Alembic Config object, which provides
|
||||
# access to the values within the .ini file in use.
|
||||
config = context.config
|
||||
|
||||
# Interpret the config file for Python logging.
|
||||
# This line sets up loggers basically.
|
||||
if config.config_file_name is not None:
|
||||
fileConfig(config.config_file_name)
|
||||
|
||||
from app.database.models import Base
|
||||
target_metadata = Base.metadata
|
||||
|
||||
# other values from the config, defined by the needs of env.py,
|
||||
# can be acquired:
|
||||
# my_important_option = config.get_main_option("my_important_option")
|
||||
# ... etc.
|
||||
|
||||
|
||||
def run_migrations_offline() -> None:
|
||||
"""Run migrations in 'offline' mode.
|
||||
|
||||
This configures the context with just a URL
|
||||
and not an Engine, though an Engine is acceptable
|
||||
here as well. By skipping the Engine creation
|
||||
we don't even need a DBAPI to be available.
|
||||
|
||||
Calls to context.execute() here emit the given string to the
|
||||
script output.
|
||||
|
||||
"""
|
||||
url = config.get_main_option("sqlalchemy.url")
|
||||
context.configure(
|
||||
url=url,
|
||||
target_metadata=target_metadata,
|
||||
literal_binds=True,
|
||||
dialect_opts={"paramstyle": "named"},
|
||||
)
|
||||
|
||||
with context.begin_transaction():
|
||||
context.run_migrations()
|
||||
|
||||
|
||||
def run_migrations_online() -> None:
|
||||
"""Run migrations in 'online' mode.
|
||||
|
||||
In this scenario we need to create an Engine
|
||||
and associate a connection with the context.
|
||||
|
||||
"""
|
||||
connectable = engine_from_config(
|
||||
config.get_section(config.config_ini_section, {}),
|
||||
prefix="sqlalchemy.",
|
||||
poolclass=pool.NullPool,
|
||||
)
|
||||
|
||||
with connectable.connect() as connection:
|
||||
context.configure(
|
||||
connection=connection, target_metadata=target_metadata
|
||||
)
|
||||
|
||||
with context.begin_transaction():
|
||||
context.run_migrations()
|
||||
|
||||
|
||||
if context.is_offline_mode():
|
||||
run_migrations_offline()
|
||||
else:
|
||||
run_migrations_online()
|
||||
28
alembic_db/script.py.mako
Normal file
28
alembic_db/script.py.mako
Normal file
@@ -0,0 +1,28 @@
|
||||
"""${message}
|
||||
|
||||
Revision ID: ${up_revision}
|
||||
Revises: ${down_revision | comma,n}
|
||||
Create Date: ${create_date}
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
${imports if imports else ""}
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = ${repr(up_revision)}
|
||||
down_revision: Union[str, None] = ${repr(down_revision)}
|
||||
branch_labels: Union[str, Sequence[str], None] = ${repr(branch_labels)}
|
||||
depends_on: Union[str, Sequence[str], None] = ${repr(depends_on)}
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
"""Upgrade schema."""
|
||||
${upgrades if upgrades else "pass"}
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
"""Downgrade schema."""
|
||||
${downgrades if downgrades else "pass"}
|
||||
58
alembic_db/versions/2fb22c4fff36_init.py
Normal file
58
alembic_db/versions/2fb22c4fff36_init.py
Normal file
@@ -0,0 +1,58 @@
|
||||
"""init
|
||||
|
||||
Revision ID: 2fb22c4fff36
|
||||
Revises:
|
||||
Create Date: 2025-03-27 19:00:47.686079
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = '2fb22c4fff36'
|
||||
down_revision: Union[str, None] = None
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
"""Upgrade schema."""
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('model',
|
||||
sa.Column('type', sa.Text(), nullable=False),
|
||||
sa.Column('path', sa.Text(), nullable=False),
|
||||
sa.Column('title', sa.Text(), nullable=True),
|
||||
sa.Column('description', sa.Text(), nullable=True),
|
||||
sa.Column('architecture', sa.Text(), nullable=True),
|
||||
sa.Column('hash', sa.Text(), nullable=True),
|
||||
sa.Column('source_url', sa.Text(), nullable=True),
|
||||
sa.Column('date_added', sa.DateTime(), server_default=sa.text('(CURRENT_TIMESTAMP)'), nullable=True),
|
||||
sa.PrimaryKeyConstraint('type', 'path')
|
||||
)
|
||||
op.create_table('tag',
|
||||
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
|
||||
sa.Column('name', sa.Text(), nullable=False),
|
||||
sa.PrimaryKeyConstraint('id'),
|
||||
sa.UniqueConstraint('name')
|
||||
)
|
||||
op.create_table('model_tag',
|
||||
sa.Column('model_type', sa.Text(), nullable=False),
|
||||
sa.Column('model_path', sa.Text(), nullable=False),
|
||||
sa.Column('tag_id', sa.Integer(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['model_type', 'model_path'], ['model.type', 'model.path'], ondelete='CASCADE'),
|
||||
sa.ForeignKeyConstraint(['tag_id'], ['tag.id'], ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('model_type', 'model_path', 'tag_id')
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
"""Downgrade schema."""
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('model_tag')
|
||||
op.drop_table('tag')
|
||||
op.drop_table('model')
|
||||
# ### end Alembic commands ###
|
||||
@@ -4,93 +4,12 @@ import os
|
||||
import folder_paths
|
||||
import glob
|
||||
from aiohttp import web
|
||||
import json
|
||||
import logging
|
||||
from functools import lru_cache
|
||||
|
||||
from utils.json_util import merge_json_recursive
|
||||
|
||||
|
||||
# Extra locale files to load into main.json
|
||||
EXTRA_LOCALE_FILES = [
|
||||
"nodeDefs.json",
|
||||
"commands.json",
|
||||
"settings.json",
|
||||
]
|
||||
|
||||
|
||||
def safe_load_json_file(file_path: str) -> dict:
|
||||
if not os.path.exists(file_path):
|
||||
return {}
|
||||
|
||||
try:
|
||||
with open(file_path, "r", encoding="utf-8") as f:
|
||||
return json.load(f)
|
||||
except json.JSONDecodeError:
|
||||
logging.error(f"Error loading {file_path}")
|
||||
return {}
|
||||
|
||||
|
||||
class CustomNodeManager:
|
||||
@lru_cache(maxsize=1)
|
||||
def build_translations(self):
|
||||
"""Load all custom nodes translations during initialization. Translations are
|
||||
expected to be loaded from `locales/` folder.
|
||||
|
||||
The folder structure is expected to be the following:
|
||||
- custom_nodes/
|
||||
- custom_node_1/
|
||||
- locales/
|
||||
- en/
|
||||
- main.json
|
||||
- commands.json
|
||||
- settings.json
|
||||
|
||||
returned translations are expected to be in the following format:
|
||||
{
|
||||
"en": {
|
||||
"nodeDefs": {...},
|
||||
"commands": {...},
|
||||
"settings": {...},
|
||||
...{other main.json keys}
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
translations = {}
|
||||
|
||||
for folder in folder_paths.get_folder_paths("custom_nodes"):
|
||||
# Sort glob results for deterministic ordering
|
||||
for custom_node_dir in sorted(glob.glob(os.path.join(folder, "*/"))):
|
||||
locales_dir = os.path.join(custom_node_dir, "locales")
|
||||
if not os.path.exists(locales_dir):
|
||||
continue
|
||||
|
||||
for lang_dir in glob.glob(os.path.join(locales_dir, "*/")):
|
||||
lang_code = os.path.basename(os.path.dirname(lang_dir))
|
||||
|
||||
if lang_code not in translations:
|
||||
translations[lang_code] = {}
|
||||
|
||||
# Load main.json
|
||||
main_file = os.path.join(lang_dir, "main.json")
|
||||
node_translations = safe_load_json_file(main_file)
|
||||
|
||||
# Load extra locale files
|
||||
for extra_file in EXTRA_LOCALE_FILES:
|
||||
extra_file_path = os.path.join(lang_dir, extra_file)
|
||||
key = extra_file.split(".")[0]
|
||||
json_data = safe_load_json_file(extra_file_path)
|
||||
if json_data:
|
||||
node_translations[key] = json_data
|
||||
|
||||
if node_translations:
|
||||
translations[lang_code] = merge_json_recursive(
|
||||
translations[lang_code], node_translations
|
||||
)
|
||||
|
||||
return translations
|
||||
|
||||
Placeholder to refactor the custom node management features from ComfyUI-Manager.
|
||||
Currently it only contains the custom workflow templates feature.
|
||||
"""
|
||||
def add_routes(self, routes, webapp, loadedModules):
|
||||
|
||||
@routes.get("/workflow_templates")
|
||||
@@ -99,36 +18,17 @@ class CustomNodeManager:
|
||||
files = [
|
||||
file
|
||||
for folder in folder_paths.get_folder_paths("custom_nodes")
|
||||
for file in glob.glob(
|
||||
os.path.join(folder, "*/example_workflows/*.json")
|
||||
)
|
||||
for file in glob.glob(os.path.join(folder, '*/example_workflows/*.json'))
|
||||
]
|
||||
workflow_templates_dict = (
|
||||
{}
|
||||
) # custom_nodes folder name -> example workflow names
|
||||
workflow_templates_dict = {} # custom_nodes folder name -> example workflow names
|
||||
for file in files:
|
||||
custom_nodes_name = os.path.basename(
|
||||
os.path.dirname(os.path.dirname(file))
|
||||
)
|
||||
custom_nodes_name = os.path.basename(os.path.dirname(os.path.dirname(file)))
|
||||
workflow_name = os.path.splitext(os.path.basename(file))[0]
|
||||
workflow_templates_dict.setdefault(custom_nodes_name, []).append(
|
||||
workflow_name
|
||||
)
|
||||
workflow_templates_dict.setdefault(custom_nodes_name, []).append(workflow_name)
|
||||
return web.json_response(workflow_templates_dict)
|
||||
|
||||
# Serve workflow templates from custom nodes.
|
||||
for module_name, module_dir in loadedModules:
|
||||
workflows_dir = os.path.join(module_dir, "example_workflows")
|
||||
workflows_dir = os.path.join(module_dir, 'example_workflows')
|
||||
if os.path.exists(workflows_dir):
|
||||
webapp.add_routes(
|
||||
[
|
||||
web.static(
|
||||
"/api/workflow_templates/" + module_name, workflows_dir
|
||||
)
|
||||
]
|
||||
)
|
||||
|
||||
@routes.get("/i18n")
|
||||
async def get_i18n(request):
|
||||
"""Returns translations from all custom nodes' locales folders."""
|
||||
return web.json_response(self.build_translations())
|
||||
webapp.add_routes([web.static('/api/workflow_templates/' + module_name, workflows_dir)])
|
||||
|
||||
118
app/database/db.py
Normal file
118
app/database/db.py
Normal file
@@ -0,0 +1,118 @@
|
||||
import logging
|
||||
import os
|
||||
import shutil
|
||||
import sys
|
||||
from app.database.models import Tag
|
||||
from comfy.cli_args import args
|
||||
|
||||
try:
|
||||
import alembic
|
||||
import sqlalchemy
|
||||
except ImportError as e:
|
||||
req_path = os.path.abspath(
|
||||
os.path.join(os.path.dirname(__file__), "../..", "requirements.txt")
|
||||
)
|
||||
logging.error(
|
||||
f"\n\n********** ERROR ***********\n\nRequirements are not installed ({e}). Please install the requirements.txt file by running:\n{sys.executable} -s -m pip install -r {req_path}\n\nIf you are on the portable package you can run: update\\update_comfyui.bat to solve this problem\n********** ERROR **********\n"
|
||||
)
|
||||
exit(-1)
|
||||
|
||||
from alembic import command
|
||||
from alembic.config import Config
|
||||
from alembic.runtime.migration import MigrationContext
|
||||
from alembic.script import ScriptDirectory
|
||||
from sqlalchemy import create_engine
|
||||
from sqlalchemy.orm import sessionmaker
|
||||
|
||||
Session = None
|
||||
|
||||
|
||||
def get_alembic_config():
|
||||
root_path = os.path.join(os.path.dirname(__file__), "../..")
|
||||
config_path = os.path.abspath(os.path.join(root_path, "alembic.ini"))
|
||||
scripts_path = os.path.abspath(os.path.join(root_path, "alembic_db"))
|
||||
|
||||
config = Config(config_path)
|
||||
config.set_main_option("script_location", scripts_path)
|
||||
config.set_main_option("sqlalchemy.url", args.database_url)
|
||||
|
||||
return config
|
||||
|
||||
|
||||
def get_db_path():
|
||||
url = args.database_url
|
||||
if url.startswith("sqlite:///"):
|
||||
return url.split("///")[1]
|
||||
else:
|
||||
raise ValueError(f"Unsupported database URL '{url}'.")
|
||||
|
||||
|
||||
def init_db():
|
||||
db_url = args.database_url
|
||||
logging.debug(f"Database URL: {db_url}")
|
||||
|
||||
config = get_alembic_config()
|
||||
|
||||
# Check if we need to upgrade
|
||||
engine = create_engine(db_url)
|
||||
conn = engine.connect()
|
||||
|
||||
context = MigrationContext.configure(conn)
|
||||
current_rev = context.get_current_revision()
|
||||
|
||||
script = ScriptDirectory.from_config(config)
|
||||
target_rev = script.get_current_head()
|
||||
|
||||
if current_rev != target_rev:
|
||||
# Backup the database pre upgrade
|
||||
db_path = get_db_path()
|
||||
backup_path = db_path + ".bkp"
|
||||
if os.path.exists(db_path):
|
||||
shutil.copy(db_path, backup_path)
|
||||
else:
|
||||
backup_path = None
|
||||
|
||||
try:
|
||||
command.upgrade(config, target_rev)
|
||||
logging.info(f"Database upgraded from {current_rev} to {target_rev}")
|
||||
except Exception as e:
|
||||
if backup_path:
|
||||
# Restore the database from backup if upgrade fails
|
||||
shutil.copy(backup_path, db_path)
|
||||
os.remove(backup_path)
|
||||
logging.error(f"Error upgrading database: {e}")
|
||||
raise e
|
||||
|
||||
global Session
|
||||
Session = sessionmaker(bind=engine)
|
||||
|
||||
if not current_rev:
|
||||
# Init db, populate models
|
||||
from app.model_processor import model_processor
|
||||
|
||||
session = create_session()
|
||||
model_processor.populate_models(session)
|
||||
|
||||
# populate tags
|
||||
tags = (
|
||||
"character",
|
||||
"style",
|
||||
"concept",
|
||||
"clothing",
|
||||
"pose",
|
||||
"background",
|
||||
"vehicle",
|
||||
"object",
|
||||
"animal",
|
||||
"action",
|
||||
)
|
||||
for tag in tags:
|
||||
session.add(Tag(name=tag))
|
||||
|
||||
session.commit()
|
||||
|
||||
def can_create_session():
|
||||
return Session is not None
|
||||
|
||||
def create_session():
|
||||
return Session()
|
||||
76
app/database/models.py
Normal file
76
app/database/models.py
Normal file
@@ -0,0 +1,76 @@
|
||||
from sqlalchemy import (
|
||||
Column,
|
||||
Integer,
|
||||
Text,
|
||||
DateTime,
|
||||
Table,
|
||||
ForeignKeyConstraint,
|
||||
)
|
||||
from sqlalchemy.orm import relationship, declarative_base
|
||||
from sqlalchemy.sql import func
|
||||
|
||||
Base = declarative_base()
|
||||
|
||||
|
||||
def to_dict(obj):
|
||||
fields = obj.__table__.columns.keys()
|
||||
return {
|
||||
field: (val.to_dict() if hasattr(val, "to_dict") else val)
|
||||
for field in fields
|
||||
if (val := getattr(obj, field))
|
||||
}
|
||||
|
||||
|
||||
ModelTag = Table(
|
||||
"model_tag",
|
||||
Base.metadata,
|
||||
Column(
|
||||
"model_type",
|
||||
Text,
|
||||
primary_key=True,
|
||||
),
|
||||
Column(
|
||||
"model_path",
|
||||
Text,
|
||||
primary_key=True,
|
||||
),
|
||||
Column("tag_id", Integer, primary_key=True),
|
||||
ForeignKeyConstraint(
|
||||
["model_type", "model_path"], ["model.type", "model.path"], ondelete="CASCADE"
|
||||
),
|
||||
ForeignKeyConstraint(["tag_id"], ["tag.id"], ondelete="CASCADE"),
|
||||
)
|
||||
|
||||
|
||||
class Model(Base):
|
||||
__tablename__ = "model"
|
||||
|
||||
type = Column(Text, primary_key=True)
|
||||
path = Column(Text, primary_key=True)
|
||||
title = Column(Text)
|
||||
description = Column(Text)
|
||||
architecture = Column(Text)
|
||||
hash = Column(Text)
|
||||
source_url = Column(Text)
|
||||
date_added = Column(DateTime, server_default=func.now())
|
||||
|
||||
# Relationship with tags
|
||||
tags = relationship("Tag", secondary=ModelTag, back_populates="models")
|
||||
|
||||
def to_dict(self):
|
||||
dict = to_dict(self)
|
||||
dict["tags"] = [tag.to_dict() for tag in self.tags]
|
||||
return dict
|
||||
|
||||
|
||||
class Tag(Base):
|
||||
__tablename__ = "tag"
|
||||
|
||||
id = Column(Integer, primary_key=True, autoincrement=True)
|
||||
name = Column(Text, nullable=False, unique=True)
|
||||
|
||||
# Relationship with models
|
||||
models = relationship("Model", secondary=ModelTag, back_populates="tags")
|
||||
|
||||
def to_dict(self):
|
||||
return to_dict(self)
|
||||
@@ -1,19 +1,30 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
import base64
|
||||
import json
|
||||
import time
|
||||
import logging
|
||||
from app.database.db import create_session
|
||||
import folder_paths
|
||||
import glob
|
||||
import comfy.utils
|
||||
from aiohttp import web
|
||||
from PIL import Image
|
||||
from io import BytesIO
|
||||
from folder_paths import map_legacy, filter_files_extensions, filter_files_content_types
|
||||
from folder_paths import map_legacy, filter_files_extensions, get_full_path
|
||||
from app.database.models import Tag, Model
|
||||
from app.model_processor import get_model_previews, model_processor
|
||||
from utils.web import dumps
|
||||
from sqlalchemy.orm import joinedload
|
||||
import sqlalchemy.exc
|
||||
|
||||
|
||||
def bad_request(message: str):
|
||||
return web.json_response({"error": message}, status=400)
|
||||
|
||||
def missing_field(field: str):
|
||||
return bad_request(f"{field} is required")
|
||||
|
||||
def not_found(message: str):
|
||||
return web.json_response({"error": message + " not found"}, status=404)
|
||||
|
||||
class ModelFileManager:
|
||||
def __init__(self) -> None:
|
||||
self.cache: dict[str, tuple[list[dict], dict[str, float], float]] = {}
|
||||
@@ -62,7 +73,7 @@ class ModelFileManager:
|
||||
folder = folders[0][path_index]
|
||||
full_filename = os.path.join(folder, filename)
|
||||
|
||||
previews = self.get_model_previews(full_filename)
|
||||
previews = get_model_previews(full_filename)
|
||||
default_preview = previews[0] if len(previews) > 0 else None
|
||||
if default_preview is None or (isinstance(default_preview, str) and not os.path.isfile(default_preview)):
|
||||
return web.Response(status=404)
|
||||
@@ -76,6 +87,183 @@ class ModelFileManager:
|
||||
except:
|
||||
return web.Response(status=404)
|
||||
|
||||
@routes.get("/v2/models")
|
||||
async def get_models(request):
|
||||
with create_session() as session:
|
||||
model_path = request.query.get("path", None)
|
||||
model_type = request.query.get("type", None)
|
||||
query = session.query(Model).options(joinedload(Model.tags))
|
||||
if model_path:
|
||||
query = query.filter(Model.path == model_path)
|
||||
if model_type:
|
||||
query = query.filter(Model.type == model_type)
|
||||
models = query.all()
|
||||
if model_path and model_type:
|
||||
if len(models) == 0:
|
||||
return not_found("Model")
|
||||
return web.json_response(models[0].to_dict(), dumps=dumps)
|
||||
|
||||
return web.json_response([model.to_dict() for model in models], dumps=dumps)
|
||||
|
||||
@routes.post("/v2/models")
|
||||
async def add_model(request):
|
||||
with create_session() as session:
|
||||
data = await request.json()
|
||||
model_type = data.get("type", None)
|
||||
model_path = data.get("path", None)
|
||||
|
||||
if not model_type:
|
||||
return missing_field("type")
|
||||
if not model_path:
|
||||
return missing_field("path")
|
||||
|
||||
tags = data.pop("tags", [])
|
||||
fields = Model.metadata.tables["model"].columns.keys()
|
||||
|
||||
# Validate keys are valid model fields
|
||||
for key in data.keys():
|
||||
if key not in fields:
|
||||
return bad_request(f"Invalid field: {key}")
|
||||
|
||||
# Validate file exists
|
||||
if not get_full_path(model_type, model_path):
|
||||
return not_found(f"File '{model_type}/{model_path}'")
|
||||
|
||||
model = Model()
|
||||
for field in fields:
|
||||
if field in data:
|
||||
setattr(model, field, data[field])
|
||||
|
||||
model.tags = session.query(Tag).filter(Tag.id.in_(tags)).all()
|
||||
for tag in tags:
|
||||
if tag not in [t.id for t in model.tags]:
|
||||
return not_found(f"Tag '{tag}'")
|
||||
|
||||
try:
|
||||
session.add(model)
|
||||
session.commit()
|
||||
except sqlalchemy.exc.IntegrityError as e:
|
||||
session.rollback()
|
||||
return bad_request(e.orig.args[0])
|
||||
|
||||
model_processor.run()
|
||||
|
||||
return web.json_response(model.to_dict(), dumps=dumps)
|
||||
|
||||
@routes.delete("/v2/models")
|
||||
async def delete_model(request):
|
||||
with create_session() as session:
|
||||
model_path = request.query.get("path", None)
|
||||
model_type = request.query.get("type", None)
|
||||
if not model_path:
|
||||
return missing_field("path")
|
||||
if not model_type:
|
||||
return missing_field("type")
|
||||
|
||||
full_path = get_full_path(model_type, model_path)
|
||||
if full_path:
|
||||
return bad_request("Model file exists, please delete the file before deleting the model record.")
|
||||
|
||||
model = session.query(Model).filter(Model.path == model_path, Model.type == model_type).first()
|
||||
if not model:
|
||||
return not_found("Model")
|
||||
session.delete(model)
|
||||
session.commit()
|
||||
return web.Response(status=204)
|
||||
|
||||
@routes.get("/v2/tags")
|
||||
async def get_tags(request):
|
||||
with create_session() as session:
|
||||
tags = session.query(Tag).all()
|
||||
return web.json_response(
|
||||
[{"id": tag.id, "name": tag.name} for tag in tags]
|
||||
)
|
||||
|
||||
@routes.post("/v2/tags")
|
||||
async def create_tag(request):
|
||||
with create_session() as session:
|
||||
data = await request.json()
|
||||
name = data.get("name", None)
|
||||
if not name:
|
||||
return missing_field("name")
|
||||
tag = Tag(name=name)
|
||||
session.add(tag)
|
||||
session.commit()
|
||||
return web.json_response({"id": tag.id, "name": tag.name})
|
||||
|
||||
@routes.delete("/v2/tags")
|
||||
async def delete_tag(request):
|
||||
with create_session() as session:
|
||||
tag_id = request.query.get("id", None)
|
||||
if not tag_id:
|
||||
return missing_field("id")
|
||||
tag = session.query(Tag).filter(Tag.id == tag_id).first()
|
||||
if not tag:
|
||||
return not_found("Tag")
|
||||
session.delete(tag)
|
||||
session.commit()
|
||||
return web.Response(status=204)
|
||||
|
||||
@routes.post("/v2/models/tags")
|
||||
async def add_model_tag(request):
|
||||
with create_session() as session:
|
||||
data = await request.json()
|
||||
tag_id = data.get("tag", None)
|
||||
model_path = data.get("path", None)
|
||||
model_type = data.get("type", None)
|
||||
|
||||
if tag_id is None:
|
||||
return missing_field("tag")
|
||||
if model_path is None:
|
||||
return missing_field("path")
|
||||
if model_type is None:
|
||||
return missing_field("type")
|
||||
|
||||
try:
|
||||
tag_id = int(tag_id)
|
||||
except ValueError:
|
||||
return bad_request("Invalid tag id")
|
||||
|
||||
tag = session.query(Tag).filter(Tag.id == tag_id).first()
|
||||
model = session.query(Model).filter(Model.path == model_path, Model.type == model_type).first()
|
||||
if not model:
|
||||
return not_found("Model")
|
||||
model.tags.append(tag)
|
||||
session.commit()
|
||||
return web.json_response(model.to_dict(), dumps=dumps)
|
||||
|
||||
@routes.delete("/v2/models/tags")
|
||||
async def delete_model_tag(request):
|
||||
with create_session() as session:
|
||||
tag_id = request.query.get("tag", None)
|
||||
model_path = request.query.get("path", None)
|
||||
model_type = request.query.get("type", None)
|
||||
|
||||
if tag_id is None:
|
||||
return missing_field("tag")
|
||||
if model_path is None:
|
||||
return missing_field("path")
|
||||
if model_type is None:
|
||||
return missing_field("type")
|
||||
|
||||
try:
|
||||
tag_id = int(tag_id)
|
||||
except ValueError:
|
||||
return bad_request("Invalid tag id")
|
||||
|
||||
model = session.query(Model).filter(Model.path == model_path, Model.type == model_type).first()
|
||||
if not model:
|
||||
return not_found("Model")
|
||||
model.tags = [tag for tag in model.tags if tag.id != tag_id]
|
||||
session.commit()
|
||||
return web.Response(status=204)
|
||||
|
||||
|
||||
|
||||
@routes.get("/v2/models/missing")
|
||||
async def get_missing_models(request):
|
||||
return web.json_response(model_processor.missing_models)
|
||||
|
||||
def get_model_file_list(self, folder_name: str):
|
||||
folder_name = map_legacy(folder_name)
|
||||
folders = folder_paths.folder_names_and_paths[folder_name]
|
||||
@@ -146,39 +334,5 @@ class ModelFileManager:
|
||||
|
||||
return [{"name": f, "pathIndex": pathIndex} for f in result], dirs, time.perf_counter()
|
||||
|
||||
def get_model_previews(self, filepath: str) -> list[str | BytesIO]:
|
||||
dirname = os.path.dirname(filepath)
|
||||
|
||||
if not os.path.exists(dirname):
|
||||
return []
|
||||
|
||||
basename = os.path.splitext(filepath)[0]
|
||||
match_files = glob.glob(f"{basename}.*", recursive=False)
|
||||
image_files = filter_files_content_types(match_files, "image")
|
||||
safetensors_file = next(filter(lambda x: x.endswith(".safetensors"), match_files), None)
|
||||
safetensors_metadata = {}
|
||||
|
||||
result: list[str | BytesIO] = []
|
||||
|
||||
for filename in image_files:
|
||||
_basename = os.path.splitext(filename)[0]
|
||||
if _basename == basename:
|
||||
result.append(filename)
|
||||
if _basename == f"{basename}.preview":
|
||||
result.append(filename)
|
||||
|
||||
if safetensors_file:
|
||||
safetensors_filepath = os.path.join(dirname, safetensors_file)
|
||||
header = comfy.utils.safetensors_header(safetensors_filepath, max_size=8*1024*1024)
|
||||
if header:
|
||||
safetensors_metadata = json.loads(header)
|
||||
safetensors_images = safetensors_metadata.get("__metadata__", {}).get("ssmd_cover_images", None)
|
||||
if safetensors_images:
|
||||
safetensors_images = json.loads(safetensors_images)
|
||||
for image in safetensors_images:
|
||||
result.append(BytesIO(base64.b64decode(image)))
|
||||
|
||||
return result
|
||||
|
||||
def __exit__(self, exc_type, exc_value, traceback):
|
||||
self.clear_cache()
|
||||
|
||||
263
app/model_processor.py
Normal file
263
app/model_processor.py
Normal file
@@ -0,0 +1,263 @@
|
||||
import base64
|
||||
from datetime import datetime
|
||||
import glob
|
||||
import hashlib
|
||||
from io import BytesIO
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
import threading
|
||||
import time
|
||||
import comfy.utils
|
||||
from app.database.models import Model
|
||||
from app.database.db import create_session
|
||||
from comfy.cli_args import args
|
||||
from folder_paths import (
|
||||
filter_files_content_types,
|
||||
get_full_path,
|
||||
folder_names_and_paths,
|
||||
get_filename_list,
|
||||
)
|
||||
from PIL import Image
|
||||
from urllib import request
|
||||
|
||||
|
||||
def get_model_previews(
|
||||
filepath: str, check_metadata: bool = True
|
||||
) -> list[str | BytesIO]:
|
||||
dirname = os.path.dirname(filepath)
|
||||
|
||||
if not os.path.exists(dirname):
|
||||
return []
|
||||
|
||||
basename = os.path.splitext(filepath)[0]
|
||||
match_files = glob.glob(f"{basename}.*", recursive=False)
|
||||
image_files = filter_files_content_types(match_files, "image")
|
||||
|
||||
result: list[str | BytesIO] = []
|
||||
|
||||
for filename in image_files:
|
||||
_basename = os.path.splitext(filename)[0]
|
||||
if _basename == basename:
|
||||
result.append(filename)
|
||||
if _basename == f"{basename}.preview":
|
||||
result.append(filename)
|
||||
|
||||
if not check_metadata:
|
||||
return result
|
||||
|
||||
safetensors_file = next(
|
||||
filter(lambda x: x.endswith(".safetensors"), match_files), None
|
||||
)
|
||||
safetensors_metadata = {}
|
||||
|
||||
if safetensors_file:
|
||||
safetensors_filepath = os.path.join(dirname, safetensors_file)
|
||||
header = comfy.utils.safetensors_header(
|
||||
safetensors_filepath, max_size=8 * 1024 * 1024
|
||||
)
|
||||
if header:
|
||||
safetensors_metadata = json.loads(header)
|
||||
safetensors_images = safetensors_metadata.get("__metadata__", {}).get(
|
||||
"ssmd_cover_images", None
|
||||
)
|
||||
if safetensors_images:
|
||||
safetensors_images = json.loads(safetensors_images)
|
||||
for image in safetensors_images:
|
||||
result.append(BytesIO(base64.b64decode(image)))
|
||||
|
||||
return result
|
||||
|
||||
|
||||
class ModelProcessor:
|
||||
def __init__(self):
|
||||
self._thread = None
|
||||
self._lock = threading.Lock()
|
||||
self._run = False
|
||||
self.missing_models = []
|
||||
|
||||
def run(self):
|
||||
if args.disable_model_processing:
|
||||
return
|
||||
|
||||
if self._thread is None:
|
||||
# Lock to prevent multiple threads from starting
|
||||
with self._lock:
|
||||
self._run = True
|
||||
if self._thread is None:
|
||||
self._thread = threading.Thread(target=self._process_models)
|
||||
self._thread.daemon = True
|
||||
self._thread.start()
|
||||
|
||||
def populate_models(self, session):
|
||||
# Ensure database state matches filesystem
|
||||
|
||||
existing_models = session.query(Model).all()
|
||||
|
||||
for folder_name in folder_names_and_paths.keys():
|
||||
if folder_name == "custom_nodes" or folder_name == "configs":
|
||||
continue
|
||||
seen = set()
|
||||
files = get_filename_list(folder_name)
|
||||
|
||||
for file in files:
|
||||
if file in seen:
|
||||
logging.warning(f"Skipping duplicate named model: {file}")
|
||||
continue
|
||||
seen.add(file)
|
||||
|
||||
existing_model = None
|
||||
for model in existing_models:
|
||||
if model.path == file and model.type == folder_name:
|
||||
existing_model = model
|
||||
break
|
||||
|
||||
if existing_model:
|
||||
# Model already exists in db, remove from list and skip
|
||||
existing_models.remove(existing_model)
|
||||
continue
|
||||
|
||||
file_path = get_full_path(folder_name, file)
|
||||
|
||||
model = Model(
|
||||
path=file,
|
||||
type=folder_name,
|
||||
date_added=datetime.fromtimestamp(os.path.getctime(file_path)),
|
||||
)
|
||||
session.add(model)
|
||||
|
||||
for model in existing_models:
|
||||
if not get_full_path(model.type, model.path):
|
||||
logging.warning(f"Model {model.path} not found")
|
||||
self.missing_models.append({"type": model.type, "path": model.path})
|
||||
|
||||
session.commit()
|
||||
|
||||
def _get_models(self, session):
|
||||
models = session.query(Model).filter(Model.hash == None).all()
|
||||
return models
|
||||
|
||||
def _process_file(self, model_path):
|
||||
is_safetensors = model_path.endswith(".safetensors")
|
||||
metadata = {}
|
||||
h = hashlib.sha256()
|
||||
|
||||
with open(model_path, "rb", buffering=0) as f:
|
||||
if is_safetensors:
|
||||
# Read header length (8 bytes)
|
||||
header_size_bytes = f.read(8)
|
||||
header_len = int.from_bytes(header_size_bytes, "little")
|
||||
h.update(header_size_bytes)
|
||||
|
||||
# Read header
|
||||
header_bytes = f.read(header_len)
|
||||
h.update(header_bytes)
|
||||
try:
|
||||
metadata = json.loads(header_bytes)
|
||||
except json.JSONDecodeError:
|
||||
pass
|
||||
|
||||
# Read rest of file
|
||||
b = bytearray(128 * 1024)
|
||||
mv = memoryview(b)
|
||||
while n := f.readinto(mv):
|
||||
h.update(mv[:n])
|
||||
|
||||
return h.hexdigest(), metadata
|
||||
|
||||
def _populate_info(self, model, metadata):
|
||||
model.title = metadata.get("modelspec.title", None)
|
||||
model.description = metadata.get("modelspec.description", None)
|
||||
model.architecture = metadata.get("modelspec.architecture", None)
|
||||
|
||||
def _extract_image(self, model_path, metadata):
|
||||
# check if image already exists
|
||||
if len(get_model_previews(model_path, check_metadata=False)) > 0:
|
||||
return
|
||||
|
||||
image_path = os.path.splitext(model_path)[0] + ".webp"
|
||||
if os.path.exists(image_path):
|
||||
return
|
||||
|
||||
cover_images = metadata.get("ssmd_cover_images", None)
|
||||
image = None
|
||||
if cover_images:
|
||||
try:
|
||||
cover_images = json.loads(cover_images)
|
||||
if len(cover_images) > 0:
|
||||
image_data = cover_images[0]
|
||||
image = Image.open(BytesIO(base64.b64decode(image_data)))
|
||||
except Exception as e:
|
||||
logging.warning(
|
||||
f"Error extracting cover image for model {model_path}: {e}"
|
||||
)
|
||||
|
||||
if not image:
|
||||
thumbnail = metadata.get("modelspec.thumbnail", None)
|
||||
if thumbnail:
|
||||
try:
|
||||
response = request.urlopen(thumbnail)
|
||||
image = Image.open(response)
|
||||
except Exception as e:
|
||||
logging.warning(
|
||||
f"Error extracting thumbnail for model {model_path}: {e}"
|
||||
)
|
||||
|
||||
if image:
|
||||
image.thumbnail((512, 512))
|
||||
image.save(image_path)
|
||||
image.close()
|
||||
|
||||
def _process_models(self):
|
||||
with create_session() as session:
|
||||
checked = set()
|
||||
self.populate_models(session)
|
||||
|
||||
while self._run:
|
||||
self._run = False
|
||||
|
||||
models = self._get_models(session)
|
||||
|
||||
if len(models) == 0:
|
||||
break
|
||||
|
||||
for model in models:
|
||||
# prevent looping on the same model if it crashes
|
||||
if model.path in checked:
|
||||
continue
|
||||
|
||||
checked.add(model.path)
|
||||
|
||||
try:
|
||||
time.sleep(0)
|
||||
now = time.time()
|
||||
model_path = get_full_path(model.type, model.path)
|
||||
|
||||
if not model_path:
|
||||
logging.warning(f"Model {model.path} not found")
|
||||
self.missing_models.append(model.path)
|
||||
continue
|
||||
|
||||
logging.debug(f"Processing model {model_path}")
|
||||
hash, header = self._process_file(model_path)
|
||||
logging.debug(
|
||||
f"Processed model {model_path} in {time.time() - now} seconds"
|
||||
)
|
||||
model.hash = hash
|
||||
|
||||
if header:
|
||||
metadata = header.get("__metadata__", None)
|
||||
|
||||
if metadata:
|
||||
self._populate_info(model, metadata)
|
||||
self._extract_image(model_path, metadata)
|
||||
|
||||
session.commit()
|
||||
except Exception as e:
|
||||
logging.error(f"Error processing model {model.path}: {e}")
|
||||
|
||||
with self._lock:
|
||||
self._thread = None
|
||||
|
||||
|
||||
model_processor = ModelProcessor()
|
||||
@@ -178,6 +178,12 @@ parser.add_argument(
|
||||
|
||||
parser.add_argument("--user-directory", type=is_valid_directory, default=None, help="Set the ComfyUI user directory with an absolute path.")
|
||||
|
||||
database_default_path = os.path.abspath(
|
||||
os.path.join(os.path.dirname(__file__), "..", "user", "comfyui.db")
|
||||
)
|
||||
parser.add_argument("--database-url", type=str, default=f"sqlite:///{database_default_path}", help="Specify the database URL, e.g. for an in-memory database you can use 'sqlite:///:memory:'.")
|
||||
parser.add_argument("--disable-model-processing", action="store_true", help="Disable model file processing, e.g. computing hashes and extracting metadata.")
|
||||
|
||||
if comfy.options.args_parsing:
|
||||
args = parser.parse_args()
|
||||
else:
|
||||
|
||||
@@ -46,7 +46,7 @@ class CONDCrossAttn(CONDRegular):
|
||||
if s1[0] != s2[0] or s1[2] != s2[2]: #these 2 cases should not happen
|
||||
return False
|
||||
|
||||
mult_min = math.lcm(s1[1], s2[1])
|
||||
mult_min = lcm(s1[1], s2[1])
|
||||
diff = mult_min // min(s1[1], s2[1])
|
||||
if diff > 4: #arbitrary limit on the padding because it's probably going to impact performance negatively if it's too much
|
||||
return False
|
||||
@@ -57,7 +57,7 @@ class CONDCrossAttn(CONDRegular):
|
||||
crossattn_max_len = self.cond.shape[1]
|
||||
for x in others:
|
||||
c = x.cond
|
||||
crossattn_max_len = math.lcm(crossattn_max_len, c.shape[1])
|
||||
crossattn_max_len = lcm(crossattn_max_len, c.shape[1])
|
||||
conds.append(c)
|
||||
|
||||
out = []
|
||||
|
||||
@@ -661,7 +661,7 @@ class UniPC:
|
||||
|
||||
if x_t is None:
|
||||
if use_predictor:
|
||||
pred_res = torch.tensordot(D1s, rhos_p, dims=([1], [0])) # torch.einsum('k,bkchw->bchw', rhos_p, D1s)
|
||||
pred_res = torch.einsum('k,bkchw->bchw', rhos_p, D1s)
|
||||
else:
|
||||
pred_res = 0
|
||||
x_t = x_t_ - expand_dims(alpha_t * B_h, dims) * pred_res
|
||||
@@ -669,7 +669,7 @@ class UniPC:
|
||||
if use_corrector:
|
||||
model_t = self.model_fn(x_t, t)
|
||||
if D1s is not None:
|
||||
corr_res = torch.tensordot(D1s, rhos_c[:-1], dims=([1], [0])) # torch.einsum('k,bkchw->bchw', rhos_c[:-1], D1s)
|
||||
corr_res = torch.einsum('k,bkchw->bchw', rhos_c[:-1], D1s)
|
||||
else:
|
||||
corr_res = 0
|
||||
D1_t = (model_t - model_prev_0)
|
||||
|
||||
@@ -40,7 +40,7 @@ def get_sigmas_polyexponential(n, sigma_min, sigma_max, rho=1., device='cpu'):
|
||||
def get_sigmas_vp(n, beta_d=19.9, beta_min=0.1, eps_s=1e-3, device='cpu'):
|
||||
"""Constructs a continuous VP noise schedule."""
|
||||
t = torch.linspace(1, eps_s, n, device=device)
|
||||
sigmas = torch.sqrt(torch.special.expm1(beta_d * t ** 2 / 2 + beta_min * t))
|
||||
sigmas = torch.sqrt(torch.exp(beta_d * t ** 2 / 2 + beta_min * t) - 1)
|
||||
return append_zero(sigmas)
|
||||
|
||||
|
||||
@@ -1336,26 +1336,3 @@ def sample_res_multistep(model, x, sigmas, extra_args=None, callback=None, disab
|
||||
@torch.no_grad()
|
||||
def sample_res_multistep_cfg_pp(model, x, sigmas, extra_args=None, callback=None, disable=None, s_churn=0., s_tmin=0., s_tmax=float('inf'), s_noise=1., noise_sampler=None):
|
||||
return res_multistep(model, x, sigmas, extra_args=extra_args, callback=callback, disable=disable, s_churn=s_churn, s_tmin=s_tmin, s_tmax=s_tmax, s_noise=s_noise, noise_sampler=noise_sampler, cfg_pp=True)
|
||||
|
||||
@torch.no_grad()
|
||||
def sample_gradient_estimation(model, x, sigmas, extra_args=None, callback=None, disable=None, ge_gamma=2.):
|
||||
"""Gradient-estimation sampler. Paper: https://openreview.net/pdf?id=o2ND9v0CeK"""
|
||||
extra_args = {} if extra_args is None else extra_args
|
||||
s_in = x.new_ones([x.shape[0]])
|
||||
old_d = None
|
||||
|
||||
for i in trange(len(sigmas) - 1, disable=disable):
|
||||
denoised = model(x, sigmas[i] * s_in, **extra_args)
|
||||
d = to_d(x, sigmas[i], denoised)
|
||||
if callback is not None:
|
||||
callback({'x': x, 'i': i, 'sigma': sigmas[i], 'sigma_hat': sigmas[i], 'denoised': denoised})
|
||||
dt = sigmas[i + 1] - sigmas[i]
|
||||
if i == 0:
|
||||
# Euler method
|
||||
x = x + d * dt
|
||||
else:
|
||||
# Gradient estimation
|
||||
d_bar = ge_gamma * d + (1 - ge_gamma) * old_d
|
||||
x = x + d_bar * dt
|
||||
old_d = d
|
||||
return x
|
||||
|
||||
@@ -168,19 +168,15 @@ class Attention(nn.Module):
|
||||
k = self.to_k[1](k)
|
||||
v = self.to_v[1](v)
|
||||
if self.is_selfattn and rope_emb is not None: # only apply to self-attention!
|
||||
# apply_rotary_pos_emb inlined
|
||||
q_shape = q.shape
|
||||
q = q.reshape(*q.shape[:-1], 2, -1).movedim(-2, -1).unsqueeze(-2)
|
||||
q = rope_emb[..., 0] * q[..., 0] + rope_emb[..., 1] * q[..., 1]
|
||||
q = q.movedim(-1, -2).reshape(*q_shape).to(x.dtype)
|
||||
|
||||
# apply_rotary_pos_emb inlined
|
||||
k_shape = k.shape
|
||||
k = k.reshape(*k.shape[:-1], 2, -1).movedim(-2, -1).unsqueeze(-2)
|
||||
k = rope_emb[..., 0] * k[..., 0] + rope_emb[..., 1] * k[..., 1]
|
||||
k = k.movedim(-1, -2).reshape(*k_shape).to(x.dtype)
|
||||
q = apply_rotary_pos_emb(q, rope_emb)
|
||||
k = apply_rotary_pos_emb(k, rope_emb)
|
||||
return q, k, v
|
||||
|
||||
def cal_attn(self, q, k, v, mask=None):
|
||||
out = optimized_attention(q, k, v, self.heads, skip_reshape=True, mask=mask, skip_output_reshape=True)
|
||||
out = rearrange(out, " b n s c -> s b (n c)")
|
||||
return self.to_out(out)
|
||||
|
||||
def forward(
|
||||
self,
|
||||
x,
|
||||
@@ -195,10 +191,7 @@ class Attention(nn.Module):
|
||||
context (Optional[Tensor]): The key tensor of shape [B, Mk, K] or use x as context [self attention] if None
|
||||
"""
|
||||
q, k, v = self.cal_qkv(x, context, mask, rope_emb=rope_emb, **kwargs)
|
||||
out = optimized_attention(q, k, v, self.heads, skip_reshape=True, mask=mask, skip_output_reshape=True)
|
||||
del q, k, v
|
||||
out = rearrange(out, " b n s c -> s b (n c)")
|
||||
return self.to_out(out)
|
||||
return self.cal_attn(q, k, v, mask)
|
||||
|
||||
|
||||
class FeedForward(nn.Module):
|
||||
@@ -795,7 +788,10 @@ class GeneralDITTransformerBlock(nn.Module):
|
||||
crossattn_mask: Optional[torch.Tensor] = None,
|
||||
rope_emb_L_1_1_D: Optional[torch.Tensor] = None,
|
||||
adaln_lora_B_3D: Optional[torch.Tensor] = None,
|
||||
extra_per_block_pos_emb: Optional[torch.Tensor] = None,
|
||||
) -> torch.Tensor:
|
||||
if extra_per_block_pos_emb is not None:
|
||||
x = x + extra_per_block_pos_emb
|
||||
for block in self.blocks:
|
||||
x = block(
|
||||
x,
|
||||
|
||||
@@ -30,8 +30,6 @@ import torch.nn as nn
|
||||
import torch.nn.functional as F
|
||||
import logging
|
||||
|
||||
from comfy.ldm.modules.diffusionmodules.model import vae_attention
|
||||
|
||||
from .patching import (
|
||||
Patcher,
|
||||
Patcher3D,
|
||||
@@ -402,8 +400,6 @@ class CausalAttnBlock(nn.Module):
|
||||
in_channels, in_channels, kernel_size=1, stride=1, padding=0
|
||||
)
|
||||
|
||||
self.optimized_attention = vae_attention()
|
||||
|
||||
def forward(self, x: torch.Tensor) -> torch.Tensor:
|
||||
h_ = x
|
||||
h_ = self.norm(h_)
|
||||
@@ -417,7 +413,18 @@ class CausalAttnBlock(nn.Module):
|
||||
v, batch_size = time2batch(v)
|
||||
|
||||
b, c, h, w = q.shape
|
||||
h_ = self.optimized_attention(q, k, v)
|
||||
q = q.reshape(b, c, h * w)
|
||||
q = q.permute(0, 2, 1)
|
||||
k = k.reshape(b, c, h * w)
|
||||
w_ = torch.bmm(q, k)
|
||||
w_ = w_ * (int(c) ** (-0.5))
|
||||
w_ = F.softmax(w_, dim=2)
|
||||
|
||||
# attend to values
|
||||
v = v.reshape(b, c, h * w)
|
||||
w_ = w_.permute(0, 2, 1)
|
||||
h_ = torch.bmm(v, w_)
|
||||
h_ = h_.reshape(b, c, h, w)
|
||||
|
||||
h_ = batch2time(h_, batch_size)
|
||||
h_ = self.proj_out(h_)
|
||||
@@ -864,16 +871,18 @@ class EncoderFactorized(nn.Module):
|
||||
x = self.patcher3d(x)
|
||||
|
||||
# downsampling
|
||||
h = self.conv_in(x)
|
||||
hs = [self.conv_in(x)]
|
||||
for i_level in range(self.num_resolutions):
|
||||
for i_block in range(self.num_res_blocks):
|
||||
h = self.down[i_level].block[i_block](h)
|
||||
h = self.down[i_level].block[i_block](hs[-1])
|
||||
if len(self.down[i_level].attn) > 0:
|
||||
h = self.down[i_level].attn[i_block](h)
|
||||
hs.append(h)
|
||||
if i_level != self.num_resolutions - 1:
|
||||
h = self.down[i_level].downsample(h)
|
||||
hs.append(self.down[i_level].downsample(hs[-1]))
|
||||
|
||||
# middle
|
||||
h = hs[-1]
|
||||
h = self.mid.block_1(h)
|
||||
h = self.mid.attn_1(h)
|
||||
h = self.mid.block_2(h)
|
||||
|
||||
@@ -281,76 +281,54 @@ class UnPatcher3D(UnPatcher):
|
||||
hh = hh.to(dtype=dtype)
|
||||
|
||||
xlll, xllh, xlhl, xlhh, xhll, xhlh, xhhl, xhhh = torch.chunk(x, 8, dim=1)
|
||||
del x
|
||||
|
||||
# Height height transposed convolutions.
|
||||
xll = F.conv_transpose3d(
|
||||
xlll, hl.unsqueeze(2).unsqueeze(3), groups=g, stride=(1, 1, 2)
|
||||
)
|
||||
del xlll
|
||||
|
||||
xll += F.conv_transpose3d(
|
||||
xllh, hh.unsqueeze(2).unsqueeze(3), groups=g, stride=(1, 1, 2)
|
||||
)
|
||||
del xllh
|
||||
|
||||
xlh = F.conv_transpose3d(
|
||||
xlhl, hl.unsqueeze(2).unsqueeze(3), groups=g, stride=(1, 1, 2)
|
||||
)
|
||||
del xlhl
|
||||
|
||||
xlh += F.conv_transpose3d(
|
||||
xlhh, hh.unsqueeze(2).unsqueeze(3), groups=g, stride=(1, 1, 2)
|
||||
)
|
||||
del xlhh
|
||||
|
||||
xhl = F.conv_transpose3d(
|
||||
xhll, hl.unsqueeze(2).unsqueeze(3), groups=g, stride=(1, 1, 2)
|
||||
)
|
||||
del xhll
|
||||
|
||||
xhl += F.conv_transpose3d(
|
||||
xhlh, hh.unsqueeze(2).unsqueeze(3), groups=g, stride=(1, 1, 2)
|
||||
)
|
||||
del xhlh
|
||||
|
||||
xhh = F.conv_transpose3d(
|
||||
xhhl, hl.unsqueeze(2).unsqueeze(3), groups=g, stride=(1, 1, 2)
|
||||
)
|
||||
del xhhl
|
||||
|
||||
xhh += F.conv_transpose3d(
|
||||
xhhh, hh.unsqueeze(2).unsqueeze(3), groups=g, stride=(1, 1, 2)
|
||||
)
|
||||
del xhhh
|
||||
|
||||
# Handles width transposed convolutions.
|
||||
xl = F.conv_transpose3d(
|
||||
xll, hl.unsqueeze(2).unsqueeze(4), groups=g, stride=(1, 2, 1)
|
||||
)
|
||||
del xll
|
||||
|
||||
xl += F.conv_transpose3d(
|
||||
xlh, hh.unsqueeze(2).unsqueeze(4), groups=g, stride=(1, 2, 1)
|
||||
)
|
||||
del xlh
|
||||
|
||||
xh = F.conv_transpose3d(
|
||||
xhl, hl.unsqueeze(2).unsqueeze(4), groups=g, stride=(1, 2, 1)
|
||||
)
|
||||
del xhl
|
||||
|
||||
xh += F.conv_transpose3d(
|
||||
xhh, hh.unsqueeze(2).unsqueeze(4), groups=g, stride=(1, 2, 1)
|
||||
)
|
||||
del xhh
|
||||
|
||||
# Handles time axis transposed convolutions.
|
||||
x = F.conv_transpose3d(
|
||||
xl, hl.unsqueeze(3).unsqueeze(4), groups=g, stride=(2, 1, 1)
|
||||
)
|
||||
del xl
|
||||
|
||||
x += F.conv_transpose3d(
|
||||
xh, hh.unsqueeze(3).unsqueeze(4), groups=g, stride=(2, 1, 1)
|
||||
)
|
||||
|
||||
@@ -168,7 +168,7 @@ class GeneralDIT(nn.Module):
|
||||
operations=operations,
|
||||
)
|
||||
|
||||
self.build_pos_embed(device=device, dtype=dtype)
|
||||
self.build_pos_embed(device=device)
|
||||
self.block_x_format = block_x_format
|
||||
self.use_adaln_lora = use_adaln_lora
|
||||
self.adaln_lora_dim = adaln_lora_dim
|
||||
@@ -210,7 +210,7 @@ class GeneralDIT(nn.Module):
|
||||
operations=operations,
|
||||
)
|
||||
|
||||
def build_pos_embed(self, device=None, dtype=None):
|
||||
def build_pos_embed(self, device=None):
|
||||
if self.pos_emb_cls == "rope3d":
|
||||
cls_type = VideoRopePosition3DEmb
|
||||
else:
|
||||
@@ -242,7 +242,6 @@ class GeneralDIT(nn.Module):
|
||||
kwargs["w_extrapolation_ratio"] = self.extra_w_extrapolation_ratio
|
||||
kwargs["t_extrapolation_ratio"] = self.extra_t_extrapolation_ratio
|
||||
kwargs["device"] = device
|
||||
kwargs["dtype"] = dtype
|
||||
self.extra_pos_embedder = LearnablePosEmbAxis(
|
||||
**kwargs,
|
||||
)
|
||||
@@ -293,7 +292,7 @@ class GeneralDIT(nn.Module):
|
||||
x_B_T_H_W_D = self.x_embedder(x_B_C_T_H_W)
|
||||
|
||||
if self.extra_per_block_abs_pos_emb:
|
||||
extra_pos_emb = self.extra_pos_embedder(x_B_T_H_W_D, fps=fps, device=x_B_C_T_H_W.device, dtype=x_B_C_T_H_W.dtype)
|
||||
extra_pos_emb = self.extra_pos_embedder(x_B_T_H_W_D, fps=fps, device=x_B_C_T_H_W.device)
|
||||
else:
|
||||
extra_pos_emb = None
|
||||
|
||||
@@ -477,8 +476,6 @@ class GeneralDIT(nn.Module):
|
||||
inputs["original_shape"],
|
||||
)
|
||||
extra_pos_emb_B_T_H_W_D_or_T_H_W_B_D = inputs["extra_pos_emb_B_T_H_W_D_or_T_H_W_B_D"].to(x.dtype)
|
||||
del inputs
|
||||
|
||||
if extra_pos_emb_B_T_H_W_D_or_T_H_W_B_D is not None:
|
||||
assert (
|
||||
x.shape == extra_pos_emb_B_T_H_W_D_or_T_H_W_B_D.shape
|
||||
@@ -489,8 +486,6 @@ class GeneralDIT(nn.Module):
|
||||
self.blocks["block0"].x_format == block.x_format
|
||||
), f"First block has x_format {self.blocks[0].x_format}, got {block.x_format}"
|
||||
|
||||
if extra_pos_emb_B_T_H_W_D_or_T_H_W_B_D is not None:
|
||||
x += extra_pos_emb_B_T_H_W_D_or_T_H_W_B_D
|
||||
x = block(
|
||||
x,
|
||||
affline_emb_B_D,
|
||||
@@ -498,6 +493,7 @@ class GeneralDIT(nn.Module):
|
||||
crossattn_mask,
|
||||
rope_emb_L_1_1_D=rope_emb_L_1_1_D,
|
||||
adaln_lora_B_3D=adaln_lora_B_3D,
|
||||
extra_per_block_pos_emb=extra_pos_emb_B_T_H_W_D_or_T_H_W_B_D,
|
||||
)
|
||||
|
||||
x_B_T_H_W_D = rearrange(x, "T H W B D -> B T H W D")
|
||||
|
||||
@@ -41,12 +41,12 @@ def normalize(x: torch.Tensor, dim: Optional[List[int]] = None, eps: float = 0)
|
||||
|
||||
|
||||
class VideoPositionEmb(nn.Module):
|
||||
def forward(self, x_B_T_H_W_C: torch.Tensor, fps=Optional[torch.Tensor], device=None, dtype=None) -> torch.Tensor:
|
||||
def forward(self, x_B_T_H_W_C: torch.Tensor, fps=Optional[torch.Tensor], device=None) -> torch.Tensor:
|
||||
"""
|
||||
It delegates the embedding generation to generate_embeddings function.
|
||||
"""
|
||||
B_T_H_W_C = x_B_T_H_W_C.shape
|
||||
embeddings = self.generate_embeddings(B_T_H_W_C, fps=fps, device=device, dtype=dtype)
|
||||
embeddings = self.generate_embeddings(B_T_H_W_C, fps=fps, device=device)
|
||||
|
||||
return embeddings
|
||||
|
||||
@@ -104,7 +104,6 @@ class VideoRopePosition3DEmb(VideoPositionEmb):
|
||||
w_ntk_factor: Optional[float] = None,
|
||||
t_ntk_factor: Optional[float] = None,
|
||||
device=None,
|
||||
dtype=None,
|
||||
):
|
||||
"""
|
||||
Generate embeddings for the given input size.
|
||||
@@ -174,7 +173,6 @@ class LearnablePosEmbAxis(VideoPositionEmb):
|
||||
len_w: int,
|
||||
len_t: int,
|
||||
device=None,
|
||||
dtype=None,
|
||||
**kwargs,
|
||||
):
|
||||
"""
|
||||
@@ -186,16 +184,17 @@ class LearnablePosEmbAxis(VideoPositionEmb):
|
||||
self.interpolation = interpolation
|
||||
assert self.interpolation in ["crop"], f"Unknown interpolation method {self.interpolation}"
|
||||
|
||||
self.pos_emb_h = nn.Parameter(torch.empty(len_h, model_channels, device=device, dtype=dtype))
|
||||
self.pos_emb_w = nn.Parameter(torch.empty(len_w, model_channels, device=device, dtype=dtype))
|
||||
self.pos_emb_t = nn.Parameter(torch.empty(len_t, model_channels, device=device, dtype=dtype))
|
||||
self.pos_emb_h = nn.Parameter(torch.empty(len_h, model_channels, device=device))
|
||||
self.pos_emb_w = nn.Parameter(torch.empty(len_w, model_channels, device=device))
|
||||
self.pos_emb_t = nn.Parameter(torch.empty(len_t, model_channels, device=device))
|
||||
|
||||
def generate_embeddings(self, B_T_H_W_C: torch.Size, fps=Optional[torch.Tensor], device=None, dtype=None) -> torch.Tensor:
|
||||
|
||||
def generate_embeddings(self, B_T_H_W_C: torch.Size, fps=Optional[torch.Tensor], device=None) -> torch.Tensor:
|
||||
B, T, H, W, _ = B_T_H_W_C
|
||||
if self.interpolation == "crop":
|
||||
emb_h_H = self.pos_emb_h[:H].to(device=device, dtype=dtype)
|
||||
emb_w_W = self.pos_emb_w[:W].to(device=device, dtype=dtype)
|
||||
emb_t_T = self.pos_emb_t[:T].to(device=device, dtype=dtype)
|
||||
emb_h_H = self.pos_emb_h[:H].to(device=device)
|
||||
emb_w_W = self.pos_emb_w[:W].to(device=device)
|
||||
emb_t_T = self.pos_emb_t[:T].to(device=device)
|
||||
emb = (
|
||||
repeat(emb_t_T, "t d-> b t h w d", b=B, h=H, w=W)
|
||||
+ repeat(emb_h_H, "h d-> b t h w d", b=B, t=T, w=W)
|
||||
|
||||
@@ -18,7 +18,6 @@ import logging
|
||||
import torch
|
||||
from torch import nn
|
||||
from enum import Enum
|
||||
import math
|
||||
|
||||
from .cosmos_tokenizer.layers3d import (
|
||||
EncoderFactorized,
|
||||
@@ -90,8 +89,8 @@ class CausalContinuousVideoTokenizer(nn.Module):
|
||||
self.distribution = IdentityDistribution() # ContinuousFormulation[formulation_name].value()
|
||||
|
||||
num_parameters = sum(param.numel() for param in self.parameters())
|
||||
logging.debug(f"model={self.name}, num_parameters={num_parameters:,}")
|
||||
logging.debug(
|
||||
logging.info(f"model={self.name}, num_parameters={num_parameters:,}")
|
||||
logging.info(
|
||||
f"z_channels={z_channels}, latent_channels={self.latent_channels}."
|
||||
)
|
||||
|
||||
@@ -106,23 +105,17 @@ class CausalContinuousVideoTokenizer(nn.Module):
|
||||
z, posteriors = self.distribution(moments)
|
||||
latent_ch = z.shape[1]
|
||||
latent_t = z.shape[2]
|
||||
in_dtype = z.dtype
|
||||
mean = self.latent_mean.view(latent_ch, -1)
|
||||
std = self.latent_std.view(latent_ch, -1)
|
||||
|
||||
mean = mean.repeat(1, math.ceil(latent_t / mean.shape[-1]))[:, : latent_t].reshape([1, latent_ch, -1, 1, 1]).to(dtype=in_dtype, device=z.device)
|
||||
std = std.repeat(1, math.ceil(latent_t / std.shape[-1]))[:, : latent_t].reshape([1, latent_ch, -1, 1, 1]).to(dtype=in_dtype, device=z.device)
|
||||
dtype = z.dtype
|
||||
mean = self.latent_mean.view(latent_ch, -1)[:, : latent_t].reshape([1, latent_ch, -1, 1, 1]).to(dtype=dtype, device=z.device)
|
||||
std = self.latent_std.view(latent_ch, -1)[:, : latent_t].reshape([1, latent_ch, -1, 1, 1]).to(dtype=dtype, device=z.device)
|
||||
return ((z - mean) / std) * self.sigma_data
|
||||
|
||||
def decode(self, z):
|
||||
in_dtype = z.dtype
|
||||
latent_ch = z.shape[1]
|
||||
latent_t = z.shape[2]
|
||||
mean = self.latent_mean.view(latent_ch, -1)
|
||||
std = self.latent_std.view(latent_ch, -1)
|
||||
|
||||
mean = mean.repeat(1, math.ceil(latent_t / mean.shape[-1]))[:, : latent_t].reshape([1, latent_ch, -1, 1, 1]).to(dtype=in_dtype, device=z.device)
|
||||
std = std.repeat(1, math.ceil(latent_t / std.shape[-1]))[:, : latent_t].reshape([1, latent_ch, -1, 1, 1]).to(dtype=in_dtype, device=z.device)
|
||||
mean = self.latent_mean.view(latent_ch, -1)[:, : latent_t].reshape([1, latent_ch, -1, 1, 1]).to(dtype=in_dtype, device=z.device)
|
||||
std = self.latent_std.view(latent_ch, -1)[:, : latent_t].reshape([1, latent_ch, -1, 1, 1]).to(dtype=in_dtype, device=z.device)
|
||||
|
||||
z = z / self.sigma_data
|
||||
z = z * std + mean
|
||||
|
||||
@@ -230,7 +230,8 @@ class SingleStreamBlock(nn.Module):
|
||||
|
||||
def forward(self, x: Tensor, vec: Tensor, pe: Tensor, attn_mask=None) -> Tensor:
|
||||
mod, _ = self.modulation(vec)
|
||||
qkv, mlp = torch.split(self.linear1((1 + mod.scale) * self.pre_norm(x) + mod.shift), [3 * self.hidden_size, self.mlp_hidden_dim], dim=-1)
|
||||
x_mod = (1 + mod.scale) * self.pre_norm(x) + mod.shift
|
||||
qkv, mlp = torch.split(self.linear1(x_mod), [3 * self.hidden_size, self.mlp_hidden_dim], dim=-1)
|
||||
|
||||
q, k, v = qkv.view(qkv.shape[0], qkv.shape[1], 3, self.num_heads, -1).permute(2, 0, 3, 1, 4)
|
||||
q, k = self.norm(q, k, v)
|
||||
|
||||
@@ -5,15 +5,8 @@ from torch import Tensor
|
||||
from comfy.ldm.modules.attention import optimized_attention
|
||||
import comfy.model_management
|
||||
|
||||
|
||||
def attention(q: Tensor, k: Tensor, v: Tensor, pe: Tensor, mask=None) -> Tensor:
|
||||
q_shape = q.shape
|
||||
k_shape = k.shape
|
||||
|
||||
q = q.float().reshape(*q.shape[:-1], -1, 1, 2)
|
||||
k = k.float().reshape(*k.shape[:-1], -1, 1, 2)
|
||||
q = (pe[..., 0] * q[..., 0] + pe[..., 1] * q[..., 1]).reshape(*q_shape).type_as(v)
|
||||
k = (pe[..., 0] * k[..., 0] + pe[..., 1] * k[..., 1]).reshape(*k_shape).type_as(v)
|
||||
q, k = apply_rope(q, k, pe)
|
||||
|
||||
heads = q.shape[1]
|
||||
x = optimized_attention(q, k, v, heads, skip_reshape=True, mask=mask)
|
||||
|
||||
@@ -109,7 +109,8 @@ class Flux(nn.Module):
|
||||
img = self.img_in(img)
|
||||
vec = self.time_in(timestep_embedding(timesteps, 256).to(img.dtype))
|
||||
if self.params.guidance_embed:
|
||||
if guidance is not None:
|
||||
if guidance is None:
|
||||
raise ValueError("Didn't get guidance strength for guidance distilled model.")
|
||||
vec = vec + self.guidance_in(timestep_embedding(guidance, 256).to(img.dtype))
|
||||
|
||||
vec = vec + self.vector_in(y[:,:self.params.vec_in_dim])
|
||||
@@ -185,7 +186,7 @@ class Flux(nn.Module):
|
||||
img = self.final_layer(img, vec) # (N, T, patch_size ** 2 * out_channels)
|
||||
return img
|
||||
|
||||
def forward(self, x, timestep, context, y, guidance=None, control=None, transformer_options={}, **kwargs):
|
||||
def forward(self, x, timestep, context, y, guidance, control=None, transformer_options={}, **kwargs):
|
||||
bs, c, h, w = x.shape
|
||||
patch_size = self.patch_size
|
||||
x = comfy.ldm.common_dit.pad_to_patch_size(x, (patch_size, patch_size))
|
||||
|
||||
@@ -240,7 +240,8 @@ class HunyuanVideo(nn.Module):
|
||||
vec = vec + self.vector_in(y[:, :self.params.vec_in_dim])
|
||||
|
||||
if self.params.guidance_embed:
|
||||
if guidance is not None:
|
||||
if guidance is None:
|
||||
raise ValueError("Didn't get guidance strength for guidance distilled model.")
|
||||
vec = vec + self.guidance_in(timestep_embedding(guidance, 256).to(img.dtype))
|
||||
|
||||
if txt_mask is not None and not torch.is_floating_point(txt_mask):
|
||||
@@ -313,7 +314,7 @@ class HunyuanVideo(nn.Module):
|
||||
img = img.reshape(initial_shape)
|
||||
return img
|
||||
|
||||
def forward(self, x, timestep, context, y, guidance=None, attention_mask=None, control=None, transformer_options={}, **kwargs):
|
||||
def forward(self, x, timestep, context, y, guidance, attention_mask=None, control=None, transformer_options={}, **kwargs):
|
||||
bs, c, t, h, w = x.shape
|
||||
patch_size = self.patch_size
|
||||
t_len = ((t + (patch_size[0] // 2)) // patch_size[0])
|
||||
|
||||
@@ -293,17 +293,6 @@ def pytorch_attention(q, k, v):
|
||||
return out
|
||||
|
||||
|
||||
def vae_attention():
|
||||
if model_management.xformers_enabled_vae():
|
||||
logging.info("Using xformers attention in VAE")
|
||||
return xformers_attention
|
||||
elif model_management.pytorch_attention_enabled():
|
||||
logging.info("Using pytorch attention in VAE")
|
||||
return pytorch_attention
|
||||
else:
|
||||
logging.info("Using split attention in VAE")
|
||||
return normal_attention
|
||||
|
||||
class AttnBlock(nn.Module):
|
||||
def __init__(self, in_channels, conv_op=ops.Conv2d):
|
||||
super().__init__()
|
||||
@@ -331,7 +320,15 @@ class AttnBlock(nn.Module):
|
||||
stride=1,
|
||||
padding=0)
|
||||
|
||||
self.optimized_attention = vae_attention()
|
||||
if model_management.xformers_enabled_vae():
|
||||
logging.info("Using xformers attention in VAE")
|
||||
self.optimized_attention = xformers_attention
|
||||
elif model_management.pytorch_attention_enabled():
|
||||
logging.info("Using pytorch attention in VAE")
|
||||
self.optimized_attention = pytorch_attention
|
||||
else:
|
||||
logging.info("Using split attention in VAE")
|
||||
self.optimized_attention = normal_attention
|
||||
|
||||
def forward(self, x):
|
||||
h_ = x
|
||||
|
||||
@@ -148,9 +148,7 @@ class BaseModel(torch.nn.Module):
|
||||
|
||||
xc = xc.to(dtype)
|
||||
t = self.model_sampling.timestep(t).float()
|
||||
if context is not None:
|
||||
context = context.to(dtype)
|
||||
|
||||
extra_conds = {}
|
||||
for o in kwargs:
|
||||
extra = kwargs[o]
|
||||
@@ -551,10 +549,6 @@ class SD_X4Upscaler(BaseModel):
|
||||
|
||||
out['c_concat'] = comfy.conds.CONDNoiseShape(image)
|
||||
out['y'] = comfy.conds.CONDRegular(noise_level)
|
||||
|
||||
cross_attn = kwargs.get("cross_attn", None)
|
||||
if cross_attn is not None:
|
||||
out['c_crossattn'] = comfy.conds.CONDCrossAttn(cross_attn)
|
||||
return out
|
||||
|
||||
class IP2P:
|
||||
@@ -812,10 +806,7 @@ class Flux(BaseModel):
|
||||
(h_tok, w_tok) = (math.ceil(shape[2] / self.diffusion_model.patch_size), math.ceil(shape[3] / self.diffusion_model.patch_size))
|
||||
attention_mask = utils.upscale_dit_mask(attention_mask, mask_ref_size, (h_tok, w_tok))
|
||||
out['attention_mask'] = comfy.conds.CONDRegular(attention_mask)
|
||||
|
||||
guidance = kwargs.get("guidance", 3.5)
|
||||
if guidance is not None:
|
||||
out['guidance'] = comfy.conds.CONDRegular(torch.FloatTensor([guidance]))
|
||||
out['guidance'] = comfy.conds.CONDRegular(torch.FloatTensor([kwargs.get("guidance", 3.5)]))
|
||||
return out
|
||||
|
||||
class GenmoMochi(BaseModel):
|
||||
@@ -872,10 +863,7 @@ class HunyuanVideo(BaseModel):
|
||||
cross_attn = kwargs.get("cross_attn", None)
|
||||
if cross_attn is not None:
|
||||
out['c_crossattn'] = comfy.conds.CONDRegular(cross_attn)
|
||||
|
||||
guidance = kwargs.get("guidance", 6.0)
|
||||
if guidance is not None:
|
||||
out['guidance'] = comfy.conds.CONDRegular(torch.FloatTensor([guidance]))
|
||||
out['guidance'] = comfy.conds.CONDRegular(torch.FloatTensor([kwargs.get("guidance", 6.0)]))
|
||||
return out
|
||||
|
||||
class CosmosVideo(BaseModel):
|
||||
|
||||
@@ -58,6 +58,7 @@ def convert_cond(cond):
|
||||
temp = c[1].copy()
|
||||
model_conds = temp.get("model_conds", {})
|
||||
if c[0] is not None:
|
||||
model_conds["c_crossattn"] = comfy.conds.CONDCrossAttn(c[0]) #TODO: remove
|
||||
temp["cross_attn"] = c[0]
|
||||
temp["model_conds"] = model_conds
|
||||
temp["uuid"] = uuid.uuid4()
|
||||
|
||||
@@ -12,6 +12,7 @@ import collections
|
||||
from comfy import model_management
|
||||
import math
|
||||
import logging
|
||||
import comfy.samplers
|
||||
import comfy.sampler_helpers
|
||||
import comfy.model_patcher
|
||||
import comfy.patcher_extension
|
||||
@@ -177,7 +178,7 @@ def finalize_default_conds(model: 'BaseModel', hooked_to_run: dict[comfy.hooks.H
|
||||
cond = default_conds[i]
|
||||
for x in cond:
|
||||
# do get_area_and_mult to get all the expected values
|
||||
p = get_area_and_mult(x, x_in, timestep)
|
||||
p = comfy.samplers.get_area_and_mult(x, x_in, timestep)
|
||||
if p is None:
|
||||
continue
|
||||
# replace p's mult with calculated mult
|
||||
@@ -214,7 +215,7 @@ def _calc_cond_batch(model: 'BaseModel', conds: list[list[dict]], x_in: torch.Te
|
||||
default_c.append(x)
|
||||
has_default_conds = True
|
||||
continue
|
||||
p = get_area_and_mult(x, x_in, timestep)
|
||||
p = comfy.samplers.get_area_and_mult(x, x_in, timestep)
|
||||
if p is None:
|
||||
continue
|
||||
if p.hooks is not None:
|
||||
@@ -686,7 +687,7 @@ class Sampler:
|
||||
KSAMPLER_NAMES = ["euler", "euler_cfg_pp", "euler_ancestral", "euler_ancestral_cfg_pp", "heun", "heunpp2","dpm_2", "dpm_2_ancestral",
|
||||
"lms", "dpm_fast", "dpm_adaptive", "dpmpp_2s_ancestral", "dpmpp_2s_ancestral_cfg_pp", "dpmpp_sde", "dpmpp_sde_gpu",
|
||||
"dpmpp_2m", "dpmpp_2m_cfg_pp", "dpmpp_2m_sde", "dpmpp_2m_sde_gpu", "dpmpp_3m_sde", "dpmpp_3m_sde_gpu", "ddpm", "lcm",
|
||||
"ipndm", "ipndm_v", "deis", "res_multistep", "res_multistep_cfg_pp", "gradient_estimation"]
|
||||
"ipndm", "ipndm_v", "deis", "res_multistep", "res_multistep_cfg_pp"]
|
||||
|
||||
class KSAMPLER(Sampler):
|
||||
def __init__(self, sampler_function, extra_options={}, inpaint_options={}):
|
||||
|
||||
@@ -388,8 +388,8 @@ class VAE:
|
||||
ddconfig = {'z_channels': 16, 'latent_channels': self.latent_channels, 'z_factor': 1, 'resolution': 1024, 'in_channels': 3, 'out_channels': 3, 'channels': 128, 'channels_mult': [2, 4, 4], 'num_res_blocks': 2, 'attn_resolutions': [32], 'dropout': 0.0, 'patch_size': 4, 'num_groups': 1, 'temporal_compression': 8, 'spacial_compression': 8}
|
||||
self.first_stage_model = comfy.ldm.cosmos.vae.CausalContinuousVideoTokenizer(**ddconfig)
|
||||
#TODO: these values are a bit off because this is not a standard VAE
|
||||
self.memory_used_decode = lambda shape, dtype: (50 * shape[2] * shape[3] * shape[4] * (8 * 8 * 8)) * model_management.dtype_size(dtype)
|
||||
self.memory_used_encode = lambda shape, dtype: (50 * (round((shape[2] + 7) / 8) * 8) * shape[3] * shape[4]) * model_management.dtype_size(dtype)
|
||||
self.memory_used_decode = lambda shape, dtype: (220 * shape[2] * shape[3] * shape[4] * (8 * 8 * 8)) * model_management.dtype_size(dtype)
|
||||
self.memory_used_encode = lambda shape, dtype: (500 * max(shape[2], 2) * shape[3] * shape[4]) * model_management.dtype_size(dtype)
|
||||
self.working_dtypes = [torch.bfloat16, torch.float32]
|
||||
else:
|
||||
logging.warning("WARNING: No VAE weights detected, VAE not initalized.")
|
||||
|
||||
@@ -788,7 +788,7 @@ class HunyuanVideo(supported_models_base.BASE):
|
||||
unet_extra_config = {}
|
||||
latent_format = latent_formats.HunyuanVideo
|
||||
|
||||
memory_usage_factor = 1.8 #TODO
|
||||
memory_usage_factor = 2.0 #TODO
|
||||
|
||||
supported_inference_dtypes = [torch.bfloat16, torch.float32]
|
||||
|
||||
@@ -839,7 +839,7 @@ class CosmosT2V(supported_models_base.BASE):
|
||||
unet_extra_config = {}
|
||||
latent_format = latent_formats.Cosmos1CV8x8x8
|
||||
|
||||
memory_usage_factor = 1.6 #TODO
|
||||
memory_usage_factor = 2.4 #TODO
|
||||
|
||||
supported_inference_dtypes = [torch.bfloat16, torch.float16, torch.float32] #TODO
|
||||
|
||||
|
||||
@@ -43,8 +43,7 @@ if hasattr(torch.serialization, "add_safe_globals"): # TODO: this was added in
|
||||
torch.serialization.add_safe_globals([ModelCheckpoint, scalar, dtype, Float64DType, encode])
|
||||
ALWAYS_SAFE_LOAD = True
|
||||
logging.info("Checkpoint files will always be loaded safely.")
|
||||
else:
|
||||
logging.info("Warning, you are using an old pytorch version and some ckpt/pt files might be loaded unsafely. Upgrading to 2.4 or above is recommended.")
|
||||
|
||||
|
||||
def load_torch_file(ckpt, safe_load=False, device=None):
|
||||
if device is None:
|
||||
|
||||
@@ -71,8 +71,8 @@ class CosmosImageToVideoLatent:
|
||||
mask[:, :, -latent_temp.shape[-3]:] *= 0.0
|
||||
|
||||
out_latent = {}
|
||||
out_latent["samples"] = latent.repeat((batch_size, ) + (1,) * (latent.ndim - 1))
|
||||
out_latent["noise_mask"] = mask.repeat((batch_size, ) + (1,) * (mask.ndim - 1))
|
||||
out_latent["samples"] = latent
|
||||
out_latent["noise_mask"] = mask
|
||||
return (out_latent,)
|
||||
|
||||
|
||||
|
||||
@@ -38,26 +38,7 @@ class FluxGuidance:
|
||||
return (c, )
|
||||
|
||||
|
||||
class FluxDisableGuidance:
|
||||
@classmethod
|
||||
def INPUT_TYPES(s):
|
||||
return {"required": {
|
||||
"conditioning": ("CONDITIONING", ),
|
||||
}}
|
||||
|
||||
RETURN_TYPES = ("CONDITIONING",)
|
||||
FUNCTION = "append"
|
||||
|
||||
CATEGORY = "advanced/conditioning/flux"
|
||||
DESCRIPTION = "This node completely disables the guidance embed on Flux and Flux like models"
|
||||
|
||||
def append(self, conditioning):
|
||||
c = node_helpers.conditioning_set_values(conditioning, {"guidance": None})
|
||||
return (c, )
|
||||
|
||||
|
||||
NODE_CLASS_MAPPINGS = {
|
||||
"CLIPTextEncodeFlux": CLIPTextEncodeFlux,
|
||||
"FluxGuidance": FluxGuidance,
|
||||
"FluxDisableGuidance": FluxDisableGuidance,
|
||||
}
|
||||
|
||||
@@ -2,14 +2,10 @@ import comfy.utils
|
||||
import comfy_extras.nodes_post_processing
|
||||
import torch
|
||||
|
||||
|
||||
def reshape_latent_to(target_shape, latent, repeat_batch=True):
|
||||
def reshape_latent_to(target_shape, latent):
|
||||
if latent.shape[1:] != target_shape[1:]:
|
||||
latent = comfy.utils.common_upscale(latent, target_shape[-1], target_shape[-2], "bilinear", "center")
|
||||
if repeat_batch:
|
||||
latent = comfy.utils.common_upscale(latent, target_shape[3], target_shape[2], "bilinear", "center")
|
||||
return comfy.utils.repeat_to_batch_size(latent, target_shape[0])
|
||||
else:
|
||||
return latent
|
||||
|
||||
|
||||
class LatentAdd:
|
||||
@@ -120,7 +116,8 @@ class LatentBatch:
|
||||
s1 = samples1["samples"]
|
||||
s2 = samples2["samples"]
|
||||
|
||||
s2 = reshape_latent_to(s1.shape, s2, repeat_batch=False)
|
||||
if s1.shape[1:] != s2.shape[1:]:
|
||||
s2 = comfy.utils.common_upscale(s2, s1.shape[3], s1.shape[2], "bilinear", "center")
|
||||
s = torch.cat((s1, s2), dim=0)
|
||||
samples_out["samples"] = s
|
||||
samples_out["batch_index"] = samples1.get("batch_index", [x for x in range(0, s1.shape[0])]) + samples2.get("batch_index", [x for x in range(0, s2.shape[0])])
|
||||
|
||||
@@ -19,6 +19,9 @@ class Load3D():
|
||||
"image": ("LOAD_3D", {}),
|
||||
"width": ("INT", {"default": 1024, "min": 1, "max": 4096, "step": 1}),
|
||||
"height": ("INT", {"default": 1024, "min": 1, "max": 4096, "step": 1}),
|
||||
"show_grid": ([True, False],),
|
||||
"camera_type": (["perspective", "orthographic"],),
|
||||
"view": (["front", "right", "top", "isometric"],),
|
||||
"material": (["original", "normal", "wireframe", "depth"],),
|
||||
"bg_color": ("STRING", {"default": "#000000", "multiline": False}),
|
||||
"light_intensity": ("INT", {"default": 10, "min": 1, "max": 20, "step": 1}),
|
||||
@@ -66,6 +69,9 @@ class Load3DAnimation():
|
||||
"image": ("LOAD_3D_ANIMATION", {}),
|
||||
"width": ("INT", {"default": 1024, "min": 1, "max": 4096, "step": 1}),
|
||||
"height": ("INT", {"default": 1024, "min": 1, "max": 4096, "step": 1}),
|
||||
"show_grid": ([True, False],),
|
||||
"camera_type": (["perspective", "orthographic"],),
|
||||
"view": (["front", "right", "top", "isometric"],),
|
||||
"material": (["original", "normal", "wireframe", "depth"],),
|
||||
"bg_color": ("STRING", {"default": "#000000", "multiline": False}),
|
||||
"light_intensity": ("INT", {"default": 10, "min": 1, "max": 20, "step": 1}),
|
||||
@@ -103,6 +109,9 @@ class Preview3D():
|
||||
def INPUT_TYPES(s):
|
||||
return {"required": {
|
||||
"model_file": ("STRING", {"default": "", "multiline": False}),
|
||||
"show_grid": ([True, False],),
|
||||
"camera_type": (["perspective", "orthographic"],),
|
||||
"view": (["front", "right", "top", "isometric"],),
|
||||
"material": (["original", "normal", "wireframe", "depth"],),
|
||||
"bg_color": ("STRING", {"default": "#000000", "multiline": False}),
|
||||
"light_intensity": ("INT", {"default": 10, "min": 1, "max": 20, "step": 1}),
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
# This file is automatically generated by the build process when version is
|
||||
# updated in pyproject.toml.
|
||||
__version__ = "0.3.12"
|
||||
__version__ = "0.3.10"
|
||||
|
||||
@@ -11,8 +11,7 @@ supported_pt_extensions: set[str] = {'.ckpt', '.pt', '.bin', '.pth', '.safetenso
|
||||
|
||||
folder_names_and_paths: dict[str, tuple[list[str], set[str]]] = {}
|
||||
|
||||
env_base_path = os.environ.get("COMFYUI_FOLDERS_BASE_PATH")
|
||||
base_path = os.path.dirname(os.path.realpath(__file__)) if env_base_path is None else env_base_path
|
||||
base_path = os.path.dirname(os.path.realpath(__file__))
|
||||
models_dir = os.path.join(base_path, "models")
|
||||
folder_names_and_paths["checkpoints"] = ([os.path.join(models_dir, "checkpoints")], supported_pt_extensions)
|
||||
folder_names_and_paths["configs"] = ([os.path.join(models_dir, "configs")], [".yaml"])
|
||||
|
||||
11
main.py
11
main.py
@@ -138,6 +138,8 @@ import server
|
||||
from server import BinaryEventTypes
|
||||
import nodes
|
||||
import comfy.model_management
|
||||
from app.database.db import can_create_session, init_db
|
||||
from app.model_processor import model_processor
|
||||
|
||||
def cuda_malloc_warning():
|
||||
device = comfy.model_management.get_torch_device()
|
||||
@@ -262,6 +264,11 @@ def start_comfyui(asyncio_loop=None):
|
||||
|
||||
cuda_malloc_warning()
|
||||
|
||||
try:
|
||||
init_db()
|
||||
except Exception as e:
|
||||
logging.error(f"Failed to initialize database. Please report this error as in future the database will be required: {e}")
|
||||
|
||||
prompt_server.add_routes()
|
||||
hijack_progress(prompt_server)
|
||||
|
||||
@@ -270,6 +277,10 @@ def start_comfyui(asyncio_loop=None):
|
||||
if args.quick_test_for_ci:
|
||||
exit(0)
|
||||
|
||||
# Scan for changed model files and update db
|
||||
if can_create_session():
|
||||
model_processor.run()
|
||||
|
||||
os.makedirs(folder_paths.get_temp_directory(), exist_ok=True)
|
||||
call_on_start = None
|
||||
if args.auto_launch:
|
||||
|
||||
2
nodes.py
2
nodes.py
@@ -937,8 +937,6 @@ class CLIPLoader:
|
||||
clip_type = comfy.sd.CLIPType.LTXV
|
||||
elif type == "pixart":
|
||||
clip_type = comfy.sd.CLIPType.PIXART
|
||||
elif type == "cosmos":
|
||||
clip_type = comfy.sd.CLIPType.COSMOS
|
||||
else:
|
||||
clip_type = comfy.sd.CLIPType.STABLE_DIFFUSION
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "ComfyUI"
|
||||
version = "0.3.12"
|
||||
version = "0.3.10"
|
||||
readme = "README.md"
|
||||
license = { file = "LICENSE" }
|
||||
requires-python = ">=3.9"
|
||||
|
||||
@@ -2,7 +2,6 @@ torch
|
||||
torchsde
|
||||
torchvision
|
||||
torchaudio
|
||||
numpy>=1.25.0
|
||||
einops
|
||||
transformers>=4.28.1
|
||||
tokenizers>=0.13.3
|
||||
@@ -14,6 +13,8 @@ Pillow
|
||||
scipy
|
||||
tqdm
|
||||
psutil
|
||||
alembic
|
||||
SQLAlchemy
|
||||
|
||||
#non essential dependencies:
|
||||
kornia>=0.7.1
|
||||
|
||||
@@ -329,9 +329,6 @@ class PromptServer():
|
||||
original_ref = json.loads(post.get("original_ref"))
|
||||
filename, output_dir = folder_paths.annotated_filepath(original_ref['filename'])
|
||||
|
||||
if not filename:
|
||||
return web.Response(status=400)
|
||||
|
||||
# validation for security: prevent accessing arbitrary path
|
||||
if filename[0] == '/' or '..' in filename:
|
||||
return web.Response(status=400)
|
||||
@@ -373,9 +370,6 @@ class PromptServer():
|
||||
filename = request.rel_url.query["filename"]
|
||||
filename,output_dir = folder_paths.annotated_filepath(filename)
|
||||
|
||||
if not filename:
|
||||
return web.Response(status=400)
|
||||
|
||||
# validation for security: prevent accessing arbitrary path
|
||||
if filename[0] == '/' or '..' in filename:
|
||||
return web.Response(status=400)
|
||||
|
||||
@@ -2,146 +2,39 @@ import pytest
|
||||
from aiohttp import web
|
||||
from unittest.mock import patch
|
||||
from app.custom_node_manager import CustomNodeManager
|
||||
import json
|
||||
|
||||
pytestmark = (
|
||||
pytest.mark.asyncio
|
||||
) # This applies the asyncio mark to all test functions in the module
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def custom_node_manager():
|
||||
return CustomNodeManager()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def app(custom_node_manager):
|
||||
app = web.Application()
|
||||
routes = web.RouteTableDef()
|
||||
custom_node_manager.add_routes(
|
||||
routes, app, [("ComfyUI-TestExtension1", "ComfyUI-TestExtension1")]
|
||||
)
|
||||
custom_node_manager.add_routes(routes, app, [("ComfyUI-TestExtension1", "ComfyUI-TestExtension1")])
|
||||
app.add_routes(routes)
|
||||
return app
|
||||
|
||||
|
||||
async def test_get_workflow_templates(aiohttp_client, app, tmp_path):
|
||||
client = await aiohttp_client(app)
|
||||
# Setup temporary custom nodes file structure with 1 workflow file
|
||||
custom_nodes_dir = tmp_path / "custom_nodes"
|
||||
example_workflows_dir = (
|
||||
custom_nodes_dir / "ComfyUI-TestExtension1" / "example_workflows"
|
||||
)
|
||||
example_workflows_dir = custom_nodes_dir / "ComfyUI-TestExtension1" / "example_workflows"
|
||||
example_workflows_dir.mkdir(parents=True)
|
||||
template_file = example_workflows_dir / "workflow1.json"
|
||||
template_file.write_text("")
|
||||
template_file.write_text('')
|
||||
|
||||
with patch(
|
||||
"folder_paths.folder_names_and_paths",
|
||||
{"custom_nodes": ([str(custom_nodes_dir)], None)},
|
||||
):
|
||||
response = await client.get("/workflow_templates")
|
||||
with patch('folder_paths.folder_names_and_paths', {
|
||||
'custom_nodes': ([str(custom_nodes_dir)], None)
|
||||
}):
|
||||
response = await client.get('/workflow_templates')
|
||||
assert response.status == 200
|
||||
workflows_dict = await response.json()
|
||||
assert isinstance(workflows_dict, dict)
|
||||
assert "ComfyUI-TestExtension1" in workflows_dict
|
||||
assert isinstance(workflows_dict["ComfyUI-TestExtension1"], list)
|
||||
assert workflows_dict["ComfyUI-TestExtension1"][0] == "workflow1"
|
||||
|
||||
|
||||
async def test_build_translations_empty_when_no_locales(custom_node_manager, tmp_path):
|
||||
custom_nodes_dir = tmp_path / "custom_nodes"
|
||||
custom_nodes_dir.mkdir(parents=True)
|
||||
|
||||
with patch("folder_paths.get_folder_paths", return_value=[str(custom_nodes_dir)]):
|
||||
translations = custom_node_manager.build_translations()
|
||||
assert translations == {}
|
||||
|
||||
|
||||
async def test_build_translations_loads_all_files(custom_node_manager, tmp_path):
|
||||
# Setup test directory structure
|
||||
custom_nodes_dir = tmp_path / "custom_nodes" / "test-extension"
|
||||
locales_dir = custom_nodes_dir / "locales" / "en"
|
||||
locales_dir.mkdir(parents=True)
|
||||
|
||||
# Create test translation files
|
||||
main_content = {"title": "Test Extension"}
|
||||
(locales_dir / "main.json").write_text(json.dumps(main_content))
|
||||
|
||||
node_defs = {"node1": "Node 1"}
|
||||
(locales_dir / "nodeDefs.json").write_text(json.dumps(node_defs))
|
||||
|
||||
commands = {"cmd1": "Command 1"}
|
||||
(locales_dir / "commands.json").write_text(json.dumps(commands))
|
||||
|
||||
settings = {"setting1": "Setting 1"}
|
||||
(locales_dir / "settings.json").write_text(json.dumps(settings))
|
||||
|
||||
with patch(
|
||||
"folder_paths.get_folder_paths", return_value=[tmp_path / "custom_nodes"]
|
||||
):
|
||||
translations = custom_node_manager.build_translations()
|
||||
|
||||
assert translations == {
|
||||
"en": {
|
||||
"title": "Test Extension",
|
||||
"nodeDefs": {"node1": "Node 1"},
|
||||
"commands": {"cmd1": "Command 1"},
|
||||
"settings": {"setting1": "Setting 1"},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
async def test_build_translations_handles_invalid_json(custom_node_manager, tmp_path):
|
||||
# Setup test directory structure
|
||||
custom_nodes_dir = tmp_path / "custom_nodes" / "test-extension"
|
||||
locales_dir = custom_nodes_dir / "locales" / "en"
|
||||
locales_dir.mkdir(parents=True)
|
||||
|
||||
# Create valid main.json
|
||||
main_content = {"title": "Test Extension"}
|
||||
(locales_dir / "main.json").write_text(json.dumps(main_content))
|
||||
|
||||
# Create invalid JSON file
|
||||
(locales_dir / "nodeDefs.json").write_text("invalid json{")
|
||||
|
||||
with patch(
|
||||
"folder_paths.get_folder_paths", return_value=[tmp_path / "custom_nodes"]
|
||||
):
|
||||
translations = custom_node_manager.build_translations()
|
||||
|
||||
assert translations == {
|
||||
"en": {
|
||||
"title": "Test Extension",
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
async def test_build_translations_merges_multiple_extensions(
|
||||
custom_node_manager, tmp_path
|
||||
):
|
||||
# Setup test directory structure for two extensions
|
||||
custom_nodes_dir = tmp_path / "custom_nodes"
|
||||
ext1_dir = custom_nodes_dir / "extension1" / "locales" / "en"
|
||||
ext2_dir = custom_nodes_dir / "extension2" / "locales" / "en"
|
||||
ext1_dir.mkdir(parents=True)
|
||||
ext2_dir.mkdir(parents=True)
|
||||
|
||||
# Create translation files for extension 1
|
||||
ext1_main = {"title": "Extension 1", "shared": "Original"}
|
||||
(ext1_dir / "main.json").write_text(json.dumps(ext1_main))
|
||||
|
||||
# Create translation files for extension 2
|
||||
ext2_main = {"description": "Extension 2", "shared": "Override"}
|
||||
(ext2_dir / "main.json").write_text(json.dumps(ext2_main))
|
||||
|
||||
with patch("folder_paths.get_folder_paths", return_value=[str(custom_nodes_dir)]):
|
||||
translations = custom_node_manager.build_translations()
|
||||
|
||||
assert translations == {
|
||||
"en": {
|
||||
"title": "Extension 1",
|
||||
"description": "Extension 2",
|
||||
"shared": "Override", # Second extension should override first
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,11 +7,33 @@ from PIL import Image
|
||||
from aiohttp import web
|
||||
from unittest.mock import patch
|
||||
from app.model_manager import ModelFileManager
|
||||
from app.database.models import Base, Model, Tag
|
||||
from comfy.cli_args import args
|
||||
from sqlalchemy import create_engine
|
||||
from sqlalchemy.orm import sessionmaker
|
||||
|
||||
pytestmark = (
|
||||
pytest.mark.asyncio
|
||||
) # This applies the asyncio mark to all test functions in the module
|
||||
|
||||
@pytest.fixture
|
||||
def session():
|
||||
# Configure in-memory database
|
||||
args.database_url = "sqlite:///:memory:"
|
||||
|
||||
# Create engine and session factory
|
||||
engine = create_engine(args.database_url)
|
||||
Session = sessionmaker(bind=engine)
|
||||
|
||||
# Create all tables
|
||||
Base.metadata.create_all(engine)
|
||||
|
||||
# Patch Session factory
|
||||
with patch('app.database.db.Session', Session):
|
||||
yield Session()
|
||||
|
||||
Base.metadata.drop_all(engine)
|
||||
|
||||
@pytest.fixture
|
||||
def model_manager():
|
||||
return ModelFileManager()
|
||||
@@ -60,3 +82,287 @@ async def test_get_model_preview_safetensors(aiohttp_client, app, tmp_path):
|
||||
|
||||
# Clean up
|
||||
img.close()
|
||||
|
||||
async def test_get_models(aiohttp_client, app, session):
|
||||
tag = Tag(name='test_tag')
|
||||
model = Model(
|
||||
type='checkpoints',
|
||||
path='model1.safetensors',
|
||||
title='Test Model'
|
||||
)
|
||||
model.tags.append(tag)
|
||||
session.add(tag)
|
||||
session.add(model)
|
||||
session.commit()
|
||||
|
||||
client = await aiohttp_client(app)
|
||||
resp = await client.get('/v2/models')
|
||||
assert resp.status == 200
|
||||
data = await resp.json()
|
||||
assert len(data) == 1
|
||||
assert data[0]['path'] == 'model1.safetensors'
|
||||
assert len(data[0]['tags']) == 1
|
||||
assert data[0]['tags'][0]['name'] == 'test_tag'
|
||||
|
||||
async def test_add_model(aiohttp_client, app, session):
|
||||
tag = Tag(name='test_tag')
|
||||
session.add(tag)
|
||||
session.commit()
|
||||
tag_id = tag.id
|
||||
|
||||
with patch('app.model_manager.model_processor') as mock_processor:
|
||||
with patch('app.model_manager.get_full_path', return_value='/checkpoints/model1.safetensors'):
|
||||
client = await aiohttp_client(app)
|
||||
resp = await client.post('/v2/models', json={
|
||||
'type': 'checkpoints',
|
||||
'path': 'model1.safetensors',
|
||||
'title': 'Test Model',
|
||||
'tags': [tag_id]
|
||||
})
|
||||
|
||||
assert resp.status == 200
|
||||
data = await resp.json()
|
||||
assert data['path'] == 'model1.safetensors'
|
||||
assert len(data['tags']) == 1
|
||||
assert data['tags'][0]['name'] == 'test_tag'
|
||||
|
||||
# Ensure that models are re-processed after adding
|
||||
mock_processor.run.assert_called_once()
|
||||
|
||||
async def test_delete_model(aiohttp_client, app, session):
|
||||
model = Model(
|
||||
type='checkpoints',
|
||||
path='model1.safetensors',
|
||||
title='Test Model'
|
||||
)
|
||||
session.add(model)
|
||||
session.commit()
|
||||
|
||||
with patch('app.model_manager.get_full_path', return_value=None):
|
||||
client = await aiohttp_client(app)
|
||||
resp = await client.delete('/v2/models?type=checkpoints&path=model1.safetensors')
|
||||
assert resp.status == 204
|
||||
|
||||
# Verify model was deleted
|
||||
model = session.query(Model).first()
|
||||
assert model is None
|
||||
|
||||
async def test_delete_model_file_exists(aiohttp_client, app, session):
|
||||
model = Model(
|
||||
type='checkpoints',
|
||||
path='model1.safetensors',
|
||||
title='Test Model'
|
||||
)
|
||||
session.add(model)
|
||||
session.commit()
|
||||
|
||||
with patch('app.model_manager.get_full_path', return_value='/checkpoints/model1.safetensors'):
|
||||
client = await aiohttp_client(app)
|
||||
resp = await client.delete('/v2/models?type=checkpoints&path=model1.safetensors')
|
||||
assert resp.status == 400
|
||||
|
||||
data = await resp.json()
|
||||
assert "file exists" in data["error"].lower()
|
||||
|
||||
# Verify model was not deleted
|
||||
model = session.query(Model).first()
|
||||
assert model is not None
|
||||
assert model.path == 'model1.safetensors'
|
||||
|
||||
async def test_get_tags(aiohttp_client, app, session):
|
||||
tags = [Tag(name='tag1'), Tag(name='tag2')]
|
||||
for tag in tags:
|
||||
session.add(tag)
|
||||
session.commit()
|
||||
|
||||
client = await aiohttp_client(app)
|
||||
resp = await client.get('/v2/tags')
|
||||
assert resp.status == 200
|
||||
data = await resp.json()
|
||||
assert len(data) == 2
|
||||
assert {t['name'] for t in data} == {'tag1', 'tag2'}
|
||||
|
||||
async def test_create_tag(aiohttp_client, app, session):
|
||||
client = await aiohttp_client(app)
|
||||
resp = await client.post('/v2/tags', json={'name': 'new_tag'})
|
||||
assert resp.status == 200
|
||||
data = await resp.json()
|
||||
assert data['name'] == 'new_tag'
|
||||
|
||||
# Verify tag was created
|
||||
tag = session.query(Tag).first()
|
||||
assert tag.name == 'new_tag'
|
||||
|
||||
async def test_delete_tag(aiohttp_client, app, session):
|
||||
tag = Tag(name='test_tag')
|
||||
session.add(tag)
|
||||
session.commit()
|
||||
tag_id = tag.id
|
||||
|
||||
client = await aiohttp_client(app)
|
||||
resp = await client.delete(f'/v2/tags?id={tag_id}')
|
||||
assert resp.status == 204
|
||||
|
||||
# Verify tag was deleted
|
||||
tag = session.query(Tag).first()
|
||||
assert tag is None
|
||||
|
||||
async def test_add_model_tag(aiohttp_client, app, session):
|
||||
tag = Tag(name='test_tag')
|
||||
model = Model(
|
||||
type='checkpoints',
|
||||
path='model1.safetensors',
|
||||
title='Test Model'
|
||||
)
|
||||
session.add(tag)
|
||||
session.add(model)
|
||||
session.commit()
|
||||
tag_id = tag.id
|
||||
|
||||
client = await aiohttp_client(app)
|
||||
resp = await client.post('/v2/models/tags', json={
|
||||
'tag': tag_id,
|
||||
'type': 'checkpoints',
|
||||
'path': 'model1.safetensors'
|
||||
})
|
||||
assert resp.status == 200
|
||||
data = await resp.json()
|
||||
assert len(data['tags']) == 1
|
||||
assert data['tags'][0]['name'] == 'test_tag'
|
||||
|
||||
async def test_delete_model_tag(aiohttp_client, app, session):
|
||||
tag = Tag(name='test_tag')
|
||||
model = Model(
|
||||
type='checkpoints',
|
||||
path='model1.safetensors',
|
||||
title='Test Model'
|
||||
)
|
||||
model.tags.append(tag)
|
||||
session.add(tag)
|
||||
session.add(model)
|
||||
session.commit()
|
||||
tag_id = tag.id
|
||||
|
||||
client = await aiohttp_client(app)
|
||||
resp = await client.delete(f'/v2/models/tags?tag={tag_id}&type=checkpoints&path=model1.safetensors')
|
||||
assert resp.status == 204
|
||||
|
||||
# Verify tag was removed
|
||||
model = session.query(Model).first()
|
||||
assert len(model.tags) == 0
|
||||
|
||||
async def test_add_model_duplicate(aiohttp_client, app, session):
|
||||
model = Model(
|
||||
type='checkpoints',
|
||||
path='model1.safetensors',
|
||||
title='Test Model'
|
||||
)
|
||||
session.add(model)
|
||||
session.commit()
|
||||
|
||||
with patch('app.model_manager.get_full_path', return_value='/checkpoints/model1.safetensors'):
|
||||
client = await aiohttp_client(app)
|
||||
resp = await client.post('/v2/models', json={
|
||||
'type': 'checkpoints',
|
||||
'path': 'model1.safetensors',
|
||||
'title': 'Duplicate Model'
|
||||
})
|
||||
assert resp.status == 400
|
||||
|
||||
async def test_add_model_missing_fields(aiohttp_client, app, session):
|
||||
client = await aiohttp_client(app)
|
||||
resp = await client.post('/v2/models', json={})
|
||||
assert resp.status == 400
|
||||
|
||||
async def test_add_tag_missing_name(aiohttp_client, app, session):
|
||||
client = await aiohttp_client(app)
|
||||
resp = await client.post('/v2/tags', json={})
|
||||
assert resp.status == 400
|
||||
|
||||
async def test_delete_model_not_found(aiohttp_client, app, session):
|
||||
client = await aiohttp_client(app)
|
||||
resp = await client.delete('/v2/models?type=checkpoints&path=nonexistent.safetensors')
|
||||
assert resp.status == 404
|
||||
|
||||
async def test_delete_tag_not_found(aiohttp_client, app, session):
|
||||
client = await aiohttp_client(app)
|
||||
resp = await client.delete('/v2/tags?id=999')
|
||||
assert resp.status == 404
|
||||
|
||||
async def test_add_model_missing_path(aiohttp_client, app, session):
|
||||
client = await aiohttp_client(app)
|
||||
resp = await client.post('/v2/models', json={
|
||||
'type': 'checkpoints',
|
||||
'title': 'Test Model'
|
||||
})
|
||||
assert resp.status == 400
|
||||
data = await resp.json()
|
||||
assert "path" in data["error"].lower()
|
||||
|
||||
async def test_add_model_invalid_field(aiohttp_client, app, session):
|
||||
client = await aiohttp_client(app)
|
||||
resp = await client.post('/v2/models', json={
|
||||
'type': 'checkpoints',
|
||||
'path': 'model1.safetensors',
|
||||
'invalid_field': 'some value'
|
||||
})
|
||||
assert resp.status == 400
|
||||
data = await resp.json()
|
||||
assert "invalid field" in data["error"].lower()
|
||||
|
||||
async def test_add_model_nonexistent_file(aiohttp_client, app, session):
|
||||
with patch('app.model_manager.get_full_path', return_value=None):
|
||||
client = await aiohttp_client(app)
|
||||
resp = await client.post('/v2/models', json={
|
||||
'type': 'checkpoints',
|
||||
'path': 'nonexistent.safetensors'
|
||||
})
|
||||
assert resp.status == 404
|
||||
data = await resp.json()
|
||||
assert "file" in data["error"].lower()
|
||||
|
||||
async def test_add_model_invalid_tag(aiohttp_client, app, session):
|
||||
with patch('app.model_manager.get_full_path', return_value='/checkpoints/model1.safetensors'):
|
||||
client = await aiohttp_client(app)
|
||||
resp = await client.post('/v2/models', json={
|
||||
'type': 'checkpoints',
|
||||
'path': 'model1.safetensors',
|
||||
'tags': [999] # Non-existent tag ID
|
||||
})
|
||||
assert resp.status == 404
|
||||
data = await resp.json()
|
||||
assert "tag" in data["error"].lower()
|
||||
|
||||
async def test_add_tag_to_nonexistent_model(aiohttp_client, app, session):
|
||||
# Create a tag but no model
|
||||
tag = Tag(name='test_tag')
|
||||
session.add(tag)
|
||||
session.commit()
|
||||
tag_id = tag.id
|
||||
|
||||
client = await aiohttp_client(app)
|
||||
resp = await client.post('/v2/models/tags', json={
|
||||
'tag': tag_id,
|
||||
'type': 'checkpoints',
|
||||
'path': 'nonexistent.safetensors'
|
||||
})
|
||||
assert resp.status == 404
|
||||
data = await resp.json()
|
||||
assert "model" in data["error"].lower()
|
||||
|
||||
async def test_delete_model_tag_invalid_tag_id(aiohttp_client, app, session):
|
||||
# Create a model first
|
||||
model = Model(
|
||||
type='checkpoints',
|
||||
path='model1.safetensors',
|
||||
title='Test Model'
|
||||
)
|
||||
session.add(model)
|
||||
session.commit()
|
||||
|
||||
client = await aiohttp_client(app)
|
||||
resp = await client.delete('/v2/models/tags?tag=not_a_number&type=checkpoint&path=model1.safetensors')
|
||||
assert resp.status == 400
|
||||
data = await resp.json()
|
||||
assert "invalid tag id" in data["error"].lower()
|
||||
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
from utils.json_util import merge_json_recursive
|
||||
|
||||
|
||||
def test_merge_simple_dicts():
|
||||
base = {"a": 1, "b": 2}
|
||||
update = {"b": 3, "c": 4}
|
||||
expected = {"a": 1, "b": 3, "c": 4}
|
||||
assert merge_json_recursive(base, update) == expected
|
||||
|
||||
|
||||
def test_merge_nested_dicts():
|
||||
base = {"a": {"x": 1, "y": 2}, "b": 3}
|
||||
update = {"a": {"y": 4, "z": 5}}
|
||||
expected = {"a": {"x": 1, "y": 4, "z": 5}, "b": 3}
|
||||
assert merge_json_recursive(base, update) == expected
|
||||
|
||||
|
||||
def test_merge_lists():
|
||||
base = {"a": [1, 2], "b": 3}
|
||||
update = {"a": [3, 4]}
|
||||
expected = {"a": [1, 2, 3, 4], "b": 3}
|
||||
assert merge_json_recursive(base, update) == expected
|
||||
|
||||
|
||||
def test_merge_nested_lists():
|
||||
base = {"a": {"x": [1, 2]}}
|
||||
update = {"a": {"x": [3, 4]}}
|
||||
expected = {"a": {"x": [1, 2, 3, 4]}}
|
||||
assert merge_json_recursive(base, update) == expected
|
||||
|
||||
|
||||
def test_merge_mixed_types():
|
||||
base = {"a": [1, 2], "b": {"x": 1}}
|
||||
update = {"a": [3], "b": {"y": 2}}
|
||||
expected = {"a": [1, 2, 3], "b": {"x": 1, "y": 2}}
|
||||
assert merge_json_recursive(base, update) == expected
|
||||
|
||||
|
||||
def test_merge_overwrite_non_dict():
|
||||
base = {"a": 1}
|
||||
update = {"a": {"x": 2}}
|
||||
expected = {"a": {"x": 2}}
|
||||
assert merge_json_recursive(base, update) == expected
|
||||
|
||||
|
||||
def test_merge_empty_dicts():
|
||||
base = {}
|
||||
update = {"a": 1}
|
||||
expected = {"a": 1}
|
||||
assert merge_json_recursive(base, update) == expected
|
||||
|
||||
|
||||
def test_merge_none_values():
|
||||
base = {"a": None}
|
||||
update = {"a": {"x": 1}}
|
||||
expected = {"a": {"x": 1}}
|
||||
assert merge_json_recursive(base, update) == expected
|
||||
|
||||
|
||||
def test_merge_different_types():
|
||||
base = {"a": [1, 2]}
|
||||
update = {"a": "string"}
|
||||
expected = {"a": "string"}
|
||||
assert merge_json_recursive(base, update) == expected
|
||||
|
||||
|
||||
def test_merge_complex_nested():
|
||||
base = {"a": [1, 2], "b": {"x": [3, 4], "y": {"p": 1}}}
|
||||
update = {"a": [5], "b": {"x": [6], "y": {"q": 2}}}
|
||||
expected = {"a": [1, 2, 5], "b": {"x": [3, 4, 6], "y": {"p": 1, "q": 2}}}
|
||||
assert merge_json_recursive(base, update) == expected
|
||||
@@ -1,26 +0,0 @@
|
||||
def merge_json_recursive(base, update):
|
||||
"""Recursively merge two JSON-like objects.
|
||||
- Dictionaries are merged recursively
|
||||
- Lists are concatenated
|
||||
- Other types are overwritten by the update value
|
||||
|
||||
Args:
|
||||
base: Base JSON-like object
|
||||
update: Update JSON-like object to merge into base
|
||||
|
||||
Returns:
|
||||
Merged JSON-like object
|
||||
"""
|
||||
if not isinstance(base, dict) or not isinstance(update, dict):
|
||||
if isinstance(base, list) and isinstance(update, list):
|
||||
return base + update
|
||||
return update
|
||||
|
||||
merged = base.copy()
|
||||
for key, value in update.items():
|
||||
if key in merged:
|
||||
merged[key] = merge_json_recursive(merged[key], value)
|
||||
else:
|
||||
merged[key] = value
|
||||
|
||||
return merged
|
||||
12
utils/web.py
Normal file
12
utils/web.py
Normal file
@@ -0,0 +1,12 @@
|
||||
import json
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
class DateTimeEncoder(json.JSONEncoder):
|
||||
def default(self, obj):
|
||||
if isinstance(obj, datetime):
|
||||
return obj.isoformat()
|
||||
return super().default(obj)
|
||||
|
||||
|
||||
dumps = DateTimeEncoder().encode
|
||||
23
web/assets/BaseViewTemplate-BNGF4K22.js
generated
vendored
Normal file
23
web/assets/BaseViewTemplate-BNGF4K22.js
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
import { d as defineComponent, o as openBlock, f as createElementBlock, J as renderSlot, T as normalizeClass } from "./index-DjNHn37O.js";
|
||||
const _sfc_main = /* @__PURE__ */ defineComponent({
|
||||
__name: "BaseViewTemplate",
|
||||
props: {
|
||||
dark: { type: Boolean, default: false }
|
||||
},
|
||||
setup(__props) {
|
||||
const props = __props;
|
||||
return (_ctx, _cache) => {
|
||||
return openBlock(), createElementBlock("div", {
|
||||
class: normalizeClass(["font-sans w-screen h-screen flex items-center justify-center pointer-events-auto overflow-auto", [
|
||||
props.dark ? "text-neutral-300 bg-neutral-900 dark-theme" : "text-neutral-900 bg-neutral-300"
|
||||
]])
|
||||
}, [
|
||||
renderSlot(_ctx.$slots, "default")
|
||||
], 2);
|
||||
};
|
||||
}
|
||||
});
|
||||
export {
|
||||
_sfc_main as _
|
||||
};
|
||||
//# sourceMappingURL=BaseViewTemplate-BNGF4K22.js.map
|
||||
54
web/assets/BaseViewTemplate-BhQMaVFP.js
generated
vendored
54
web/assets/BaseViewTemplate-BhQMaVFP.js
generated
vendored
@@ -1,54 +0,0 @@
|
||||
import { d as defineComponent, ad as ref, t as onMounted, bT as isElectron, bV as electronAPI, af as nextTick, o as openBlock, f as createElementBlock, i as withDirectives, v as vShow, m as createBaseVNode, M as renderSlot, V as normalizeClass } from "./index-QvfM__ze.js";
|
||||
const _hoisted_1 = { class: "flex-grow w-full flex items-center justify-center overflow-auto" };
|
||||
const _sfc_main = /* @__PURE__ */ defineComponent({
|
||||
__name: "BaseViewTemplate",
|
||||
props: {
|
||||
dark: { type: Boolean, default: false }
|
||||
},
|
||||
setup(__props) {
|
||||
const props = __props;
|
||||
const darkTheme = {
|
||||
color: "rgba(0, 0, 0, 0)",
|
||||
symbolColor: "#d4d4d4"
|
||||
};
|
||||
const lightTheme = {
|
||||
color: "rgba(0, 0, 0, 0)",
|
||||
symbolColor: "#171717"
|
||||
};
|
||||
const topMenuRef = ref(null);
|
||||
const isNativeWindow = ref(false);
|
||||
onMounted(async () => {
|
||||
if (isElectron()) {
|
||||
const windowStyle = await electronAPI().Config.getWindowStyle();
|
||||
isNativeWindow.value = windowStyle === "custom";
|
||||
await nextTick();
|
||||
electronAPI().changeTheme({
|
||||
...props.dark ? darkTheme : lightTheme,
|
||||
height: topMenuRef.value.getBoundingClientRect().height
|
||||
});
|
||||
}
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return openBlock(), createElementBlock("div", {
|
||||
class: normalizeClass(["font-sans w-screen h-screen flex flex-col pointer-events-auto", [
|
||||
props.dark ? "text-neutral-300 bg-neutral-900 dark-theme" : "text-neutral-900 bg-neutral-300"
|
||||
]])
|
||||
}, [
|
||||
withDirectives(createBaseVNode("div", {
|
||||
ref_key: "topMenuRef",
|
||||
ref: topMenuRef,
|
||||
class: "app-drag w-full h-[var(--comfy-topbar-height)]"
|
||||
}, null, 512), [
|
||||
[vShow, isNativeWindow.value]
|
||||
]),
|
||||
createBaseVNode("div", _hoisted_1, [
|
||||
renderSlot(_ctx.$slots, "default")
|
||||
])
|
||||
], 2);
|
||||
};
|
||||
}
|
||||
});
|
||||
export {
|
||||
_sfc_main as _
|
||||
};
|
||||
//# sourceMappingURL=BaseViewTemplate-BhQMaVFP.js.map
|
||||
22
web/assets/DesktopStartView-le6AjGZr.js
generated
vendored
22
web/assets/DesktopStartView-le6AjGZr.js
generated
vendored
@@ -1,22 +0,0 @@
|
||||
import { d as defineComponent, o as openBlock, J as createBlock, P as withCtx, m as createBaseVNode, k as createVNode, j as unref, ch as script } from "./index-QvfM__ze.js";
|
||||
import { _ as _sfc_main$1 } from "./BaseViewTemplate-BhQMaVFP.js";
|
||||
const _hoisted_1 = { class: "max-w-screen-sm w-screen p-8" };
|
||||
const _sfc_main = /* @__PURE__ */ defineComponent({
|
||||
__name: "DesktopStartView",
|
||||
setup(__props) {
|
||||
return (_ctx, _cache) => {
|
||||
return openBlock(), createBlock(_sfc_main$1, { dark: "" }, {
|
||||
default: withCtx(() => [
|
||||
createBaseVNode("div", _hoisted_1, [
|
||||
createVNode(unref(script), { mode: "indeterminate" })
|
||||
])
|
||||
]),
|
||||
_: 1
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
export {
|
||||
_sfc_main as default
|
||||
};
|
||||
//# sourceMappingURL=DesktopStartView-le6AjGZr.js.map
|
||||
6
web/assets/DownloadGitView-rPK_vYgU.js → web/assets/DownloadGitView-DeC7MBzG.js
generated
vendored
6
web/assets/DownloadGitView-rPK_vYgU.js → web/assets/DownloadGitView-DeC7MBzG.js
generated
vendored
@@ -1,7 +1,7 @@
|
||||
var __defProp = Object.defineProperty;
|
||||
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
||||
import { d as defineComponent, o as openBlock, J as createBlock, P as withCtx, m as createBaseVNode, Z as toDisplayString, k as createVNode, j as unref, l as script, c2 as useRouter } from "./index-QvfM__ze.js";
|
||||
import { _ as _sfc_main$1 } from "./BaseViewTemplate-BhQMaVFP.js";
|
||||
import { d as defineComponent, o as openBlock, k as createBlock, M as withCtx, H as createBaseVNode, X as toDisplayString, N as createVNode, j as unref, l as script, bW as useRouter } from "./index-DjNHn37O.js";
|
||||
import { _ as _sfc_main$1 } from "./BaseViewTemplate-BNGF4K22.js";
|
||||
const _hoisted_1 = { class: "max-w-screen-sm flex flex-col gap-8 p-8 bg-[url('/assets/images/Git-Logo-White.svg')] bg-no-repeat bg-right-top bg-origin-padding" };
|
||||
const _hoisted_2 = { class: "mt-24 text-4xl font-bold text-red-500" };
|
||||
const _hoisted_3 = { class: "space-y-4" };
|
||||
@@ -55,4 +55,4 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
||||
export {
|
||||
_sfc_main as default
|
||||
};
|
||||
//# sourceMappingURL=DownloadGitView-rPK_vYgU.js.map
|
||||
//# sourceMappingURL=DownloadGitView-DeC7MBzG.js.map
|
||||
9
web/assets/ExtensionPanel-3jWrm6Zi.js → web/assets/ExtensionPanel-D4Phn0Zr.js
generated
vendored
9
web/assets/ExtensionPanel-3jWrm6Zi.js → web/assets/ExtensionPanel-D4Phn0Zr.js
generated
vendored
@@ -1,8 +1,9 @@
|
||||
var __defProp = Object.defineProperty;
|
||||
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
||||
import { d as defineComponent, ad as ref, cu as FilterMatchMode, cz as useExtensionStore, a as useSettingStore, t as onMounted, c as computed, o as openBlock, J as createBlock, P as withCtx, k as createVNode, cv as SearchBox, j as unref, c6 as script, m as createBaseVNode, f as createElementBlock, I as renderList, Z as toDisplayString, aG as createTextVNode, H as Fragment, l as script$1, L as createCommentVNode, aK as script$3, b8 as script$4, cc as script$5, cw as _sfc_main$1 } from "./index-QvfM__ze.js";
|
||||
import { s as script$2, a as script$6 } from "./index-DpF-ptbJ.js";
|
||||
import "./index-Q1cQr26V.js";
|
||||
import { d as defineComponent, ab as ref, cn as FilterMatchMode, cs as useExtensionStore, a as useSettingStore, m as onMounted, c as computed, o as openBlock, k as createBlock, M as withCtx, N as createVNode, co as SearchBox, j as unref, bZ as script, H as createBaseVNode, f as createElementBlock, E as renderList, X as toDisplayString, aE as createTextVNode, F as Fragment, l as script$1, I as createCommentVNode, aI as script$3, bO as script$4, c4 as script$5, cp as _sfc_main$1 } from "./index-DjNHn37O.js";
|
||||
import { s as script$2, a as script$6 } from "./index-B5F0uxTQ.js";
|
||||
import "./index-B-aVupP5.js";
|
||||
import "./index-5HFeZax4.js";
|
||||
const _hoisted_1 = { class: "flex justify-end" };
|
||||
const _sfc_main = /* @__PURE__ */ defineComponent({
|
||||
__name: "ExtensionPanel",
|
||||
@@ -179,4 +180,4 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
||||
export {
|
||||
_sfc_main as default
|
||||
};
|
||||
//# sourceMappingURL=ExtensionPanel-3jWrm6Zi.js.map
|
||||
//# sourceMappingURL=ExtensionPanel-D4Phn0Zr.js.map
|
||||
151
web/assets/GraphView-CqZ3opAX.css → web/assets/GraphView-CIRWBKTm.css
generated
vendored
151
web/assets/GraphView-CqZ3opAX.css → web/assets/GraphView-CIRWBKTm.css
generated
vendored
@@ -1,10 +1,8 @@
|
||||
|
||||
.comfy-menu-hamburger[data-v-7ed57d1a] {
|
||||
.comfy-menu-hamburger[data-v-5661bed0] {
|
||||
pointer-events: auto;
|
||||
position: fixed;
|
||||
z-index: 9999;
|
||||
display: flex;
|
||||
flex-direction: row
|
||||
}
|
||||
|
||||
[data-v-e50caa15] .p-splitter-gutter {
|
||||
@@ -41,14 +39,14 @@
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
.p-buttongroup-vertical[data-v-cb8f9a1a] {
|
||||
.p-buttongroup-vertical[data-v-cf40dd39] {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border-radius: var(--p-button-border-radius);
|
||||
overflow: hidden;
|
||||
border: 1px solid var(--p-panel-border-color);
|
||||
}
|
||||
.p-buttongroup-vertical .p-button[data-v-cb8f9a1a] {
|
||||
.p-buttongroup-vertical .p-button[data-v-cf40dd39] {
|
||||
margin: 0;
|
||||
border-radius: 0;
|
||||
}
|
||||
@@ -84,7 +82,7 @@
|
||||
font-size: inherit;
|
||||
}
|
||||
|
||||
[data-v-fd0a74bd] .highlight {
|
||||
[data-v-5741c9ae] .highlight {
|
||||
background-color: var(--p-primary-color);
|
||||
color: var(--p-primary-contrast-color);
|
||||
font-weight: bold;
|
||||
@@ -133,7 +131,16 @@
|
||||
border-right: 4px solid var(--p-button-text-primary-color);
|
||||
}
|
||||
|
||||
.side-tool-bar-container[data-v-33cac83a] {
|
||||
:root {
|
||||
--sidebar-width: 64px;
|
||||
--sidebar-icon-size: 1.5rem;
|
||||
}
|
||||
:root .small-sidebar {
|
||||
--sidebar-width: 40px;
|
||||
--sidebar-icon-size: 1rem;
|
||||
}
|
||||
|
||||
.side-tool-bar-container[data-v-37d8d7b4] {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
@@ -146,91 +153,18 @@
|
||||
background-color: var(--comfy-menu-secondary-bg);
|
||||
color: var(--fg-color);
|
||||
box-shadow: var(--bar-shadow);
|
||||
|
||||
--sidebar-width: 4rem;
|
||||
--sidebar-icon-size: 1.5rem;
|
||||
}
|
||||
.side-tool-bar-container.small-sidebar[data-v-33cac83a] {
|
||||
--sidebar-width: 2.5rem;
|
||||
--sidebar-icon-size: 1rem;
|
||||
}
|
||||
.side-tool-bar-end[data-v-33cac83a] {
|
||||
.side-tool-bar-end[data-v-37d8d7b4] {
|
||||
align-self: flex-end;
|
||||
margin-top: auto;
|
||||
}
|
||||
|
||||
.status-indicator[data-v-8d011a31] {
|
||||
position: absolute;
|
||||
font-weight: 700;
|
||||
font-size: 1.5rem;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%)
|
||||
}
|
||||
|
||||
[data-v-54fadc45] .p-togglebutton {
|
||||
position: relative;
|
||||
flex-shrink: 0;
|
||||
border-radius: 0px;
|
||||
border-width: 0px;
|
||||
border-right-width: 1px;
|
||||
border-style: solid;
|
||||
background-color: transparent;
|
||||
padding: 0px;
|
||||
border-right-color: var(--border-color)
|
||||
}
|
||||
[data-v-54fadc45] .p-togglebutton::before {
|
||||
display: none
|
||||
}
|
||||
[data-v-54fadc45] .p-togglebutton:first-child {
|
||||
border-left-width: 1px;
|
||||
border-style: solid;
|
||||
border-left-color: var(--border-color)
|
||||
}
|
||||
[data-v-54fadc45] .p-togglebutton:not(:first-child) {
|
||||
border-left-width: 0px
|
||||
}
|
||||
[data-v-54fadc45] .p-togglebutton.p-togglebutton-checked {
|
||||
height: 100%;
|
||||
border-bottom-width: 1px;
|
||||
border-style: solid;
|
||||
border-bottom-color: var(--p-button-text-primary-color)
|
||||
}
|
||||
[data-v-54fadc45] .p-togglebutton:not(.p-togglebutton-checked) {
|
||||
opacity: 0.75
|
||||
}
|
||||
[data-v-54fadc45] .p-togglebutton-checked .close-button,[data-v-54fadc45] .p-togglebutton:hover .close-button {
|
||||
visibility: visible
|
||||
}
|
||||
[data-v-54fadc45] .p-togglebutton:hover .status-indicator {
|
||||
display: none
|
||||
}
|
||||
[data-v-54fadc45] .p-togglebutton .close-button {
|
||||
visibility: hidden
|
||||
}
|
||||
[data-v-54fadc45] .p-scrollpanel-content {
|
||||
height: 100%
|
||||
}
|
||||
|
||||
/* Scrollbar half opacity to avoid blocking the active tab bottom border */
|
||||
[data-v-54fadc45] .p-scrollpanel:hover .p-scrollpanel-bar,[data-v-54fadc45] .p-scrollpanel:active .p-scrollpanel-bar {
|
||||
opacity: 0.5
|
||||
}
|
||||
[data-v-54fadc45] .p-selectbutton {
|
||||
height: 100%;
|
||||
border-radius: 0px
|
||||
}
|
||||
|
||||
[data-v-38831d8e] .workflow-tabs {
|
||||
background-color: var(--comfy-menu-bg);
|
||||
}
|
||||
|
||||
[data-v-26957f1f] .p-inputtext {
|
||||
[data-v-b9328350] .p-inputtext {
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
|
||||
.comfyui-queue-button[data-v-e9044686] .p-splitbutton-dropdown {
|
||||
.comfyui-queue-button[data-v-7f4f551b] .p-splitbutton-dropdown {
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
@@ -261,23 +195,55 @@
|
||||
display: none;
|
||||
}
|
||||
|
||||
.top-menubar[data-v-56df69d2] .p-menubar-item-link svg {
|
||||
.top-menubar[data-v-6fecd137] .p-menubar-item-link svg {
|
||||
display: none;
|
||||
}
|
||||
[data-v-56df69d2] .p-menubar-submenu.dropdown-direction-up {
|
||||
[data-v-6fecd137] .p-menubar-submenu.dropdown-direction-up {
|
||||
top: auto;
|
||||
bottom: 100%;
|
||||
flex-direction: column-reverse;
|
||||
}
|
||||
.keybinding-tag[data-v-56df69d2] {
|
||||
.keybinding-tag[data-v-6fecd137] {
|
||||
background: var(--p-content-hover-background);
|
||||
border-color: var(--p-content-border-color);
|
||||
border-style: solid;
|
||||
}
|
||||
|
||||
.comfyui-menu[data-v-6e35440f] {
|
||||
.status-indicator[data-v-8d011a31] {
|
||||
position: absolute;
|
||||
font-weight: 700;
|
||||
font-size: 1.5rem;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%)
|
||||
}
|
||||
|
||||
[data-v-d485c044] .p-togglebutton::before {
|
||||
display: none
|
||||
}
|
||||
[data-v-d485c044] .p-togglebutton {
|
||||
position: relative;
|
||||
flex-shrink: 0;
|
||||
border-radius: 0px;
|
||||
background-color: transparent;
|
||||
padding: 0px
|
||||
}
|
||||
[data-v-d485c044] .p-togglebutton.p-togglebutton-checked {
|
||||
border-bottom-width: 2px;
|
||||
border-bottom-color: var(--p-button-text-primary-color)
|
||||
}
|
||||
[data-v-d485c044] .p-togglebutton-checked .close-button,[data-v-d485c044] .p-togglebutton:hover .close-button {
|
||||
visibility: visible
|
||||
}
|
||||
[data-v-d485c044] .p-togglebutton:hover .status-indicator {
|
||||
display: none
|
||||
}
|
||||
[data-v-d485c044] .p-togglebutton .close-button {
|
||||
visibility: hidden
|
||||
}
|
||||
|
||||
.comfyui-menu[data-v-878b63b8] {
|
||||
width: 100vw;
|
||||
height: var(--comfy-topbar-height);
|
||||
background: var(--comfy-menu-bg);
|
||||
color: var(--fg-color);
|
||||
box-shadow: var(--bar-shadow);
|
||||
@@ -287,17 +253,18 @@
|
||||
z-index: 1000;
|
||||
order: 0;
|
||||
grid-column: 1/-1;
|
||||
max-height: 90vh;
|
||||
}
|
||||
.comfyui-menu.dropzone[data-v-6e35440f] {
|
||||
.comfyui-menu.dropzone[data-v-878b63b8] {
|
||||
background: var(--p-highlight-background);
|
||||
}
|
||||
.comfyui-menu.dropzone-active[data-v-6e35440f] {
|
||||
.comfyui-menu.dropzone-active[data-v-878b63b8] {
|
||||
background: var(--p-highlight-background-focus);
|
||||
}
|
||||
[data-v-6e35440f] .p-menubar-item-label {
|
||||
[data-v-878b63b8] .p-menubar-item-label {
|
||||
line-height: revert;
|
||||
}
|
||||
.comfyui-logo[data-v-6e35440f] {
|
||||
.comfyui-logo[data-v-878b63b8] {
|
||||
font-size: 1.2em;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
1047
web/assets/GraphView-CDDCHVO0.js → web/assets/GraphView-HVeNbkaW.js
generated
vendored
1047
web/assets/GraphView-CDDCHVO0.js → web/assets/GraphView-HVeNbkaW.js
generated
vendored
File diff suppressed because it is too large
Load Diff
71
web/assets/InstallView-By3hC1fC.js → web/assets/InstallView-CAcYt0HL.js
generated
vendored
71
web/assets/InstallView-By3hC1fC.js → web/assets/InstallView-CAcYt0HL.js
generated
vendored
@@ -1,7 +1,7 @@
|
||||
var __defProp = Object.defineProperty;
|
||||
var __name = (target, value2) => __defProp(target, "name", { value: value2, configurable: true });
|
||||
import { B as BaseStyle, y as script$6, o as openBlock, f as createElementBlock, G as mergeProps, c9 as findIndexInList, ca as find, aD as resolveComponent, J as createBlock, K as resolveDynamicComponent, P as withCtx, m as createBaseVNode, Z as toDisplayString, M as renderSlot, L as createCommentVNode, V as normalizeClass, R as findSingle, H as Fragment, aE as Transition, i as withDirectives, v as vShow, am as UniqueComponentId, d as defineComponent, ad as ref, cb as useModel, k as createVNode, j as unref, cc as script$7, c4 as script$8, b3 as withModifiers, aP as script$9, a3 as useI18n, c as computed, aK as script$a, aG as createTextVNode, p as pushScopeId, q as popScopeId, bV as electronAPI, _ as _export_sfc, t as onMounted, r as resolveDirective, ax as script$b, cd as script$c, ce as script$d, l as script$e, c6 as script$f, cf as MigrationItems, w as watchEffect, I as renderList, cg as script$g, c2 as useRouter, aU as toRaw } from "./index-QvfM__ze.js";
|
||||
import { _ as _sfc_main$5 } from "./BaseViewTemplate-BhQMaVFP.js";
|
||||
import { B as BaseStyle, q as script$6, o as openBlock, f as createElementBlock, D as mergeProps, c1 as findIndexInList, c2 as find, aB as resolveComponent, k as createBlock, G as resolveDynamicComponent, M as withCtx, H as createBaseVNode, X as toDisplayString, J as renderSlot, I as createCommentVNode, T as normalizeClass, P as findSingle, F as Fragment, aC as Transition, i as withDirectives, v as vShow, ak as UniqueComponentId, d as defineComponent, ab as ref, c3 as useModel, N as createVNode, j as unref, c4 as script$7, bQ as script$8, bM as withModifiers, aP as script$9, a1 as useI18n, c as computed, aI as script$a, aE as createTextVNode, c0 as electronAPI, m as onMounted, r as resolveDirective, av as script$b, c5 as script$c, c6 as script$d, l as script$e, bZ as script$f, c7 as MigrationItems, w as watchEffect, E as renderList, c8 as script$g, bW as useRouter, aL as pushScopeId, aM as popScopeId, aU as toRaw, _ as _export_sfc } from "./index-DjNHn37O.js";
|
||||
import { _ as _sfc_main$5 } from "./BaseViewTemplate-BNGF4K22.js";
|
||||
var classes$4 = {
|
||||
root: /* @__PURE__ */ __name(function root(_ref) {
|
||||
var instance = _ref.instance;
|
||||
@@ -548,12 +548,6 @@ const _hoisted_15$2 = { class: "font-medium mb-2" };
|
||||
const _hoisted_16$2 = { class: "list-disc pl-6 space-y-1" };
|
||||
const _hoisted_17$2 = { class: "font-medium mt-4 mb-2" };
|
||||
const _hoisted_18$2 = { class: "list-disc pl-6 space-y-1" };
|
||||
const _hoisted_19 = { class: "mt-4" };
|
||||
const _hoisted_20 = {
|
||||
href: "https://comfy.org/privacy",
|
||||
target: "_blank",
|
||||
class: "text-blue-400 hover:text-blue-300 underline"
|
||||
};
|
||||
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
||||
__name: "DesktopSettingsConfiguration",
|
||||
props: {
|
||||
@@ -614,29 +608,17 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
||||
createBaseVNode("div", _hoisted_14$2, [
|
||||
createBaseVNode("h4", _hoisted_15$2, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.whatWeCollect")), 1),
|
||||
createBaseVNode("ul", _hoisted_16$2, [
|
||||
createBaseVNode("li", null, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.collect.errorReports")), 1),
|
||||
createBaseVNode("li", null, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.collect.systemInfo")), 1),
|
||||
createBaseVNode("li", null, toDisplayString(_ctx.$t(
|
||||
"install.settings.dataCollectionDialog.collect.userJourneyEvents"
|
||||
)), 1)
|
||||
createBaseVNode("li", null, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.errorReports")), 1),
|
||||
createBaseVNode("li", null, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.systemInfo")), 1)
|
||||
]),
|
||||
createBaseVNode("h4", _hoisted_17$2, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.whatWeDoNotCollect")), 1),
|
||||
createBaseVNode("ul", _hoisted_18$2, [
|
||||
createBaseVNode("li", null, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.personalInformation")), 1),
|
||||
createBaseVNode("li", null, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.workflowContents")), 1),
|
||||
createBaseVNode("li", null, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.fileSystemInformation")), 1),
|
||||
createBaseVNode("li", null, toDisplayString(_ctx.$t(
|
||||
"install.settings.dataCollectionDialog.doNotCollect.personalInformation"
|
||||
)), 1),
|
||||
createBaseVNode("li", null, toDisplayString(_ctx.$t(
|
||||
"install.settings.dataCollectionDialog.doNotCollect.workflowContents"
|
||||
)), 1),
|
||||
createBaseVNode("li", null, toDisplayString(_ctx.$t(
|
||||
"install.settings.dataCollectionDialog.doNotCollect.fileSystemInformation"
|
||||
)), 1),
|
||||
createBaseVNode("li", null, toDisplayString(_ctx.$t(
|
||||
"install.settings.dataCollectionDialog.doNotCollect.customNodeConfigurations"
|
||||
"install.settings.dataCollectionDialog.customNodeConfigurations"
|
||||
)), 1)
|
||||
]),
|
||||
createBaseVNode("div", _hoisted_19, [
|
||||
createBaseVNode("a", _hoisted_20, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.viewFullPolicy")), 1)
|
||||
])
|
||||
])
|
||||
]),
|
||||
@@ -649,37 +631,36 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
||||
const _imports_0 = "" + new URL("images/nvidia-logo.svg", import.meta.url).href;
|
||||
const _imports_1 = "" + new URL("images/apple-mps-logo.png", import.meta.url).href;
|
||||
const _imports_2 = "" + new URL("images/manual-configuration.svg", import.meta.url).href;
|
||||
const _withScopeId$1 = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-79125ff6"), n = n(), popScopeId(), n), "_withScopeId$1");
|
||||
const _hoisted_1$3 = { class: "flex flex-col gap-6 w-[600px] h-[30rem] select-none" };
|
||||
const _hoisted_2$3 = { class: "grow flex flex-col gap-4 text-neutral-300" };
|
||||
const _hoisted_3$3 = { class: "text-2xl font-semibold text-neutral-100" };
|
||||
const _hoisted_4$3 = { class: "m-1 text-neutral-400" };
|
||||
const _hoisted_5$2 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createBaseVNode("img", {
|
||||
const _hoisted_5$2 = /* @__PURE__ */ createBaseVNode("img", {
|
||||
class: "m-12",
|
||||
alt: "NVIDIA logo",
|
||||
width: "196",
|
||||
height: "32",
|
||||
src: _imports_0
|
||||
}, null, -1));
|
||||
}, null, -1);
|
||||
const _hoisted_6$2 = [
|
||||
_hoisted_5$2
|
||||
];
|
||||
const _hoisted_7$2 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createBaseVNode("img", {
|
||||
const _hoisted_7$2 = /* @__PURE__ */ createBaseVNode("img", {
|
||||
class: "rounded-lg hover-brighten",
|
||||
alt: "Apple Metal Performance Shaders Logo",
|
||||
width: "292",
|
||||
ratio: "",
|
||||
src: _imports_1
|
||||
}, null, -1));
|
||||
}, null, -1);
|
||||
const _hoisted_8$2 = [
|
||||
_hoisted_7$2
|
||||
];
|
||||
const _hoisted_9$2 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createBaseVNode("img", {
|
||||
const _hoisted_9$2 = /* @__PURE__ */ createBaseVNode("img", {
|
||||
class: "m-12",
|
||||
alt: "Manual configuration",
|
||||
width: "196",
|
||||
src: _imports_2
|
||||
}, null, -1));
|
||||
}, null, -1);
|
||||
const _hoisted_10$2 = [
|
||||
_hoisted_9$2
|
||||
];
|
||||
@@ -816,7 +797,6 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
||||
};
|
||||
}
|
||||
});
|
||||
const GpuPicker = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-79125ff6"]]);
|
||||
const _hoisted_1$2 = { class: "flex flex-col gap-6 w-[600px]" };
|
||||
const _hoisted_2$2 = { class: "flex flex-col gap-4" };
|
||||
const _hoisted_3$2 = { class: "text-2xl font-semibold text-neutral-100" };
|
||||
@@ -1102,7 +1082,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
||||
};
|
||||
}
|
||||
});
|
||||
const _withScopeId = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-0a97b0ae"), n = n(), popScopeId(), n), "_withScopeId");
|
||||
const _withScopeId = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-de33872d"), n = n(), popScopeId(), n), "_withScopeId");
|
||||
const _hoisted_1 = { class: "flex pt-6 justify-end" };
|
||||
const _hoisted_2 = { class: "flex pt-6 justify-between" };
|
||||
const _hoisted_3 = { class: "flex pt-6 justify-between" };
|
||||
@@ -1118,12 +1098,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
||||
const autoUpdate = ref(true);
|
||||
const allowMetrics = ref(true);
|
||||
const highestStep = ref(0);
|
||||
const handleStepChange = /* @__PURE__ */ __name((value2) => {
|
||||
setHighestStep(value2);
|
||||
electronAPI().Events.trackEvent("install_stepper_change", {
|
||||
step: value2
|
||||
});
|
||||
}, "handleStepChange");
|
||||
const setHighestStep = /* @__PURE__ */ __name((value2) => {
|
||||
const int = typeof value2 === "number" ? value2 : parseInt(value2, 10);
|
||||
if (!isNaN(int) && int > highestStep.value) highestStep.value = int;
|
||||
@@ -1148,13 +1122,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
||||
onMounted(async () => {
|
||||
if (!electron) return;
|
||||
const detectedGpu = await electron.Config.getDetectedGpu();
|
||||
if (detectedGpu === "mps" || detectedGpu === "nvidia") {
|
||||
if (detectedGpu === "mps" || detectedGpu === "nvidia")
|
||||
device.value = detectedGpu;
|
||||
}
|
||||
electronAPI().Events.trackEvent("install_stepper_change", {
|
||||
step: "0",
|
||||
gpu: detectedGpu
|
||||
});
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return openBlock(), createBlock(_sfc_main$5, { dark: "" }, {
|
||||
@@ -1162,7 +1131,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
||||
createVNode(unref(script), {
|
||||
class: "h-full p-8 2xl:p-16",
|
||||
value: "0",
|
||||
"onUpdate:value": handleStepChange
|
||||
"onUpdate:value": setHighestStep
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createVNode(unref(script$4), { class: "select-none" }, {
|
||||
@@ -1207,7 +1176,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
||||
default: withCtx(() => [
|
||||
createVNode(unref(script$3), { value: "0" }, {
|
||||
default: withCtx(({ activateCallback }) => [
|
||||
createVNode(GpuPicker, {
|
||||
createVNode(_sfc_main$3, {
|
||||
device: device.value,
|
||||
"onUpdate:device": _cache[0] || (_cache[0] = ($event) => device.value = $event)
|
||||
}, null, 8, ["device"]),
|
||||
@@ -1312,8 +1281,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
||||
};
|
||||
}
|
||||
});
|
||||
const InstallView = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-0a97b0ae"]]);
|
||||
const InstallView = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-de33872d"]]);
|
||||
export {
|
||||
InstallView as default
|
||||
};
|
||||
//# sourceMappingURL=InstallView-By3hC1fC.js.map
|
||||
//# sourceMappingURL=InstallView-CAcYt0HL.js.map
|
||||
36
web/assets/InstallView-CxhfFC8Y.css → web/assets/InstallView-CwQdoH-C.css
generated
vendored
36
web/assets/InstallView-CxhfFC8Y.css → web/assets/InstallView-CwQdoH-C.css
generated
vendored
@@ -1,18 +1,18 @@
|
||||
|
||||
.p-tag[data-v-79125ff6] {
|
||||
:root {
|
||||
--p-tag-gap: 0.5rem;
|
||||
}
|
||||
.hover-brighten[data-v-79125ff6] {
|
||||
.hover-brighten {
|
||||
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
|
||||
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
||||
transition-duration: 150ms;
|
||||
transition-property: filter, box-shadow;
|
||||
&[data-v-79125ff6]:hover {
|
||||
&:hover {
|
||||
filter: brightness(107%) contrast(105%);
|
||||
box-shadow: 0 0 0.25rem #ffffff79;
|
||||
}
|
||||
}
|
||||
.p-accordioncontent-content[data-v-79125ff6] {
|
||||
.p-accordioncontent-content {
|
||||
border-radius: 0.5rem;
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(23 23 23 / var(--tw-bg-opacity));
|
||||
@@ -20,15 +20,15 @@
|
||||
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
||||
transition-duration: 150ms;
|
||||
}
|
||||
div.selected[data-v-79125ff6] {
|
||||
.gpu-button[data-v-79125ff6]:not(.selected) {
|
||||
div.selected {
|
||||
.gpu-button:not(.selected) {
|
||||
opacity: 0.5;
|
||||
}
|
||||
.gpu-button[data-v-79125ff6]:not(.selected):hover {
|
||||
.gpu-button:not(.selected):hover {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
.gpu-button[data-v-79125ff6] {
|
||||
.gpu-button {
|
||||
margin: 0px;
|
||||
display: flex;
|
||||
width: 50%;
|
||||
@@ -43,37 +43,37 @@ div.selected[data-v-79125ff6] {
|
||||
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
||||
transition-duration: 150ms;
|
||||
}
|
||||
.gpu-button[data-v-79125ff6]:hover {
|
||||
.gpu-button:hover {
|
||||
--tw-bg-opacity: 0.75;
|
||||
}
|
||||
.gpu-button[data-v-79125ff6] {
|
||||
&.selected[data-v-79125ff6] {
|
||||
.gpu-button {
|
||||
&.selected {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(64 64 64 / var(--tw-bg-opacity));
|
||||
}
|
||||
&.selected[data-v-79125ff6] {
|
||||
&.selected {
|
||||
--tw-bg-opacity: 0.5;
|
||||
}
|
||||
&.selected[data-v-79125ff6] {
|
||||
&.selected {
|
||||
opacity: 1;
|
||||
}
|
||||
&.selected[data-v-79125ff6]:hover {
|
||||
&.selected:hover {
|
||||
--tw-bg-opacity: 0.6;
|
||||
}
|
||||
}
|
||||
.disabled[data-v-79125ff6] {
|
||||
.disabled {
|
||||
pointer-events: none;
|
||||
opacity: 0.4;
|
||||
}
|
||||
.p-card-header[data-v-79125ff6] {
|
||||
.p-card-header {
|
||||
flex-grow: 1;
|
||||
text-align: center;
|
||||
}
|
||||
.p-card-body[data-v-79125ff6] {
|
||||
.p-card-body {
|
||||
padding-top: 0px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
[data-v-0a97b0ae] .p-steppanel {
|
||||
[data-v-de33872d] .p-steppanel {
|
||||
background-color: transparent
|
||||
}
|
||||
11
web/assets/KeybindingPanel-D6O16W_1.js → web/assets/KeybindingPanel-Dc3C4lG1.js
generated
vendored
11
web/assets/KeybindingPanel-D6O16W_1.js → web/assets/KeybindingPanel-Dc3C4lG1.js
generated
vendored
@@ -1,9 +1,10 @@
|
||||
var __defProp = Object.defineProperty;
|
||||
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
||||
import { d as defineComponent, c as computed, o as openBlock, f as createElementBlock, H as Fragment, I as renderList, k as createVNode, P as withCtx, aG as createTextVNode, Z as toDisplayString, j as unref, aK as script, L as createCommentVNode, ad as ref, cu as FilterMatchMode, a$ as useKeybindingStore, a4 as useCommandStore, a3 as useI18n, ah as normalizeI18nKey, w as watchEffect, bz as useToast, r as resolveDirective, J as createBlock, cv as SearchBox, m as createBaseVNode, l as script$2, ax as script$4, b3 as withModifiers, c6 as script$5, aP as script$6, i as withDirectives, cw as _sfc_main$2, p as pushScopeId, q as popScopeId, cx as KeyComboImpl, cy as KeybindingImpl, _ as _export_sfc } from "./index-QvfM__ze.js";
|
||||
import { s as script$1, a as script$3 } from "./index-DpF-ptbJ.js";
|
||||
import { u as useKeybindingService } from "./keybindingService-Cak1En5n.js";
|
||||
import "./index-Q1cQr26V.js";
|
||||
import { d as defineComponent, c as computed, o as openBlock, f as createElementBlock, F as Fragment, E as renderList, N as createVNode, M as withCtx, aE as createTextVNode, X as toDisplayString, j as unref, aI as script, I as createCommentVNode, ab as ref, cn as FilterMatchMode, a$ as useKeybindingStore, a2 as useCommandStore, a1 as useI18n, af as normalizeI18nKey, w as watchEffect, bs as useToast, r as resolveDirective, k as createBlock, co as SearchBox, H as createBaseVNode, l as script$2, av as script$4, bM as withModifiers, bZ as script$5, aP as script$6, i as withDirectives, cp as _sfc_main$2, aL as pushScopeId, aM as popScopeId, cq as KeyComboImpl, cr as KeybindingImpl, _ as _export_sfc } from "./index-DjNHn37O.js";
|
||||
import { s as script$1, a as script$3 } from "./index-B5F0uxTQ.js";
|
||||
import { u as useKeybindingService } from "./keybindingService-Bx7YdkXn.js";
|
||||
import "./index-B-aVupP5.js";
|
||||
import "./index-5HFeZax4.js";
|
||||
const _hoisted_1$1 = {
|
||||
key: 0,
|
||||
class: "px-2"
|
||||
@@ -280,4 +281,4 @@ const KeybindingPanel = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "d
|
||||
export {
|
||||
KeybindingPanel as default
|
||||
};
|
||||
//# sourceMappingURL=KeybindingPanel-D6O16W_1.js.map
|
||||
//# sourceMappingURL=KeybindingPanel-Dc3C4lG1.js.map
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
.p-tag[data-v-dc169863] {
|
||||
:root {
|
||||
--p-tag-gap: 0.5rem;
|
||||
}
|
||||
.comfy-installer[data-v-dc169863] {
|
||||
.comfy-installer {
|
||||
margin-top: max(1rem, max(0px, calc((100vh - 42rem) * 0.5)));
|
||||
}
|
||||
@@ -1,8 +1,9 @@
|
||||
var __defProp = Object.defineProperty;
|
||||
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
||||
import { d as defineComponent, a3 as useI18n, ad as ref, t as onMounted, o as openBlock, J as createBlock, P as withCtx, m as createBaseVNode, Z as toDisplayString, k as createVNode, j as unref, aK as script, bN as script$1, l as script$2, p as pushScopeId, q as popScopeId, bV as electronAPI, _ as _export_sfc } from "./index-QvfM__ze.js";
|
||||
import { _ as _sfc_main$1 } from "./BaseViewTemplate-BhQMaVFP.js";
|
||||
const _withScopeId = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-dc169863"), n = n(), popScopeId(), n), "_withScopeId");
|
||||
import { d as defineComponent, a1 as useI18n, ab as ref, m as onMounted, o as openBlock, k as createBlock, M as withCtx, H as createBaseVNode, X as toDisplayString, N as createVNode, j as unref, aI as script, l as script$2, c0 as electronAPI } from "./index-DjNHn37O.js";
|
||||
import { s as script$1 } from "./index-jXPKy3pP.js";
|
||||
import { _ as _sfc_main$1 } from "./BaseViewTemplate-BNGF4K22.js";
|
||||
import "./index-5HFeZax4.js";
|
||||
const _hoisted_1 = { class: "comfy-installer grow flex flex-col gap-4 text-neutral-300 max-w-110" };
|
||||
const _hoisted_2 = { class: "text-2xl font-semibold text-neutral-100" };
|
||||
const _hoisted_3 = { class: "m-1 text-neutral-300" };
|
||||
@@ -68,8 +69,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
||||
};
|
||||
}
|
||||
});
|
||||
const ManualConfigurationView = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-dc169863"]]);
|
||||
export {
|
||||
ManualConfigurationView as default
|
||||
_sfc_main as default
|
||||
};
|
||||
//# sourceMappingURL=ManualConfigurationView-enyqGo0M.js.map
|
||||
//# sourceMappingURL=ManualConfigurationView-Bi_qHE-n.js.map
|
||||
86
web/assets/MetricsConsentView-lSfLu4nr.js
generated
vendored
86
web/assets/MetricsConsentView-lSfLu4nr.js
generated
vendored
@@ -1,86 +0,0 @@
|
||||
var __defProp = Object.defineProperty;
|
||||
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
||||
import { _ as _sfc_main$1 } from "./BaseViewTemplate-BhQMaVFP.js";
|
||||
import { d as defineComponent, bz as useToast, a3 as useI18n, ad as ref, c2 as useRouter, o as openBlock, J as createBlock, P as withCtx, m as createBaseVNode, Z as toDisplayString, aG as createTextVNode, k as createVNode, j as unref, cc as script, l as script$1, bV as electronAPI } from "./index-QvfM__ze.js";
|
||||
const _hoisted_1 = { class: "h-full p-8 2xl:p-16 flex flex-col items-center justify-center" };
|
||||
const _hoisted_2 = { class: "bg-neutral-800 rounded-lg shadow-lg p-6 w-full max-w-[600px] flex flex-col gap-6" };
|
||||
const _hoisted_3 = { class: "text-3xl font-semibold text-neutral-100" };
|
||||
const _hoisted_4 = { class: "text-neutral-400" };
|
||||
const _hoisted_5 = { class: "text-neutral-400" };
|
||||
const _hoisted_6 = {
|
||||
href: "https://comfy.org/privacy",
|
||||
target: "_blank",
|
||||
class: "text-blue-400 hover:text-blue-300 underline"
|
||||
};
|
||||
const _hoisted_7 = { class: "flex items-center gap-4" };
|
||||
const _hoisted_8 = {
|
||||
id: "metricsDescription",
|
||||
class: "text-neutral-100"
|
||||
};
|
||||
const _hoisted_9 = { class: "flex pt-6 justify-end" };
|
||||
const _sfc_main = /* @__PURE__ */ defineComponent({
|
||||
__name: "MetricsConsentView",
|
||||
setup(__props) {
|
||||
const toast = useToast();
|
||||
const { t } = useI18n();
|
||||
const allowMetrics = ref(true);
|
||||
const router = useRouter();
|
||||
const isUpdating = ref(false);
|
||||
const updateConsent = /* @__PURE__ */ __name(async () => {
|
||||
isUpdating.value = true;
|
||||
try {
|
||||
await electronAPI().setMetricsConsent(allowMetrics.value);
|
||||
} catch (error) {
|
||||
toast.add({
|
||||
severity: "error",
|
||||
summary: t("install.errorUpdatingConsent"),
|
||||
detail: t("install.errorUpdatingConsentDetail"),
|
||||
life: 3e3
|
||||
});
|
||||
} finally {
|
||||
isUpdating.value = false;
|
||||
}
|
||||
router.push("/");
|
||||
}, "updateConsent");
|
||||
return (_ctx, _cache) => {
|
||||
const _component_BaseViewTemplate = _sfc_main$1;
|
||||
return openBlock(), createBlock(_component_BaseViewTemplate, { dark: "" }, {
|
||||
default: withCtx(() => [
|
||||
createBaseVNode("div", _hoisted_1, [
|
||||
createBaseVNode("div", _hoisted_2, [
|
||||
createBaseVNode("h2", _hoisted_3, toDisplayString(_ctx.$t("install.helpImprove")), 1),
|
||||
createBaseVNode("p", _hoisted_4, toDisplayString(_ctx.$t("install.updateConsent")), 1),
|
||||
createBaseVNode("p", _hoisted_5, [
|
||||
createTextVNode(toDisplayString(_ctx.$t("install.moreInfo")) + " ", 1),
|
||||
createBaseVNode("a", _hoisted_6, toDisplayString(_ctx.$t("install.privacyPolicy")), 1),
|
||||
createTextVNode(". ")
|
||||
]),
|
||||
createBaseVNode("div", _hoisted_7, [
|
||||
createVNode(unref(script), {
|
||||
modelValue: allowMetrics.value,
|
||||
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => allowMetrics.value = $event),
|
||||
"aria-describedby": "metricsDescription"
|
||||
}, null, 8, ["modelValue"]),
|
||||
createBaseVNode("span", _hoisted_8, toDisplayString(allowMetrics.value ? _ctx.$t("install.metricsEnabled") : _ctx.$t("install.metricsDisabled")), 1)
|
||||
]),
|
||||
createBaseVNode("div", _hoisted_9, [
|
||||
createVNode(unref(script$1), {
|
||||
label: _ctx.$t("g.ok"),
|
||||
icon: "pi pi-check",
|
||||
loading: isUpdating.value,
|
||||
iconPos: "right",
|
||||
onClick: updateConsent
|
||||
}, null, 8, ["label", "loading"])
|
||||
])
|
||||
])
|
||||
])
|
||||
]),
|
||||
_: 1
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
export {
|
||||
_sfc_main as default
|
||||
};
|
||||
//# sourceMappingURL=MetricsConsentView-lSfLu4nr.js.map
|
||||
14
web/assets/NotSupportedView-Vc8_xWgH.js → web/assets/NotSupportedView-Drz3x2d-.js
generated
vendored
14
web/assets/NotSupportedView-Vc8_xWgH.js → web/assets/NotSupportedView-Drz3x2d-.js
generated
vendored
@@ -1,15 +1,14 @@
|
||||
var __defProp = Object.defineProperty;
|
||||
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
||||
import { d as defineComponent, c2 as useRouter, r as resolveDirective, o as openBlock, J as createBlock, P as withCtx, m as createBaseVNode, Z as toDisplayString, k as createVNode, j as unref, l as script, i as withDirectives, p as pushScopeId, q as popScopeId, _ as _export_sfc } from "./index-QvfM__ze.js";
|
||||
import { _ as _sfc_main$1 } from "./BaseViewTemplate-BhQMaVFP.js";
|
||||
import { d as defineComponent, bW as useRouter, r as resolveDirective, o as openBlock, k as createBlock, M as withCtx, H as createBaseVNode, X as toDisplayString, N as createVNode, j as unref, l as script, i as withDirectives } from "./index-DjNHn37O.js";
|
||||
import { _ as _sfc_main$1 } from "./BaseViewTemplate-BNGF4K22.js";
|
||||
const _imports_0 = "" + new URL("images/sad_girl.png", import.meta.url).href;
|
||||
const _withScopeId = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-ebb20958"), n = n(), popScopeId(), n), "_withScopeId");
|
||||
const _hoisted_1 = { class: "sad-container" };
|
||||
const _hoisted_2 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createBaseVNode("img", {
|
||||
const _hoisted_2 = /* @__PURE__ */ createBaseVNode("img", {
|
||||
class: "sad-girl",
|
||||
src: _imports_0,
|
||||
alt: "Sad girl illustration"
|
||||
}, null, -1));
|
||||
}, null, -1);
|
||||
const _hoisted_3 = { class: "no-drag sad-text flex items-center" };
|
||||
const _hoisted_4 = { class: "flex flex-col gap-8 p-8 min-w-110" };
|
||||
const _hoisted_5 = { class: "text-4xl font-bold text-red-500" };
|
||||
@@ -81,8 +80,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
||||
};
|
||||
}
|
||||
});
|
||||
const NotSupportedView = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-ebb20958"]]);
|
||||
export {
|
||||
NotSupportedView as default
|
||||
_sfc_main as default
|
||||
};
|
||||
//# sourceMappingURL=NotSupportedView-Vc8_xWgH.js.map
|
||||
//# sourceMappingURL=NotSupportedView-Drz3x2d-.js.map
|
||||
8
web/assets/NotSupportedView-DQerxQzi.css → web/assets/NotSupportedView-bFzHmqNj.css
generated
vendored
8
web/assets/NotSupportedView-DQerxQzi.css → web/assets/NotSupportedView-bFzHmqNj.css
generated
vendored
@@ -1,17 +1,17 @@
|
||||
|
||||
.sad-container[data-v-ebb20958] {
|
||||
.sad-container {
|
||||
display: grid;
|
||||
align-items: center;
|
||||
justify-content: space-evenly;
|
||||
grid-template-columns: 25rem 1fr;
|
||||
&[data-v-ebb20958] > * {
|
||||
& > * {
|
||||
grid-row: 1;
|
||||
}
|
||||
}
|
||||
.sad-text[data-v-ebb20958] {
|
||||
.sad-text {
|
||||
grid-column: 1/3;
|
||||
}
|
||||
.sad-girl[data-v-ebb20958] {
|
||||
.sad-girl {
|
||||
grid-column: 2/3;
|
||||
width: min(75vw, 100vh);
|
||||
}
|
||||
6
web/assets/ServerConfigPanel-B-w0HFlz.js → web/assets/ServerConfigPanel-Be4StJmv.js
generated
vendored
6
web/assets/ServerConfigPanel-B-w0HFlz.js → web/assets/ServerConfigPanel-Be4StJmv.js
generated
vendored
@@ -1,7 +1,7 @@
|
||||
var __defProp = Object.defineProperty;
|
||||
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
||||
import { m as createBaseVNode, o as openBlock, f as createElementBlock, a0 as markRaw, d as defineComponent, a as useSettingStore, aS as storeToRefs, a7 as watch, cW as useCopyToClipboard, a3 as useI18n, J as createBlock, P as withCtx, j as unref, c6 as script, Z as toDisplayString, I as renderList, H as Fragment, k as createVNode, l as script$1, L as createCommentVNode, c4 as script$2, cX as FormItem, cw as _sfc_main$1, bV as electronAPI } from "./index-QvfM__ze.js";
|
||||
import { u as useServerConfigStore } from "./serverConfigStore-DCme3xlV.js";
|
||||
import { H as createBaseVNode, o as openBlock, f as createElementBlock, Z as markRaw, d as defineComponent, a as useSettingStore, aS as storeToRefs, a5 as watch, cO as useCopyToClipboard, a1 as useI18n, k as createBlock, M as withCtx, j as unref, bZ as script, X as toDisplayString, E as renderList, F as Fragment, N as createVNode, l as script$1, I as createCommentVNode, bQ as script$2, cP as FormItem, cp as _sfc_main$1, c0 as electronAPI } from "./index-DjNHn37O.js";
|
||||
import { u as useServerConfigStore } from "./serverConfigStore-CvyKFVuP.js";
|
||||
const _hoisted_1$1 = {
|
||||
viewBox: "0 0 24 24",
|
||||
width: "1.2em",
|
||||
@@ -155,4 +155,4 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
||||
export {
|
||||
_sfc_main as default
|
||||
};
|
||||
//# sourceMappingURL=ServerConfigPanel-B-w0HFlz.js.map
|
||||
//# sourceMappingURL=ServerConfigPanel-Be4StJmv.js.map
|
||||
101
web/assets/ServerStartView-48wfE1MS.js
generated
vendored
101
web/assets/ServerStartView-48wfE1MS.js
generated
vendored
@@ -1,101 +0,0 @@
|
||||
var __defProp = Object.defineProperty;
|
||||
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
||||
import { d as defineComponent, a3 as useI18n, ad as ref, c7 as ProgressStatus, t as onMounted, o as openBlock, J as createBlock, P as withCtx, m as createBaseVNode, aG as createTextVNode, Z as toDisplayString, j as unref, f as createElementBlock, L as createCommentVNode, k as createVNode, l as script, i as withDirectives, v as vShow, c8 as BaseTerminal, p as pushScopeId, q as popScopeId, bV as electronAPI, _ as _export_sfc } from "./index-QvfM__ze.js";
|
||||
import { _ as _sfc_main$1 } from "./BaseViewTemplate-BhQMaVFP.js";
|
||||
const _withScopeId = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-4140d62b"), n = n(), popScopeId(), n), "_withScopeId");
|
||||
const _hoisted_1 = { class: "flex flex-col w-full h-full items-center" };
|
||||
const _hoisted_2 = { class: "text-2xl font-bold" };
|
||||
const _hoisted_3 = { key: 0 };
|
||||
const _hoisted_4 = {
|
||||
key: 0,
|
||||
class: "flex flex-col items-center gap-4"
|
||||
};
|
||||
const _hoisted_5 = { class: "flex items-center my-4 gap-2" };
|
||||
const _sfc_main = /* @__PURE__ */ defineComponent({
|
||||
__name: "ServerStartView",
|
||||
setup(__props) {
|
||||
const electron = electronAPI();
|
||||
const { t } = useI18n();
|
||||
const status = ref(ProgressStatus.INITIAL_STATE);
|
||||
const electronVersion = ref("");
|
||||
let xterm;
|
||||
const terminalVisible = ref(true);
|
||||
const updateProgress = /* @__PURE__ */ __name(({ status: newStatus }) => {
|
||||
status.value = newStatus;
|
||||
if (newStatus === ProgressStatus.ERROR) terminalVisible.value = false;
|
||||
else xterm?.clear();
|
||||
}, "updateProgress");
|
||||
const terminalCreated = /* @__PURE__ */ __name(({ terminal, useAutoSize }, root) => {
|
||||
xterm = terminal;
|
||||
useAutoSize({ root, autoRows: true, autoCols: true });
|
||||
electron.onLogMessage((message) => {
|
||||
terminal.write(message);
|
||||
});
|
||||
terminal.options.cursorBlink = false;
|
||||
terminal.options.disableStdin = true;
|
||||
terminal.options.cursorInactiveStyle = "block";
|
||||
}, "terminalCreated");
|
||||
const reinstall = /* @__PURE__ */ __name(() => electron.reinstall(), "reinstall");
|
||||
const reportIssue = /* @__PURE__ */ __name(() => {
|
||||
window.open("https://forum.comfy.org/c/v1-feedback/", "_blank");
|
||||
}, "reportIssue");
|
||||
const openLogs = /* @__PURE__ */ __name(() => electron.openLogsFolder(), "openLogs");
|
||||
onMounted(async () => {
|
||||
electron.sendReady();
|
||||
electron.onProgressUpdate(updateProgress);
|
||||
electronVersion.value = await electron.getElectronVersion();
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return openBlock(), createBlock(_sfc_main$1, {
|
||||
dark: "",
|
||||
class: "flex-col"
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createBaseVNode("div", _hoisted_1, [
|
||||
createBaseVNode("h2", _hoisted_2, [
|
||||
createTextVNode(toDisplayString(unref(t)(`serverStart.process.${status.value}`)) + " ", 1),
|
||||
status.value === unref(ProgressStatus).ERROR ? (openBlock(), createElementBlock("span", _hoisted_3, " v" + toDisplayString(electronVersion.value), 1)) : createCommentVNode("", true)
|
||||
]),
|
||||
status.value === unref(ProgressStatus).ERROR ? (openBlock(), createElementBlock("div", _hoisted_4, [
|
||||
createBaseVNode("div", _hoisted_5, [
|
||||
createVNode(unref(script), {
|
||||
icon: "pi pi-flag",
|
||||
severity: "secondary",
|
||||
label: unref(t)("serverStart.reportIssue"),
|
||||
onClick: reportIssue
|
||||
}, null, 8, ["label"]),
|
||||
createVNode(unref(script), {
|
||||
icon: "pi pi-file",
|
||||
severity: "secondary",
|
||||
label: unref(t)("serverStart.openLogs"),
|
||||
onClick: openLogs
|
||||
}, null, 8, ["label"]),
|
||||
createVNode(unref(script), {
|
||||
icon: "pi pi-refresh",
|
||||
label: unref(t)("serverStart.reinstall"),
|
||||
onClick: reinstall
|
||||
}, null, 8, ["label"])
|
||||
]),
|
||||
!terminalVisible.value ? (openBlock(), createBlock(unref(script), {
|
||||
key: 0,
|
||||
icon: "pi pi-search",
|
||||
severity: "secondary",
|
||||
label: unref(t)("serverStart.showTerminal"),
|
||||
onClick: _cache[0] || (_cache[0] = ($event) => terminalVisible.value = true)
|
||||
}, null, 8, ["label"])) : createCommentVNode("", true)
|
||||
])) : createCommentVNode("", true),
|
||||
withDirectives(createVNode(BaseTerminal, { onCreated: terminalCreated }, null, 512), [
|
||||
[vShow, terminalVisible.value]
|
||||
])
|
||||
])
|
||||
]),
|
||||
_: 1
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
const ServerStartView = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4140d62b"]]);
|
||||
export {
|
||||
ServerStartView as default
|
||||
};
|
||||
//# sourceMappingURL=ServerStartView-48wfE1MS.js.map
|
||||
98
web/assets/ServerStartView-CIDTUh4x.js
generated
vendored
Normal file
98
web/assets/ServerStartView-CIDTUh4x.js
generated
vendored
Normal file
@@ -0,0 +1,98 @@
|
||||
var __defProp = Object.defineProperty;
|
||||
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
||||
import { d as defineComponent, a1 as useI18n, ab as ref, b_ as ProgressStatus, m as onMounted, o as openBlock, k as createBlock, M as withCtx, H as createBaseVNode, aE as createTextVNode, X as toDisplayString, j as unref, f as createElementBlock, I as createCommentVNode, N as createVNode, l as script, i as withDirectives, v as vShow, b$ as BaseTerminal, aL as pushScopeId, aM as popScopeId, c0 as electronAPI, _ as _export_sfc } from "./index-DjNHn37O.js";
|
||||
import { _ as _sfc_main$1 } from "./BaseViewTemplate-BNGF4K22.js";
|
||||
const _withScopeId = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-42c1131d"), n = n(), popScopeId(), n), "_withScopeId");
|
||||
const _hoisted_1 = { class: "text-2xl font-bold" };
|
||||
const _hoisted_2 = { key: 0 };
|
||||
const _hoisted_3 = {
|
||||
key: 0,
|
||||
class: "flex flex-col items-center gap-4"
|
||||
};
|
||||
const _hoisted_4 = { class: "flex items-center my-4 gap-2" };
|
||||
const _sfc_main = /* @__PURE__ */ defineComponent({
|
||||
__name: "ServerStartView",
|
||||
setup(__props) {
|
||||
const electron = electronAPI();
|
||||
const { t } = useI18n();
|
||||
const status = ref(ProgressStatus.INITIAL_STATE);
|
||||
const electronVersion = ref("");
|
||||
let xterm;
|
||||
const terminalVisible = ref(true);
|
||||
const updateProgress = /* @__PURE__ */ __name(({ status: newStatus }) => {
|
||||
status.value = newStatus;
|
||||
if (newStatus === ProgressStatus.ERROR) terminalVisible.value = false;
|
||||
else xterm?.clear();
|
||||
}, "updateProgress");
|
||||
const terminalCreated = /* @__PURE__ */ __name(({ terminal, useAutoSize }, root) => {
|
||||
xterm = terminal;
|
||||
useAutoSize(root, true, true);
|
||||
electron.onLogMessage((message) => {
|
||||
terminal.write(message);
|
||||
});
|
||||
terminal.options.cursorBlink = false;
|
||||
terminal.options.disableStdin = true;
|
||||
terminal.options.cursorInactiveStyle = "block";
|
||||
}, "terminalCreated");
|
||||
const reinstall = /* @__PURE__ */ __name(() => electron.reinstall(), "reinstall");
|
||||
const reportIssue = /* @__PURE__ */ __name(() => {
|
||||
window.open("https://forum.comfy.org/c/v1-feedback/", "_blank");
|
||||
}, "reportIssue");
|
||||
const openLogs = /* @__PURE__ */ __name(() => electron.openLogsFolder(), "openLogs");
|
||||
onMounted(async () => {
|
||||
electron.sendReady();
|
||||
electron.onProgressUpdate(updateProgress);
|
||||
electronVersion.value = await electron.getElectronVersion();
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return openBlock(), createBlock(_sfc_main$1, {
|
||||
dark: "",
|
||||
class: "flex-col"
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createBaseVNode("h2", _hoisted_1, [
|
||||
createTextVNode(toDisplayString(unref(t)(`serverStart.process.${status.value}`)) + " ", 1),
|
||||
status.value === unref(ProgressStatus).ERROR ? (openBlock(), createElementBlock("span", _hoisted_2, " v" + toDisplayString(electronVersion.value), 1)) : createCommentVNode("", true)
|
||||
]),
|
||||
status.value === unref(ProgressStatus).ERROR ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
||||
createBaseVNode("div", _hoisted_4, [
|
||||
createVNode(unref(script), {
|
||||
icon: "pi pi-flag",
|
||||
severity: "secondary",
|
||||
label: unref(t)("serverStart.reportIssue"),
|
||||
onClick: reportIssue
|
||||
}, null, 8, ["label"]),
|
||||
createVNode(unref(script), {
|
||||
icon: "pi pi-file",
|
||||
severity: "secondary",
|
||||
label: unref(t)("serverStart.openLogs"),
|
||||
onClick: openLogs
|
||||
}, null, 8, ["label"]),
|
||||
createVNode(unref(script), {
|
||||
icon: "pi pi-refresh",
|
||||
label: unref(t)("serverStart.reinstall"),
|
||||
onClick: reinstall
|
||||
}, null, 8, ["label"])
|
||||
]),
|
||||
!terminalVisible.value ? (openBlock(), createBlock(unref(script), {
|
||||
key: 0,
|
||||
icon: "pi pi-search",
|
||||
severity: "secondary",
|
||||
label: unref(t)("serverStart.showTerminal"),
|
||||
onClick: _cache[0] || (_cache[0] = ($event) => terminalVisible.value = true)
|
||||
}, null, 8, ["label"])) : createCommentVNode("", true)
|
||||
])) : createCommentVNode("", true),
|
||||
withDirectives(createVNode(BaseTerminal, { onCreated: terminalCreated }, null, 512), [
|
||||
[vShow, terminalVisible.value]
|
||||
])
|
||||
]),
|
||||
_: 1
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
const ServerStartView = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-42c1131d"]]);
|
||||
export {
|
||||
ServerStartView as default
|
||||
};
|
||||
//# sourceMappingURL=ServerStartView-CIDTUh4x.js.map
|
||||
2
web/assets/ServerStartView-CJiwVDQY.css → web/assets/ServerStartView-CnyN4Ib6.css
generated
vendored
2
web/assets/ServerStartView-CJiwVDQY.css → web/assets/ServerStartView-CnyN4Ib6.css
generated
vendored
@@ -1,5 +1,5 @@
|
||||
|
||||
[data-v-4140d62b] .xterm-helper-textarea {
|
||||
[data-v-42c1131d] .xterm-helper-textarea {
|
||||
/* Hide this as it moves all over when uv is running */
|
||||
display: none;
|
||||
}
|
||||
6
web/assets/UserSelectView-CXmVKOeK.js → web/assets/UserSelectView-B3jYchWu.js
generated
vendored
6
web/assets/UserSelectView-CXmVKOeK.js → web/assets/UserSelectView-B3jYchWu.js
generated
vendored
@@ -1,7 +1,7 @@
|
||||
var __defProp = Object.defineProperty;
|
||||
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
||||
import { d as defineComponent, aX as useUserStore, c2 as useRouter, ad as ref, c as computed, t as onMounted, o as openBlock, J as createBlock, P as withCtx, m as createBaseVNode, Z as toDisplayString, k as createVNode, c3 as withKeys, j as unref, ax as script, c4 as script$1, c5 as script$2, c6 as script$3, aG as createTextVNode, L as createCommentVNode, l as script$4 } from "./index-QvfM__ze.js";
|
||||
import { _ as _sfc_main$1 } from "./BaseViewTemplate-BhQMaVFP.js";
|
||||
import { d as defineComponent, aX as useUserStore, bW as useRouter, ab as ref, c as computed, m as onMounted, o as openBlock, k as createBlock, M as withCtx, H as createBaseVNode, X as toDisplayString, N as createVNode, bX as withKeys, j as unref, av as script, bQ as script$1, bY as script$2, bZ as script$3, aE as createTextVNode, I as createCommentVNode, l as script$4 } from "./index-DjNHn37O.js";
|
||||
import { _ as _sfc_main$1 } from "./BaseViewTemplate-BNGF4K22.js";
|
||||
const _hoisted_1 = {
|
||||
id: "comfy-user-selection",
|
||||
class: "min-w-84 relative rounded-lg bg-[var(--comfy-menu-bg)] p-5 px-10 shadow-lg"
|
||||
@@ -99,4 +99,4 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
||||
export {
|
||||
_sfc_main as default
|
||||
};
|
||||
//# sourceMappingURL=UserSelectView-CXmVKOeK.js.map
|
||||
//# sourceMappingURL=UserSelectView-B3jYchWu.js.map
|
||||
6
web/assets/WelcomeView-C8whKl15.js → web/assets/WelcomeView-N0ZXLjdi.js
generated
vendored
6
web/assets/WelcomeView-C8whKl15.js → web/assets/WelcomeView-N0ZXLjdi.js
generated
vendored
@@ -1,7 +1,7 @@
|
||||
var __defProp = Object.defineProperty;
|
||||
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
||||
import { d as defineComponent, c2 as useRouter, o as openBlock, J as createBlock, P as withCtx, m as createBaseVNode, Z as toDisplayString, k as createVNode, j as unref, l as script, p as pushScopeId, q as popScopeId, _ as _export_sfc } from "./index-QvfM__ze.js";
|
||||
import { _ as _sfc_main$1 } from "./BaseViewTemplate-BhQMaVFP.js";
|
||||
import { d as defineComponent, bW as useRouter, o as openBlock, k as createBlock, M as withCtx, H as createBaseVNode, X as toDisplayString, N as createVNode, j as unref, l as script, aL as pushScopeId, aM as popScopeId, _ as _export_sfc } from "./index-DjNHn37O.js";
|
||||
import { _ as _sfc_main$1 } from "./BaseViewTemplate-BNGF4K22.js";
|
||||
const _withScopeId = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-7dfaf74c"), n = n(), popScopeId(), n), "_withScopeId");
|
||||
const _hoisted_1 = { class: "flex flex-col items-center justify-center gap-8 p-8" };
|
||||
const _hoisted_2 = { class: "animated-gradient-text text-glow select-none" };
|
||||
@@ -37,4 +37,4 @@ const WelcomeView = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-
|
||||
export {
|
||||
WelcomeView as default
|
||||
};
|
||||
//# sourceMappingURL=WelcomeView-C8whKl15.js.map
|
||||
//# sourceMappingURL=WelcomeView-N0ZXLjdi.js.map
|
||||
27
web/assets/index-5HFeZax4.js
generated
vendored
Normal file
27
web/assets/index-5HFeZax4.js
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
var __defProp = Object.defineProperty;
|
||||
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
||||
import { ct as script$1, H as createBaseVNode, o as openBlock, f as createElementBlock, D as mergeProps } from "./index-DjNHn37O.js";
|
||||
var script = {
|
||||
name: "PlusIcon",
|
||||
"extends": script$1
|
||||
};
|
||||
var _hoisted_1 = /* @__PURE__ */ createBaseVNode("path", {
|
||||
d: "M7.67742 6.32258V0.677419C7.67742 0.497757 7.60605 0.325452 7.47901 0.198411C7.35197 0.0713707 7.17966 0 7 0C6.82034 0 6.64803 0.0713707 6.52099 0.198411C6.39395 0.325452 6.32258 0.497757 6.32258 0.677419V6.32258H0.677419C0.497757 6.32258 0.325452 6.39395 0.198411 6.52099C0.0713707 6.64803 0 6.82034 0 7C0 7.17966 0.0713707 7.35197 0.198411 7.47901C0.325452 7.60605 0.497757 7.67742 0.677419 7.67742H6.32258V13.3226C6.32492 13.5015 6.39704 13.6725 6.52358 13.799C6.65012 13.9255 6.82106 13.9977 7 14C7.17966 14 7.35197 13.9286 7.47901 13.8016C7.60605 13.6745 7.67742 13.5022 7.67742 13.3226V7.67742H13.3226C13.5022 7.67742 13.6745 7.60605 13.8016 7.47901C13.9286 7.35197 14 7.17966 14 7C13.9977 6.82106 13.9255 6.65012 13.799 6.52358C13.6725 6.39704 13.5015 6.32492 13.3226 6.32258H7.67742Z",
|
||||
fill: "currentColor"
|
||||
}, null, -1);
|
||||
var _hoisted_2 = [_hoisted_1];
|
||||
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return openBlock(), createElementBlock("svg", mergeProps({
|
||||
width: "14",
|
||||
height: "14",
|
||||
viewBox: "0 0 14 14",
|
||||
fill: "none",
|
||||
xmlns: "http://www.w3.org/2000/svg"
|
||||
}, _ctx.pti()), _hoisted_2, 16);
|
||||
}
|
||||
__name(render, "render");
|
||||
script.render = render;
|
||||
export {
|
||||
script as s
|
||||
};
|
||||
//# sourceMappingURL=index-5HFeZax4.js.map
|
||||
4
web/assets/index-Q1cQr26V.js → web/assets/index-B-aVupP5.js
generated
vendored
4
web/assets/index-Q1cQr26V.js → web/assets/index-B-aVupP5.js
generated
vendored
@@ -1,6 +1,6 @@
|
||||
var __defProp = Object.defineProperty;
|
||||
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
||||
import { cA as script$1, m as createBaseVNode, o as openBlock, f as createElementBlock, G as mergeProps } from "./index-QvfM__ze.js";
|
||||
import { ct as script$1, H as createBaseVNode, o as openBlock, f as createElementBlock, D as mergeProps } from "./index-DjNHn37O.js";
|
||||
var script = {
|
||||
name: "BarsIcon",
|
||||
"extends": script$1
|
||||
@@ -26,4 +26,4 @@ script.render = render;
|
||||
export {
|
||||
script as s
|
||||
};
|
||||
//# sourceMappingURL=index-Q1cQr26V.js.map
|
||||
//# sourceMappingURL=index-B-aVupP5.js.map
|
||||
7
web/assets/index-DpF-ptbJ.js → web/assets/index-B5F0uxTQ.js
generated
vendored
7
web/assets/index-DpF-ptbJ.js → web/assets/index-B5F0uxTQ.js
generated
vendored
@@ -1,7 +1,8 @@
|
||||
var __defProp = Object.defineProperty;
|
||||
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
||||
import { B as BaseStyle, y as script$s, cA as script$t, m as createBaseVNode, o as openBlock, f as createElementBlock, G as mergeProps, Z as toDisplayString, U as Ripple, r as resolveDirective, i as withDirectives, J as createBlock, K as resolveDynamicComponent, c5 as script$u, aD as resolveComponent, V as normalizeClass, aF as createSlots, P as withCtx, bG as script$v, bD as script$w, H as Fragment, I as renderList, aG as createTextVNode, bx as setAttribute, am as UniqueComponentId, bv as normalizeProps, M as renderSlot, L as createCommentVNode, T as equals, br as script$x, cg as script$y, cB as getFirstFocusableElement, ap as OverlayEventBus, E as getVNodeProp, ao as resolveFieldData, cC as invokeElementMethod, Q as getAttribute, cD as getNextElementSibling, C as getOuterWidth, cE as getPreviousElementSibling, l as script$z, aA as script$A, Y as script$B, bu as script$D, al as isNotEmpty, b3 as withModifiers, D as getOuterHeight, cF as _default, an as ZIndex, S as focus, ar as addStyle, at as absolutePosition, au as ConnectedOverlayScrollHandler, av as isTouchDevice, cG as FilterOperator, az as script$E, cH as script$F, cI as FocusTrap, k as createVNode, aE as Transition, c3 as withKeys, cJ as getIndex, aW as script$G, cK as isClickable, cL as clearSelection, cM as localeComparator, cN as sort, cO as FilterService, cu as FilterMatchMode, R as findSingle, c9 as findIndexInList, ca as find, cP as exportCSV, W as getOffset, cQ as getHiddenElementOuterWidth, cR as getHiddenElementOuterHeight, cS as reorderArray, cT as getWindowScrollTop, cU as removeClass, cV as addClass, aq as isEmpty, ay as script$H, aB as script$I } from "./index-QvfM__ze.js";
|
||||
import { s as script$C } from "./index-Q1cQr26V.js";
|
||||
import { B as BaseStyle, q as script$s, ct as script$t, H as createBaseVNode, o as openBlock, f as createElementBlock, D as mergeProps, X as toDisplayString, S as Ripple, r as resolveDirective, i as withDirectives, k as createBlock, G as resolveDynamicComponent, bY as script$u, aB as resolveComponent, T as normalizeClass, aD as createSlots, M as withCtx, bz as script$v, bw as script$w, F as Fragment, E as renderList, aE as createTextVNode, bq as setAttribute, ak as UniqueComponentId, bo as normalizeProps, J as renderSlot, I as createCommentVNode, R as equals, bk as script$x, c8 as script$y, cu as getFirstFocusableElement, an as OverlayEventBus, A as getVNodeProp, am as resolveFieldData, cv as invokeElementMethod, O as getAttribute, cw as getNextElementSibling, y as getOuterWidth, cx as getPreviousElementSibling, l as script$z, ay as script$A, W as script$B, bn as script$D, aj as isNotEmpty, bM as withModifiers, z as getOuterHeight, cy as _default, al as ZIndex, Q as focus, ap as addStyle, ar as absolutePosition, as as ConnectedOverlayScrollHandler, at as isTouchDevice, cz as FilterOperator, ax as script$E, cA as FocusTrap, N as createVNode, aC as Transition, bX as withKeys, cB as getIndex, aW as script$G, cC as isClickable, cD as clearSelection, cE as localeComparator, cF as sort, cG as FilterService, cn as FilterMatchMode, P as findSingle, c1 as findIndexInList, c2 as find, cH as exportCSV, U as getOffset, cI as getHiddenElementOuterWidth, cJ as getHiddenElementOuterHeight, cK as reorderArray, cL as getWindowScrollTop, cM as removeClass, cN as addClass, ao as isEmpty, aw as script$H, az as script$I } from "./index-DjNHn37O.js";
|
||||
import { s as script$C } from "./index-B-aVupP5.js";
|
||||
import { s as script$F } from "./index-5HFeZax4.js";
|
||||
var ColumnStyle = BaseStyle.extend({
|
||||
name: "column"
|
||||
});
|
||||
@@ -8782,4 +8783,4 @@ export {
|
||||
script as a,
|
||||
script$r as s
|
||||
};
|
||||
//# sourceMappingURL=index-DpF-ptbJ.js.map
|
||||
//# sourceMappingURL=index-B5F0uxTQ.js.map
|
||||
595
web/assets/index-je62U6DH.js → web/assets/index-Bordpmzt.js
generated
vendored
595
web/assets/index-je62U6DH.js → web/assets/index-Bordpmzt.js
generated
vendored
@@ -1,6 +1,6 @@
|
||||
var __defProp = Object.defineProperty;
|
||||
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
||||
import { ci as ComfyDialog, cj as $el, ck as ComfyApp, h as app, a5 as LiteGraph, bl as LGraphCanvas, cl as useExtensionService, cm as processDynamicPrompt, bT as isElectron, bV as electronAPI, bW as useDialogService, cn as t, co as DraggableList, bA as useToastStore, aj as LGraphNode, cp as applyTextReplacements, cq as ComfyWidgets, cr as addValueControlWidgets, a8 as useNodeDefStore, cs as serialise, ct as deserialiseAndCreate, bh as api, a as useSettingStore, ai as LGraphGroup, af as nextTick, bO as lodashExports, bg as setStorageValue, bb as getStorageValue } from "./index-QvfM__ze.js";
|
||||
import { ca as ComfyDialog, cb as $el, cc as ComfyApp, h as app, a3 as LiteGraph, bd as LGraphCanvas, cd as useExtensionService, ce as processDynamicPrompt, cf as isElectron, c0 as electronAPI, bR as useDialogService, cg as t, ch as DraggableList, bt as useToastStore, ah as LGraphNode, ci as applyTextReplacements, cj as ComfyWidgets, ck as addValueControlWidgets, a6 as useNodeDefStore, cl as serialise, cm as deserialiseAndCreate, b8 as api, a as useSettingStore, ag as LGraphGroup, ad as nextTick } from "./index-DjNHn37O.js";
|
||||
class ClipspaceDialog extends ComfyDialog {
|
||||
static {
|
||||
__name(this, "ClipspaceDialog");
|
||||
@@ -441,24 +441,10 @@ app.registerExtension({
|
||||
{
|
||||
id: "Comfy-Desktop.SendStatistics",
|
||||
category: ["Comfy-Desktop", "General", "Send Statistics"],
|
||||
name: "Send anonymous usage metrics",
|
||||
name: "Send anonymous crash reports",
|
||||
type: "boolean",
|
||||
defaultValue: true,
|
||||
onChange: onChangeRestartApp
|
||||
},
|
||||
{
|
||||
id: "Comfy-Desktop.WindowStyle",
|
||||
category: ["Comfy-Desktop", "General", "Window Style"],
|
||||
name: "Window Style",
|
||||
tooltip: "Choose custom option to hide the system title bar",
|
||||
type: "combo",
|
||||
experimental: true,
|
||||
defaultValue: "default",
|
||||
options: ["default", "custom"],
|
||||
onChange: /* @__PURE__ */ __name((newValue, oldValue) => {
|
||||
electronAPI$1.Config.setWindowStyle(newValue);
|
||||
onChangeRestartApp(newValue, oldValue);
|
||||
}, "onChange")
|
||||
}
|
||||
],
|
||||
commands: [
|
||||
@@ -2982,10 +2968,10 @@ function manageGroupNodes(type) {
|
||||
new ManageGroupDialog(app).show(type);
|
||||
}
|
||||
__name(manageGroupNodes, "manageGroupNodes");
|
||||
const id$1 = "Comfy.GroupNode";
|
||||
const id$2 = "Comfy.GroupNode";
|
||||
let globalDefs;
|
||||
const ext = {
|
||||
name: id$1,
|
||||
name: id$2,
|
||||
commands: [
|
||||
{
|
||||
id: "Comfy.GroupNode.ConvertSelectedNodesToGroupNode",
|
||||
@@ -3248,6 +3234,39 @@ app.registerExtension({
|
||||
};
|
||||
}
|
||||
});
|
||||
const id$1 = "Comfy.InvertMenuScrolling";
|
||||
app.registerExtension({
|
||||
name: id$1,
|
||||
init() {
|
||||
const ctxMenu = LiteGraph.ContextMenu;
|
||||
const replace = /* @__PURE__ */ __name(() => {
|
||||
LiteGraph.ContextMenu = function(values, options) {
|
||||
options = options || {};
|
||||
if (options.scroll_speed) {
|
||||
options.scroll_speed *= -1;
|
||||
} else {
|
||||
options.scroll_speed = -0.1;
|
||||
}
|
||||
return ctxMenu.call(this, values, options);
|
||||
};
|
||||
LiteGraph.ContextMenu.prototype = ctxMenu.prototype;
|
||||
}, "replace");
|
||||
app.ui.settings.addSetting({
|
||||
id: id$1,
|
||||
category: ["LiteGraph", "Menu", "InvertMenuScrolling"],
|
||||
name: "Invert Context Menu Scrolling",
|
||||
type: "boolean",
|
||||
defaultValue: false,
|
||||
onChange(value) {
|
||||
if (value) {
|
||||
replace();
|
||||
} else {
|
||||
LiteGraph.ContextMenu = ctxMenu;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2010-2024 Three.js Authors
|
||||
@@ -36342,229 +36361,6 @@ function interceptControlUp(event) {
|
||||
}
|
||||
}
|
||||
__name(interceptControlUp, "interceptControlUp");
|
||||
class ViewHelper extends Object3D {
|
||||
static {
|
||||
__name(this, "ViewHelper");
|
||||
}
|
||||
constructor(camera, domElement) {
|
||||
super();
|
||||
this.isViewHelper = true;
|
||||
this.animating = false;
|
||||
this.center = new Vector3();
|
||||
const color1 = new Color("#ff4466");
|
||||
const color2 = new Color("#88ff44");
|
||||
const color3 = new Color("#4488ff");
|
||||
const color4 = new Color("#000000");
|
||||
const options = {};
|
||||
const interactiveObjects = [];
|
||||
const raycaster = new Raycaster();
|
||||
const mouse = new Vector2();
|
||||
const dummy = new Object3D();
|
||||
const orthoCamera = new OrthographicCamera(-2, 2, 2, -2, 0, 4);
|
||||
orthoCamera.position.set(0, 0, 2);
|
||||
const geometry = new CylinderGeometry(0.04, 0.04, 0.8, 5).rotateZ(-Math.PI / 2).translate(0.4, 0, 0);
|
||||
const xAxis = new Mesh(geometry, getAxisMaterial(color1));
|
||||
const yAxis = new Mesh(geometry, getAxisMaterial(color2));
|
||||
const zAxis = new Mesh(geometry, getAxisMaterial(color3));
|
||||
yAxis.rotation.z = Math.PI / 2;
|
||||
zAxis.rotation.y = -Math.PI / 2;
|
||||
this.add(xAxis);
|
||||
this.add(zAxis);
|
||||
this.add(yAxis);
|
||||
const spriteMaterial1 = getSpriteMaterial(color1);
|
||||
const spriteMaterial2 = getSpriteMaterial(color2);
|
||||
const spriteMaterial3 = getSpriteMaterial(color3);
|
||||
const spriteMaterial4 = getSpriteMaterial(color4);
|
||||
const posXAxisHelper = new Sprite(spriteMaterial1);
|
||||
const posYAxisHelper = new Sprite(spriteMaterial2);
|
||||
const posZAxisHelper = new Sprite(spriteMaterial3);
|
||||
const negXAxisHelper = new Sprite(spriteMaterial4);
|
||||
const negYAxisHelper = new Sprite(spriteMaterial4);
|
||||
const negZAxisHelper = new Sprite(spriteMaterial4);
|
||||
posXAxisHelper.position.x = 1;
|
||||
posYAxisHelper.position.y = 1;
|
||||
posZAxisHelper.position.z = 1;
|
||||
negXAxisHelper.position.x = -1;
|
||||
negYAxisHelper.position.y = -1;
|
||||
negZAxisHelper.position.z = -1;
|
||||
negXAxisHelper.material.opacity = 0.2;
|
||||
negYAxisHelper.material.opacity = 0.2;
|
||||
negZAxisHelper.material.opacity = 0.2;
|
||||
posXAxisHelper.userData.type = "posX";
|
||||
posYAxisHelper.userData.type = "posY";
|
||||
posZAxisHelper.userData.type = "posZ";
|
||||
negXAxisHelper.userData.type = "negX";
|
||||
negYAxisHelper.userData.type = "negY";
|
||||
negZAxisHelper.userData.type = "negZ";
|
||||
this.add(posXAxisHelper);
|
||||
this.add(posYAxisHelper);
|
||||
this.add(posZAxisHelper);
|
||||
this.add(negXAxisHelper);
|
||||
this.add(negYAxisHelper);
|
||||
this.add(negZAxisHelper);
|
||||
interactiveObjects.push(posXAxisHelper);
|
||||
interactiveObjects.push(posYAxisHelper);
|
||||
interactiveObjects.push(posZAxisHelper);
|
||||
interactiveObjects.push(negXAxisHelper);
|
||||
interactiveObjects.push(negYAxisHelper);
|
||||
interactiveObjects.push(negZAxisHelper);
|
||||
const point = new Vector3();
|
||||
const dim = 128;
|
||||
const turnRate = 2 * Math.PI;
|
||||
this.render = function(renderer) {
|
||||
this.quaternion.copy(camera.quaternion).invert();
|
||||
this.updateMatrixWorld();
|
||||
point.set(0, 0, 1);
|
||||
point.applyQuaternion(camera.quaternion);
|
||||
const x = domElement.offsetWidth - dim;
|
||||
renderer.clearDepth();
|
||||
renderer.getViewport(viewport);
|
||||
renderer.setViewport(x, 0, dim, dim);
|
||||
renderer.render(this, orthoCamera);
|
||||
renderer.setViewport(viewport.x, viewport.y, viewport.z, viewport.w);
|
||||
};
|
||||
const targetPosition = new Vector3();
|
||||
const targetQuaternion = new Quaternion();
|
||||
const q1 = new Quaternion();
|
||||
const q2 = new Quaternion();
|
||||
const viewport = new Vector4();
|
||||
let radius = 0;
|
||||
this.handleClick = function(event) {
|
||||
if (this.animating === true) return false;
|
||||
const rect = domElement.getBoundingClientRect();
|
||||
const offsetX = rect.left + (domElement.offsetWidth - dim);
|
||||
const offsetY = rect.top + (domElement.offsetHeight - dim);
|
||||
mouse.x = (event.clientX - offsetX) / (rect.right - offsetX) * 2 - 1;
|
||||
mouse.y = -((event.clientY - offsetY) / (rect.bottom - offsetY)) * 2 + 1;
|
||||
raycaster.setFromCamera(mouse, orthoCamera);
|
||||
const intersects2 = raycaster.intersectObjects(interactiveObjects);
|
||||
if (intersects2.length > 0) {
|
||||
const intersection = intersects2[0];
|
||||
const object = intersection.object;
|
||||
prepareAnimationData(object, this.center);
|
||||
this.animating = true;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
this.setLabels = function(labelX, labelY, labelZ) {
|
||||
options.labelX = labelX;
|
||||
options.labelY = labelY;
|
||||
options.labelZ = labelZ;
|
||||
updateLabels();
|
||||
};
|
||||
this.setLabelStyle = function(font, color, radius2) {
|
||||
options.font = font;
|
||||
options.color = color;
|
||||
options.radius = radius2;
|
||||
updateLabels();
|
||||
};
|
||||
this.update = function(delta) {
|
||||
const step = delta * turnRate;
|
||||
q1.rotateTowards(q2, step);
|
||||
camera.position.set(0, 0, 1).applyQuaternion(q1).multiplyScalar(radius).add(this.center);
|
||||
camera.quaternion.rotateTowards(targetQuaternion, step);
|
||||
if (q1.angleTo(q2) === 0) {
|
||||
this.animating = false;
|
||||
}
|
||||
};
|
||||
this.dispose = function() {
|
||||
geometry.dispose();
|
||||
xAxis.material.dispose();
|
||||
yAxis.material.dispose();
|
||||
zAxis.material.dispose();
|
||||
posXAxisHelper.material.map.dispose();
|
||||
posYAxisHelper.material.map.dispose();
|
||||
posZAxisHelper.material.map.dispose();
|
||||
negXAxisHelper.material.map.dispose();
|
||||
negYAxisHelper.material.map.dispose();
|
||||
negZAxisHelper.material.map.dispose();
|
||||
posXAxisHelper.material.dispose();
|
||||
posYAxisHelper.material.dispose();
|
||||
posZAxisHelper.material.dispose();
|
||||
negXAxisHelper.material.dispose();
|
||||
negYAxisHelper.material.dispose();
|
||||
negZAxisHelper.material.dispose();
|
||||
};
|
||||
function prepareAnimationData(object, focusPoint) {
|
||||
switch (object.userData.type) {
|
||||
case "posX":
|
||||
targetPosition.set(1, 0, 0);
|
||||
targetQuaternion.setFromEuler(new Euler(0, Math.PI * 0.5, 0));
|
||||
break;
|
||||
case "posY":
|
||||
targetPosition.set(0, 1, 0);
|
||||
targetQuaternion.setFromEuler(new Euler(-Math.PI * 0.5, 0, 0));
|
||||
break;
|
||||
case "posZ":
|
||||
targetPosition.set(0, 0, 1);
|
||||
targetQuaternion.setFromEuler(new Euler());
|
||||
break;
|
||||
case "negX":
|
||||
targetPosition.set(-1, 0, 0);
|
||||
targetQuaternion.setFromEuler(new Euler(0, -Math.PI * 0.5, 0));
|
||||
break;
|
||||
case "negY":
|
||||
targetPosition.set(0, -1, 0);
|
||||
targetQuaternion.setFromEuler(new Euler(Math.PI * 0.5, 0, 0));
|
||||
break;
|
||||
case "negZ":
|
||||
targetPosition.set(0, 0, -1);
|
||||
targetQuaternion.setFromEuler(new Euler(0, Math.PI, 0));
|
||||
break;
|
||||
default:
|
||||
console.error("ViewHelper: Invalid axis.");
|
||||
}
|
||||
radius = camera.position.distanceTo(focusPoint);
|
||||
targetPosition.multiplyScalar(radius).add(focusPoint);
|
||||
dummy.position.copy(focusPoint);
|
||||
dummy.lookAt(camera.position);
|
||||
q1.copy(dummy.quaternion);
|
||||
dummy.lookAt(targetPosition);
|
||||
q2.copy(dummy.quaternion);
|
||||
}
|
||||
__name(prepareAnimationData, "prepareAnimationData");
|
||||
function getAxisMaterial(color) {
|
||||
return new MeshBasicMaterial({ color, toneMapped: false });
|
||||
}
|
||||
__name(getAxisMaterial, "getAxisMaterial");
|
||||
function getSpriteMaterial(color, text) {
|
||||
const { font = "24px Arial", color: labelColor = "#000000", radius: radius2 = 14 } = options;
|
||||
const canvas = document.createElement("canvas");
|
||||
canvas.width = 64;
|
||||
canvas.height = 64;
|
||||
const context = canvas.getContext("2d");
|
||||
context.beginPath();
|
||||
context.arc(32, 32, radius2, 0, 2 * Math.PI);
|
||||
context.closePath();
|
||||
context.fillStyle = color.getStyle();
|
||||
context.fill();
|
||||
if (text) {
|
||||
context.font = font;
|
||||
context.textAlign = "center";
|
||||
context.fillStyle = labelColor;
|
||||
context.fillText(text, 32, 41);
|
||||
}
|
||||
const texture = new CanvasTexture(canvas);
|
||||
texture.colorSpace = SRGBColorSpace;
|
||||
return new SpriteMaterial({ map: texture, toneMapped: false });
|
||||
}
|
||||
__name(getSpriteMaterial, "getSpriteMaterial");
|
||||
function updateLabels() {
|
||||
posXAxisHelper.material.map.dispose();
|
||||
posYAxisHelper.material.map.dispose();
|
||||
posZAxisHelper.material.map.dispose();
|
||||
posXAxisHelper.material.dispose();
|
||||
posYAxisHelper.material.dispose();
|
||||
posZAxisHelper.material.dispose();
|
||||
posXAxisHelper.material = getSpriteMaterial(color1, options.labelX);
|
||||
posYAxisHelper.material = getSpriteMaterial(color2, options.labelY);
|
||||
posZAxisHelper.material = getSpriteMaterial(color3, options.labelZ);
|
||||
}
|
||||
__name(updateLabels, "updateLabels");
|
||||
}
|
||||
}
|
||||
/*!
|
||||
fflate - fast JavaScript compression/decompression
|
||||
<https://101arrowz.github.io/fflate>
|
||||
@@ -46037,6 +45833,7 @@ class Load3d {
|
||||
stlLoader;
|
||||
currentModel = null;
|
||||
originalModel = null;
|
||||
node;
|
||||
animationFrameId = null;
|
||||
gridHelper;
|
||||
lights = [];
|
||||
@@ -46049,10 +45846,6 @@ class Load3d {
|
||||
materialMode = "original";
|
||||
currentUpDirection = "original";
|
||||
originalRotation = null;
|
||||
viewHelper;
|
||||
viewHelperContainer;
|
||||
cameraSwitcherContainer;
|
||||
gridSwitcherContainer;
|
||||
constructor(container) {
|
||||
this.scene = new Scene();
|
||||
this.perspectiveCamera = new PerspectiveCamera(75, 1, 0.1, 1e3);
|
||||
@@ -46073,7 +45866,6 @@ class Load3d {
|
||||
this.renderer = new WebGLRenderer({ alpha: true, antialias: true });
|
||||
this.renderer.setSize(300, 300);
|
||||
this.renderer.setClearColor(2631720);
|
||||
this.renderer.autoClear = false;
|
||||
const rendererDomElement = this.renderer.domElement;
|
||||
container.appendChild(rendererDomElement);
|
||||
this.controls = new OrbitControls(
|
||||
@@ -46109,113 +45901,10 @@ class Load3d {
|
||||
side: DoubleSide
|
||||
});
|
||||
this.standardMaterial = this.createSTLMaterial();
|
||||
this.createViewHelper(container);
|
||||
this.createGridSwitcher(container);
|
||||
this.createCameraSwitcher(container);
|
||||
this.animate();
|
||||
this.handleResize();
|
||||
this.startAnimation();
|
||||
}
|
||||
createViewHelper(container) {
|
||||
this.viewHelperContainer = document.createElement("div");
|
||||
this.viewHelperContainer.style.position = "absolute";
|
||||
this.viewHelperContainer.style.bottom = "0";
|
||||
this.viewHelperContainer.style.left = "0";
|
||||
this.viewHelperContainer.style.width = "128px";
|
||||
this.viewHelperContainer.style.height = "128px";
|
||||
this.viewHelperContainer.addEventListener("pointerup", (event) => {
|
||||
event.stopPropagation();
|
||||
this.viewHelper.handleClick(event);
|
||||
});
|
||||
this.viewHelperContainer.addEventListener("pointerdown", (event) => {
|
||||
event.stopPropagation();
|
||||
});
|
||||
container.appendChild(this.viewHelperContainer);
|
||||
this.viewHelper = new ViewHelper(
|
||||
this.activeCamera,
|
||||
this.viewHelperContainer
|
||||
);
|
||||
this.viewHelper.center = this.controls.target;
|
||||
}
|
||||
createGridSwitcher(container) {
|
||||
this.gridSwitcherContainer = document.createElement("div");
|
||||
this.gridSwitcherContainer.style.position = "absolute";
|
||||
this.gridSwitcherContainer.style.top = "28px";
|
||||
this.gridSwitcherContainer.style.left = "3px";
|
||||
this.gridSwitcherContainer.style.width = "20px";
|
||||
this.gridSwitcherContainer.style.height = "20px";
|
||||
this.gridSwitcherContainer.style.cursor = "pointer";
|
||||
this.gridSwitcherContainer.style.alignItems = "center";
|
||||
this.gridSwitcherContainer.style.justifyContent = "center";
|
||||
this.gridSwitcherContainer.style.transition = "background-color 0.2s";
|
||||
const gridIcon = document.createElement("div");
|
||||
gridIcon.innerHTML = `
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2">
|
||||
<path d="M3 3h18v18H3z"/>
|
||||
<path d="M3 9h18"/>
|
||||
<path d="M3 15h18"/>
|
||||
<path d="M9 3v18"/>
|
||||
<path d="M15 3v18"/>
|
||||
</svg>
|
||||
`;
|
||||
const updateButtonState = /* @__PURE__ */ __name(() => {
|
||||
if (this.gridHelper.visible) {
|
||||
this.gridSwitcherContainer.style.backgroundColor = "rgba(255, 255, 255, 0.2)";
|
||||
} else {
|
||||
this.gridSwitcherContainer.style.backgroundColor = "transparent";
|
||||
}
|
||||
}, "updateButtonState");
|
||||
updateButtonState();
|
||||
this.gridSwitcherContainer.addEventListener("mouseenter", () => {
|
||||
if (!this.gridHelper.visible) {
|
||||
this.gridSwitcherContainer.style.backgroundColor = "rgba(0, 0, 0, 0.5)";
|
||||
}
|
||||
});
|
||||
this.gridSwitcherContainer.addEventListener("mouseleave", () => {
|
||||
if (!this.gridHelper.visible) {
|
||||
this.gridSwitcherContainer.style.backgroundColor = "transparent";
|
||||
}
|
||||
});
|
||||
this.gridSwitcherContainer.title = "Toggle Grid";
|
||||
this.gridSwitcherContainer.addEventListener("click", (event) => {
|
||||
event.stopPropagation();
|
||||
this.toggleGrid(!this.gridHelper.visible);
|
||||
updateButtonState();
|
||||
});
|
||||
this.gridSwitcherContainer.appendChild(gridIcon);
|
||||
container.appendChild(this.gridSwitcherContainer);
|
||||
}
|
||||
createCameraSwitcher(container) {
|
||||
this.cameraSwitcherContainer = document.createElement("div");
|
||||
this.cameraSwitcherContainer.style.position = "absolute";
|
||||
this.cameraSwitcherContainer.style.top = "3px";
|
||||
this.cameraSwitcherContainer.style.left = "3px";
|
||||
this.cameraSwitcherContainer.style.width = "20px";
|
||||
this.cameraSwitcherContainer.style.height = "20px";
|
||||
this.cameraSwitcherContainer.style.cursor = "pointer";
|
||||
this.cameraSwitcherContainer.style.alignItems = "center";
|
||||
this.cameraSwitcherContainer.style.justifyContent = "center";
|
||||
const cameraIcon = document.createElement("div");
|
||||
cameraIcon.innerHTML = `
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2">
|
||||
<path d="M18 4H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2Z"/>
|
||||
<path d="m12 12 4-2.4"/>
|
||||
<circle cx="12" cy="12" r="3"/>
|
||||
</svg>
|
||||
`;
|
||||
this.cameraSwitcherContainer.addEventListener("mouseenter", () => {
|
||||
this.cameraSwitcherContainer.style.backgroundColor = "rgba(0, 0, 0, 0.5)";
|
||||
});
|
||||
this.cameraSwitcherContainer.addEventListener("mouseleave", () => {
|
||||
this.cameraSwitcherContainer.style.backgroundColor = "rgba(0, 0, 0, 0.3)";
|
||||
});
|
||||
this.cameraSwitcherContainer.title = "Switch Camera (Perspective/Orthographic)";
|
||||
this.cameraSwitcherContainer.addEventListener("click", (event) => {
|
||||
event.stopPropagation();
|
||||
this.toggleCamera();
|
||||
});
|
||||
this.cameraSwitcherContainer.appendChild(cameraIcon);
|
||||
container.appendChild(this.cameraSwitcherContainer);
|
||||
}
|
||||
setFOV(fov2) {
|
||||
if (this.activeCamera === this.perspectiveCamera) {
|
||||
this.perspectiveCamera.fov = fov2;
|
||||
@@ -46408,12 +46097,6 @@ class Load3d {
|
||||
this.controls.object = this.activeCamera;
|
||||
this.controls.target.copy(target);
|
||||
this.controls.update();
|
||||
this.viewHelper.dispose();
|
||||
this.viewHelper = new ViewHelper(
|
||||
this.activeCamera,
|
||||
this.viewHelperContainer
|
||||
);
|
||||
this.viewHelper.center = this.controls.target;
|
||||
this.handleResize();
|
||||
}
|
||||
getCurrentCameraType() {
|
||||
@@ -46444,14 +46127,8 @@ class Load3d {
|
||||
startAnimation() {
|
||||
const animate = /* @__PURE__ */ __name(() => {
|
||||
this.animationFrameId = requestAnimationFrame(animate);
|
||||
const delta = this.clock.getDelta();
|
||||
if (this.viewHelper.animating) {
|
||||
this.viewHelper.update(delta);
|
||||
}
|
||||
this.renderer.clear();
|
||||
this.controls.update();
|
||||
this.renderer.render(this.scene, this.activeCamera);
|
||||
this.viewHelper.render(this.renderer);
|
||||
}, "animate");
|
||||
animate();
|
||||
}
|
||||
@@ -46516,7 +46193,6 @@ class Load3d {
|
||||
cancelAnimationFrame(this.animationFrameId);
|
||||
}
|
||||
this.controls.dispose();
|
||||
this.viewHelper.dispose();
|
||||
this.renderer.dispose();
|
||||
this.renderer.domElement.remove();
|
||||
this.scene.clear();
|
||||
@@ -46696,11 +46372,9 @@ class Load3d {
|
||||
this.orthographicCamera.bottom = -frustumSize / 2;
|
||||
this.orthographicCamera.updateProjectionMatrix();
|
||||
}
|
||||
this.renderer.clear();
|
||||
this.renderer.render(this.scene, this.activeCamera);
|
||||
const sceneData = this.renderer.domElement.toDataURL("image/png");
|
||||
this.renderer.setClearColor(0, 0);
|
||||
this.renderer.clear();
|
||||
this.renderer.render(this.scene, this.activeCamera);
|
||||
const maskData = this.renderer.domElement.toDataURL("image/png");
|
||||
this.renderer.setClearColor(originalClearColor, originalClearAlpha);
|
||||
@@ -46721,6 +46395,38 @@ class Load3d {
|
||||
side: DoubleSide
|
||||
});
|
||||
}
|
||||
setViewPosition(position) {
|
||||
if (!this.currentModel) {
|
||||
return;
|
||||
}
|
||||
const box = new Box3();
|
||||
let center = new Vector3();
|
||||
let size = new Vector3();
|
||||
if (this.currentModel) {
|
||||
box.setFromObject(this.currentModel);
|
||||
box.getCenter(center);
|
||||
box.getSize(size);
|
||||
}
|
||||
const maxDim = Math.max(size.x, size.y, size.z);
|
||||
const distance = maxDim * 2;
|
||||
switch (position) {
|
||||
case "front":
|
||||
this.activeCamera.position.set(0, 0, distance);
|
||||
break;
|
||||
case "top":
|
||||
this.activeCamera.position.set(0, distance, 0);
|
||||
break;
|
||||
case "right":
|
||||
this.activeCamera.position.set(distance, 0, 0);
|
||||
break;
|
||||
case "isometric":
|
||||
this.activeCamera.position.set(distance, distance, distance);
|
||||
break;
|
||||
}
|
||||
this.activeCamera.lookAt(center);
|
||||
this.controls.target.copy(center);
|
||||
this.controls.update();
|
||||
}
|
||||
setBackgroundColor(color) {
|
||||
this.renderer.setClearColor(new Color(color));
|
||||
this.renderer.render(this.scene, this.activeCamera);
|
||||
@@ -46830,23 +46536,15 @@ class Load3dAnimation extends Load3d {
|
||||
}
|
||||
});
|
||||
}
|
||||
startAnimation() {
|
||||
const animate = /* @__PURE__ */ __name(() => {
|
||||
this.animationFrameId = requestAnimationFrame(animate);
|
||||
const delta = this.clock.getDelta();
|
||||
animate = /* @__PURE__ */ __name(() => {
|
||||
requestAnimationFrame(this.animate);
|
||||
if (this.currentAnimation && this.isAnimationPlaying) {
|
||||
const delta = this.clock.getDelta();
|
||||
this.currentAnimation.update(delta);
|
||||
}
|
||||
this.controls.update();
|
||||
this.renderer.clear();
|
||||
this.renderer.render(this.scene, this.activeCamera);
|
||||
if (this.viewHelper.animating) {
|
||||
this.viewHelper.update(delta);
|
||||
}
|
||||
this.viewHelper.render(this.renderer);
|
||||
}, "animate");
|
||||
animate();
|
||||
}
|
||||
}
|
||||
function splitFilePath$1(path) {
|
||||
const folder_separator = path.lastIndexOf("/");
|
||||
@@ -46879,7 +46577,7 @@ const load3dCanvasCSSCLASS = `display: flex;
|
||||
width: 100% !important;
|
||||
height: 100% !important;`;
|
||||
const containerToLoad3D = /* @__PURE__ */ new Map();
|
||||
function configureLoad3D(load3d, loadFolder, modelWidget, material, bgColor, lightIntensity, upDirection, fov2, cameraState, postModelUpdateFunc) {
|
||||
function configureLoad3D(load3d, loadFolder, modelWidget, showGrid, cameraType, view, material, bgColor, lightIntensity, upDirection, fov2, cameraState, postModelUpdateFunc) {
|
||||
const createModelUpdateHandler = /* @__PURE__ */ __name(() => {
|
||||
let isFirstLoad = true;
|
||||
return async (value) => {
|
||||
@@ -46913,6 +46611,17 @@ function configureLoad3D(load3d, loadFolder, modelWidget, material, bgColor, lig
|
||||
onModelWidgetUpdate(modelWidget.value);
|
||||
}
|
||||
modelWidget.callback = onModelWidgetUpdate;
|
||||
load3d.toggleGrid(showGrid.value);
|
||||
showGrid.callback = (value) => {
|
||||
load3d.toggleGrid(value);
|
||||
};
|
||||
load3d.toggleCamera(cameraType.value);
|
||||
cameraType.callback = (value) => {
|
||||
load3d.toggleCamera(value);
|
||||
};
|
||||
view.callback = (value) => {
|
||||
load3d.setViewPosition(value);
|
||||
};
|
||||
material.callback = (value) => {
|
||||
load3d.setMaterialMode(value);
|
||||
};
|
||||
@@ -47032,6 +46741,11 @@ app.registerExtension({
|
||||
const modelWidget = node.widgets.find(
|
||||
(w2) => w2.name === "model_file"
|
||||
);
|
||||
const showGrid = node.widgets.find((w2) => w2.name === "show_grid");
|
||||
const cameraType = node.widgets.find(
|
||||
(w2) => w2.name === "camera_type"
|
||||
);
|
||||
const view = node.widgets.find((w2) => w2.name === "view");
|
||||
const material = node.widgets.find((w2) => w2.name === "material");
|
||||
const bgColor = node.widgets.find((w2) => w2.name === "bg_color");
|
||||
const lightIntensity = node.widgets.find(
|
||||
@@ -47055,6 +46769,9 @@ app.registerExtension({
|
||||
load3d,
|
||||
"input",
|
||||
modelWidget,
|
||||
showGrid,
|
||||
cameraType,
|
||||
view,
|
||||
material,
|
||||
bgColor,
|
||||
lightIntensity,
|
||||
@@ -47222,6 +46939,11 @@ app.registerExtension({
|
||||
const modelWidget = node.widgets.find(
|
||||
(w2) => w2.name === "model_file"
|
||||
);
|
||||
const showGrid = node.widgets.find((w2) => w2.name === "show_grid");
|
||||
const cameraType = node.widgets.find(
|
||||
(w2) => w2.name === "camera_type"
|
||||
);
|
||||
const view = node.widgets.find((w2) => w2.name === "view");
|
||||
const material = node.widgets.find((w2) => w2.name === "material");
|
||||
const bgColor = node.widgets.find((w2) => w2.name === "bg_color");
|
||||
const lightIntensity = node.widgets.find(
|
||||
@@ -47254,6 +46976,9 @@ app.registerExtension({
|
||||
load3d,
|
||||
"input",
|
||||
modelWidget,
|
||||
showGrid,
|
||||
cameraType,
|
||||
view,
|
||||
material,
|
||||
bgColor,
|
||||
lightIntensity,
|
||||
@@ -47276,7 +47001,6 @@ app.registerExtension({
|
||||
const h = node.widgets.find((w2) => w2.name === "height");
|
||||
sceneWidget.serializeValue = async () => {
|
||||
node.properties["Camera Info"] = JSON.stringify(load3d.getCameraState());
|
||||
load3d.toggleAnimation(false);
|
||||
const { scene: imageData, mask: maskData } = await load3d.captureScene(
|
||||
w.value,
|
||||
h.value
|
||||
@@ -47357,6 +47081,11 @@ app.registerExtension({
|
||||
const modelWidget = node.widgets.find(
|
||||
(w) => w.name === "model_file"
|
||||
);
|
||||
const showGrid = node.widgets.find((w) => w.name === "show_grid");
|
||||
const cameraType = node.widgets.find(
|
||||
(w) => w.name === "camera_type"
|
||||
);
|
||||
const view = node.widgets.find((w) => w.name === "view");
|
||||
const material = node.widgets.find((w) => w.name === "material");
|
||||
const bgColor = node.widgets.find((w) => w.name === "bg_color");
|
||||
const lightIntensity = node.widgets.find(
|
||||
@@ -47380,6 +47109,9 @@ app.registerExtension({
|
||||
load3d,
|
||||
"output",
|
||||
modelWidget,
|
||||
showGrid,
|
||||
cameraType,
|
||||
view,
|
||||
material,
|
||||
bgColor,
|
||||
lightIntensity,
|
||||
@@ -48567,15 +48299,15 @@ var styles = `
|
||||
}
|
||||
#maskEditor_toolPanel {
|
||||
height: 100%;
|
||||
width: 4rem;
|
||||
width: var(--sidebar-width);
|
||||
z-index: 8888;
|
||||
background: var(--comfy-menu-bg);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.maskEditor_toolPanelContainer {
|
||||
width: 4rem;
|
||||
height: 4rem;
|
||||
width: var(--sidebar-width);
|
||||
height: var(--sidebar-width);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
@@ -48636,7 +48368,7 @@ var styles = `
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
#maskEditor_pointerZone {
|
||||
width: calc(100% - 4rem - 220px);
|
||||
width: calc(100% - var(--sidebar-width) - 220px);
|
||||
height: 100%;
|
||||
}
|
||||
#maskEditor_uiContainer {
|
||||
@@ -49008,8 +48740,8 @@ var styles = `
|
||||
}
|
||||
|
||||
.maskEditor_toolPanelZoomIndicator {
|
||||
width: 4rem;
|
||||
height: 4rem;
|
||||
width: var(--sidebar-width);
|
||||
height: var(--sidebar-width);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
@@ -49068,31 +48800,6 @@ var ColorComparisonMethod = /* @__PURE__ */ ((ColorComparisonMethod2) => {
|
||||
ColorComparisonMethod2["LAB"] = "lab";
|
||||
return ColorComparisonMethod2;
|
||||
})(ColorComparisonMethod || {});
|
||||
const saveBrushToCache = lodashExports.debounce(function(key, brush) {
|
||||
try {
|
||||
const brushString = JSON.stringify(brush);
|
||||
setStorageValue(key, brushString);
|
||||
} catch (error) {
|
||||
console.error("Failed to save brush to cache:", error);
|
||||
}
|
||||
}, 300);
|
||||
function loadBrushFromCache(key) {
|
||||
try {
|
||||
const brushString = getStorageValue(key);
|
||||
if (brushString) {
|
||||
const brush = JSON.parse(brushString);
|
||||
console.log("Loaded brush from cache:", brush);
|
||||
return brush;
|
||||
} else {
|
||||
console.log("No brush found in cache.");
|
||||
return null;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Failed to load brush from cache:", error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
__name(loadBrushFromCache, "loadBrushFromCache");
|
||||
class MaskEditorDialog extends ComfyDialog {
|
||||
static {
|
||||
__name(this, "MaskEditorDialog");
|
||||
@@ -49358,7 +49065,7 @@ class MaskEditorDialog extends ComfyDialog {
|
||||
}).then((response) => {
|
||||
if (!response.ok) {
|
||||
console.log("Failed to upload mask:", response);
|
||||
this.uploadMask(filepath, formData, retries - 1);
|
||||
this.uploadMask(filepath, formData, 2);
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.error("Error:", error);
|
||||
@@ -49957,18 +49664,13 @@ class BrushTool {
|
||||
this.brushAdjustmentSpeed = app.extensionManager.setting.get(
|
||||
"Comfy.MaskEditor.BrushAdjustmentSpeed"
|
||||
);
|
||||
const cachedBrushSettings = loadBrushFromCache("maskeditor_brush_settings");
|
||||
if (cachedBrushSettings) {
|
||||
this.brushSettings = cachedBrushSettings;
|
||||
} else {
|
||||
this.brushSettings = {
|
||||
type: "arc",
|
||||
size: 10,
|
||||
opacity: 0.7,
|
||||
opacity: 100,
|
||||
hardness: 1,
|
||||
smoothingPrecision: 10
|
||||
type: "arc"
|
||||
/* Arc */
|
||||
};
|
||||
}
|
||||
this.maskBlendMode = "black";
|
||||
}
|
||||
createListeners() {
|
||||
@@ -50030,10 +49732,6 @@ class BrushTool {
|
||||
"brushType",
|
||||
async () => this.brushSettings.type
|
||||
);
|
||||
this.messageBroker.createPullTopic(
|
||||
"brushSmoothingPrecision",
|
||||
async () => this.brushSettings.smoothingPrecision
|
||||
);
|
||||
this.messageBroker.createPullTopic(
|
||||
"maskBlendMode",
|
||||
async () => this.maskBlendMode
|
||||
@@ -50142,7 +49840,7 @@ class BrushTool {
|
||||
dy = points[i + 1].y - points[i].y;
|
||||
totalLength += Math.sqrt(dx * dx + dy * dy);
|
||||
}
|
||||
const distanceBetweenPoints = this.brushSettings.size / this.brushSettings.smoothingPrecision * 6;
|
||||
const distanceBetweenPoints = this.brushSettings.size / this.smoothingPrecision * 6;
|
||||
const stepNr = Math.ceil(totalLength / distanceBetweenPoints);
|
||||
let interpolatedPoints = points;
|
||||
if (stepNr > 0) {
|
||||
@@ -50173,7 +49871,7 @@ class BrushTool {
|
||||
const brush_size = await this.messageBroker.pull("brushSize");
|
||||
const distance = Math.sqrt((p2.x - p1.x) ** 2 + (p2.y - p1.y) ** 2);
|
||||
const steps = Math.ceil(
|
||||
distance / (brush_size / this.brushSettings.smoothingPrecision * 4)
|
||||
distance / (brush_size / this.smoothingPrecision * 4)
|
||||
);
|
||||
const interpolatedOpacity = 1 / (1 + Math.exp(-6 * (this.brushSettings.opacity - 0.5))) - 1 / (1 + Math.exp(3));
|
||||
this.init_shape(compositionOp);
|
||||
@@ -50425,23 +50123,18 @@ class BrushTool {
|
||||
}
|
||||
setBrushSize(size) {
|
||||
this.brushSettings.size = size;
|
||||
saveBrushToCache("maskeditor_brush_settings", this.brushSettings);
|
||||
}
|
||||
setBrushOpacity(opacity) {
|
||||
this.brushSettings.opacity = opacity;
|
||||
saveBrushToCache("maskeditor_brush_settings", this.brushSettings);
|
||||
}
|
||||
setBrushHardness(hardness) {
|
||||
this.brushSettings.hardness = hardness;
|
||||
saveBrushToCache("maskeditor_brush_settings", this.brushSettings);
|
||||
}
|
||||
setBrushType(type) {
|
||||
this.brushSettings.type = type;
|
||||
saveBrushToCache("maskeditor_brush_settings", this.brushSettings);
|
||||
}
|
||||
setBrushSmoothingPrecision(precision) {
|
||||
this.brushSettings.smoothingPrecision = precision;
|
||||
saveBrushToCache("maskeditor_brush_settings", this.brushSettings);
|
||||
this.smoothingPrecision = precision;
|
||||
}
|
||||
}
|
||||
class UIManager {
|
||||
@@ -50647,6 +50340,7 @@ class UIManager {
|
||||
const circle_shape = document.createElement("div");
|
||||
circle_shape.id = "maskEditor_sidePanelBrushShapeCircle";
|
||||
circle_shape.classList.add(shapeColor);
|
||||
circle_shape.style.background = "var(--p-button-text-primary-color)";
|
||||
circle_shape.addEventListener("click", () => {
|
||||
this.messageBroker.publish(
|
||||
"setBrushShape",
|
||||
@@ -50660,6 +50354,7 @@ class UIManager {
|
||||
const square_shape = document.createElement("div");
|
||||
square_shape.id = "maskEditor_sidePanelBrushShapeSquare";
|
||||
square_shape.classList.add(shapeColor);
|
||||
square_shape.style.background = "";
|
||||
square_shape.addEventListener("click", () => {
|
||||
this.messageBroker.publish(
|
||||
"setBrushShape",
|
||||
@@ -50670,13 +50365,6 @@ class UIManager {
|
||||
square_shape.style.background = "var(--p-button-text-primary-color)";
|
||||
circle_shape.style.background = "";
|
||||
});
|
||||
if ((await this.messageBroker.pull("brushSettings")).type === "arc") {
|
||||
circle_shape.style.background = "var(--p-button-text-primary-color)";
|
||||
square_shape.style.background = "";
|
||||
} else {
|
||||
circle_shape.style.background = "";
|
||||
square_shape.style.background = "var(--p-button-text-primary-color)";
|
||||
}
|
||||
brush_shape_container.appendChild(circle_shape);
|
||||
brush_shape_container.appendChild(square_shape);
|
||||
brush_shape_outer_container.appendChild(brush_shape_title);
|
||||
@@ -50686,7 +50374,7 @@ class UIManager {
|
||||
1,
|
||||
100,
|
||||
1,
|
||||
(await this.messageBroker.pull("brushSettings")).size,
|
||||
10,
|
||||
(event, value) => {
|
||||
this.messageBroker.publish("setBrushSize", parseInt(value));
|
||||
this.updateBrushPreview();
|
||||
@@ -50698,7 +50386,7 @@ class UIManager {
|
||||
0,
|
||||
1,
|
||||
0.01,
|
||||
(await this.messageBroker.pull("brushSettings")).opacity,
|
||||
0.7,
|
||||
(event, value) => {
|
||||
this.messageBroker.publish("setBrushOpacity", parseFloat(value));
|
||||
this.updateBrushPreview();
|
||||
@@ -50710,7 +50398,7 @@ class UIManager {
|
||||
0,
|
||||
1,
|
||||
0.01,
|
||||
(await this.messageBroker.pull("brushSettings")).hardness,
|
||||
1,
|
||||
(event, value) => {
|
||||
this.messageBroker.publish("setBrushHardness", parseFloat(value));
|
||||
this.updateBrushPreview();
|
||||
@@ -50722,7 +50410,7 @@ class UIManager {
|
||||
1,
|
||||
100,
|
||||
1,
|
||||
(await this.messageBroker.pull("brushSettings")).smoothingPrecision,
|
||||
10,
|
||||
(event, value) => {
|
||||
this.messageBroker.publish(
|
||||
"setBrushSmoothingPrecision",
|
||||
@@ -50730,30 +50418,7 @@ class UIManager {
|
||||
);
|
||||
}
|
||||
);
|
||||
const resetBrushSettingsButton = document.createElement("button");
|
||||
resetBrushSettingsButton.id = "resetBrushSettingsButton";
|
||||
resetBrushSettingsButton.innerText = "Reset to Default";
|
||||
resetBrushSettingsButton.addEventListener("click", () => {
|
||||
this.messageBroker.publish(
|
||||
"setBrushShape",
|
||||
"arc"
|
||||
/* Arc */
|
||||
);
|
||||
this.messageBroker.publish("setBrushSize", 10);
|
||||
this.messageBroker.publish("setBrushOpacity", 0.7);
|
||||
this.messageBroker.publish("setBrushHardness", 1);
|
||||
this.messageBroker.publish("setBrushSmoothingPrecision", 10);
|
||||
circle_shape.style.background = "var(--p-button-text-primary-color)";
|
||||
square_shape.style.background = "";
|
||||
thicknesSliderObj.slider.value = "10";
|
||||
opacitySliderObj.slider.value = "0.7";
|
||||
hardnessSliderObj.slider.value = "1";
|
||||
brushSmoothingPrecisionSliderObj.slider.value = "10";
|
||||
this.setBrushBorderRadius();
|
||||
this.updateBrushPreview();
|
||||
});
|
||||
brush_settings_container.appendChild(brush_settings_title);
|
||||
brush_settings_container.appendChild(resetBrushSettingsButton);
|
||||
brush_settings_container.appendChild(brush_shape_outer_container);
|
||||
brush_settings_container.appendChild(thicknesSliderObj.container);
|
||||
brush_settings_container.appendChild(opacitySliderObj.container);
|
||||
@@ -53546,4 +53211,4 @@ app.registerExtension({
|
||||
});
|
||||
}
|
||||
});
|
||||
//# sourceMappingURL=index-je62U6DH.js.map
|
||||
//# sourceMappingURL=index-Bordpmzt.js.map
|
||||
67788
web/assets/index-QvfM__ze.js → web/assets/index-DjNHn37O.js
generated
vendored
67788
web/assets/index-QvfM__ze.js → web/assets/index-DjNHn37O.js
generated
vendored
File diff suppressed because one or more lines are too long
173
web/assets/index-jXPKy3pP.js
generated
vendored
Normal file
173
web/assets/index-jXPKy3pP.js
generated
vendored
Normal file
@@ -0,0 +1,173 @@
|
||||
var __defProp = Object.defineProperty;
|
||||
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
||||
import { B as BaseStyle, q as script$2, ak as UniqueComponentId, c9 as script$4, l as script$5, S as Ripple, aB as resolveComponent, o as openBlock, f as createElementBlock, D as mergeProps, H as createBaseVNode, J as renderSlot, T as normalizeClass, X as toDisplayString, I as createCommentVNode, k as createBlock, M as withCtx, G as resolveDynamicComponent, N as createVNode, aC as Transition, i as withDirectives, v as vShow } from "./index-DjNHn37O.js";
|
||||
import { s as script$3 } from "./index-5HFeZax4.js";
|
||||
var theme = /* @__PURE__ */ __name(function theme2(_ref) {
|
||||
var dt = _ref.dt;
|
||||
return "\n.p-panel {\n border: 1px solid ".concat(dt("panel.border.color"), ";\n border-radius: ").concat(dt("panel.border.radius"), ";\n background: ").concat(dt("panel.background"), ";\n color: ").concat(dt("panel.color"), ";\n}\n\n.p-panel-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: ").concat(dt("panel.header.padding"), ";\n background: ").concat(dt("panel.header.background"), ";\n color: ").concat(dt("panel.header.color"), ";\n border-style: solid;\n border-width: ").concat(dt("panel.header.border.width"), ";\n border-color: ").concat(dt("panel.header.border.color"), ";\n border-radius: ").concat(dt("panel.header.border.radius"), ";\n}\n\n.p-panel-toggleable .p-panel-header {\n padding: ").concat(dt("panel.toggleable.header.padding"), ";\n}\n\n.p-panel-title {\n line-height: 1;\n font-weight: ").concat(dt("panel.title.font.weight"), ";\n}\n\n.p-panel-content {\n padding: ").concat(dt("panel.content.padding"), ";\n}\n\n.p-panel-footer {\n padding: ").concat(dt("panel.footer.padding"), ";\n}\n");
|
||||
}, "theme");
|
||||
var classes = {
|
||||
root: /* @__PURE__ */ __name(function root(_ref2) {
|
||||
var props = _ref2.props;
|
||||
return ["p-panel p-component", {
|
||||
"p-panel-toggleable": props.toggleable
|
||||
}];
|
||||
}, "root"),
|
||||
header: "p-panel-header",
|
||||
title: "p-panel-title",
|
||||
headerActions: "p-panel-header-actions",
|
||||
pcToggleButton: "p-panel-toggle-button",
|
||||
contentContainer: "p-panel-content-container",
|
||||
content: "p-panel-content",
|
||||
footer: "p-panel-footer"
|
||||
};
|
||||
var PanelStyle = BaseStyle.extend({
|
||||
name: "panel",
|
||||
theme,
|
||||
classes
|
||||
});
|
||||
var script$1 = {
|
||||
name: "BasePanel",
|
||||
"extends": script$2,
|
||||
props: {
|
||||
header: String,
|
||||
toggleable: Boolean,
|
||||
collapsed: Boolean,
|
||||
toggleButtonProps: {
|
||||
type: Object,
|
||||
"default": /* @__PURE__ */ __name(function _default() {
|
||||
return {
|
||||
severity: "secondary",
|
||||
text: true,
|
||||
rounded: true
|
||||
};
|
||||
}, "_default")
|
||||
}
|
||||
},
|
||||
style: PanelStyle,
|
||||
provide: /* @__PURE__ */ __name(function provide() {
|
||||
return {
|
||||
$pcPanel: this,
|
||||
$parentInstance: this
|
||||
};
|
||||
}, "provide")
|
||||
};
|
||||
var script = {
|
||||
name: "Panel",
|
||||
"extends": script$1,
|
||||
inheritAttrs: false,
|
||||
emits: ["update:collapsed", "toggle"],
|
||||
data: /* @__PURE__ */ __name(function data() {
|
||||
return {
|
||||
id: this.$attrs.id,
|
||||
d_collapsed: this.collapsed
|
||||
};
|
||||
}, "data"),
|
||||
watch: {
|
||||
"$attrs.id": /* @__PURE__ */ __name(function $attrsId(newValue) {
|
||||
this.id = newValue || UniqueComponentId();
|
||||
}, "$attrsId"),
|
||||
collapsed: /* @__PURE__ */ __name(function collapsed(newValue) {
|
||||
this.d_collapsed = newValue;
|
||||
}, "collapsed")
|
||||
},
|
||||
mounted: /* @__PURE__ */ __name(function mounted() {
|
||||
this.id = this.id || UniqueComponentId();
|
||||
}, "mounted"),
|
||||
methods: {
|
||||
toggle: /* @__PURE__ */ __name(function toggle(event) {
|
||||
this.d_collapsed = !this.d_collapsed;
|
||||
this.$emit("update:collapsed", this.d_collapsed);
|
||||
this.$emit("toggle", {
|
||||
originalEvent: event,
|
||||
value: this.d_collapsed
|
||||
});
|
||||
}, "toggle"),
|
||||
onKeyDown: /* @__PURE__ */ __name(function onKeyDown(event) {
|
||||
if (event.code === "Enter" || event.code === "NumpadEnter" || event.code === "Space") {
|
||||
this.toggle(event);
|
||||
event.preventDefault();
|
||||
}
|
||||
}, "onKeyDown")
|
||||
},
|
||||
computed: {
|
||||
buttonAriaLabel: /* @__PURE__ */ __name(function buttonAriaLabel() {
|
||||
return this.toggleButtonProps && this.toggleButtonProps.ariaLabel ? this.toggleButtonProps.ariaLabel : this.header;
|
||||
}, "buttonAriaLabel")
|
||||
},
|
||||
components: {
|
||||
PlusIcon: script$3,
|
||||
MinusIcon: script$4,
|
||||
Button: script$5
|
||||
},
|
||||
directives: {
|
||||
ripple: Ripple
|
||||
}
|
||||
};
|
||||
var _hoisted_1 = ["id"];
|
||||
var _hoisted_2 = ["id", "aria-labelledby"];
|
||||
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
var _component_Button = resolveComponent("Button");
|
||||
return openBlock(), createElementBlock("div", mergeProps({
|
||||
"class": _ctx.cx("root")
|
||||
}, _ctx.ptmi("root")), [createBaseVNode("div", mergeProps({
|
||||
"class": _ctx.cx("header")
|
||||
}, _ctx.ptm("header")), [renderSlot(_ctx.$slots, "header", {
|
||||
id: $data.id + "_header",
|
||||
"class": normalizeClass(_ctx.cx("title"))
|
||||
}, function() {
|
||||
return [_ctx.header ? (openBlock(), createElementBlock("span", mergeProps({
|
||||
key: 0,
|
||||
id: $data.id + "_header",
|
||||
"class": _ctx.cx("title")
|
||||
}, _ctx.ptm("title")), toDisplayString(_ctx.header), 17, _hoisted_1)) : createCommentVNode("", true)];
|
||||
}), createBaseVNode("div", mergeProps({
|
||||
"class": _ctx.cx("headerActions")
|
||||
}, _ctx.ptm("headerActions")), [renderSlot(_ctx.$slots, "icons"), _ctx.toggleable ? (openBlock(), createBlock(_component_Button, mergeProps({
|
||||
key: 0,
|
||||
id: $data.id + "_header",
|
||||
"class": _ctx.cx("pcToggleButton"),
|
||||
"aria-label": $options.buttonAriaLabel,
|
||||
"aria-controls": $data.id + "_content",
|
||||
"aria-expanded": !$data.d_collapsed,
|
||||
unstyled: _ctx.unstyled,
|
||||
onClick: $options.toggle,
|
||||
onKeydown: $options.onKeyDown
|
||||
}, _ctx.toggleButtonProps, {
|
||||
pt: _ctx.ptm("pcToggleButton")
|
||||
}), {
|
||||
icon: withCtx(function(slotProps) {
|
||||
return [renderSlot(_ctx.$slots, _ctx.$slots.toggleicon ? "toggleicon" : "togglericon", {
|
||||
collapsed: $data.d_collapsed
|
||||
}, function() {
|
||||
return [(openBlock(), createBlock(resolveDynamicComponent($data.d_collapsed ? "PlusIcon" : "MinusIcon"), mergeProps({
|
||||
"class": slotProps["class"]
|
||||
}, _ctx.ptm("pcToggleButton")["icon"]), null, 16, ["class"]))];
|
||||
})];
|
||||
}),
|
||||
_: 3
|
||||
}, 16, ["id", "class", "aria-label", "aria-controls", "aria-expanded", "unstyled", "onClick", "onKeydown", "pt"])) : createCommentVNode("", true)], 16)], 16), createVNode(Transition, mergeProps({
|
||||
name: "p-toggleable-content"
|
||||
}, _ctx.ptm("transition")), {
|
||||
"default": withCtx(function() {
|
||||
return [withDirectives(createBaseVNode("div", mergeProps({
|
||||
id: $data.id + "_content",
|
||||
"class": _ctx.cx("contentContainer"),
|
||||
role: "region",
|
||||
"aria-labelledby": $data.id + "_header"
|
||||
}, _ctx.ptm("contentContainer")), [createBaseVNode("div", mergeProps({
|
||||
"class": _ctx.cx("content")
|
||||
}, _ctx.ptm("content")), [renderSlot(_ctx.$slots, "default")], 16), _ctx.$slots.footer ? (openBlock(), createElementBlock("div", mergeProps({
|
||||
key: 0,
|
||||
"class": _ctx.cx("footer")
|
||||
}, _ctx.ptm("footer")), [renderSlot(_ctx.$slots, "footer")], 16)) : createCommentVNode("", true)], 16, _hoisted_2), [[vShow, !$data.d_collapsed]])];
|
||||
}),
|
||||
_: 3
|
||||
}, 16)], 16);
|
||||
}
|
||||
__name(render, "render");
|
||||
script.render = render;
|
||||
export {
|
||||
script as s
|
||||
};
|
||||
//# sourceMappingURL=index-jXPKy3pP.js.map
|
||||
146
web/assets/index-Cf-n7v0V.css → web/assets/index-t-sFBuUC.css
generated
vendored
146
web/assets/index-Cf-n7v0V.css → web/assets/index-t-sFBuUC.css
generated
vendored
@@ -2131,9 +2131,6 @@
|
||||
.z-\[1000\]{
|
||||
z-index: 1000;
|
||||
}
|
||||
.z-\[9999\]{
|
||||
z-index: 9999;
|
||||
}
|
||||
.m-0{
|
||||
margin: 0px;
|
||||
}
|
||||
@@ -2256,9 +2253,6 @@
|
||||
.h-0{
|
||||
height: 0px;
|
||||
}
|
||||
.h-1{
|
||||
height: 0.25rem;
|
||||
}
|
||||
.h-16{
|
||||
height: 4rem;
|
||||
}
|
||||
@@ -2277,9 +2271,6 @@
|
||||
.h-\[30rem\]{
|
||||
height: 30rem;
|
||||
}
|
||||
.h-\[var\(--comfy-topbar-height\)\]{
|
||||
height: var(--comfy-topbar-height);
|
||||
}
|
||||
.h-full{
|
||||
height: 100%;
|
||||
}
|
||||
@@ -2350,9 +2341,6 @@
|
||||
.w-screen{
|
||||
width: 100vw;
|
||||
}
|
||||
.min-w-0{
|
||||
min-width: 0px;
|
||||
}
|
||||
.min-w-110{
|
||||
min-width: 32rem;
|
||||
}
|
||||
@@ -2371,9 +2359,6 @@
|
||||
.max-w-\[150px\]{
|
||||
max-width: 150px;
|
||||
}
|
||||
.max-w-\[600px\]{
|
||||
max-width: 600px;
|
||||
}
|
||||
.max-w-full{
|
||||
max-width: 100%;
|
||||
}
|
||||
@@ -2534,9 +2519,6 @@
|
||||
.text-wrap{
|
||||
text-wrap: wrap;
|
||||
}
|
||||
.text-nowrap{
|
||||
text-wrap: nowrap;
|
||||
}
|
||||
.rounded{
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
@@ -2546,35 +2528,16 @@
|
||||
.rounded-none{
|
||||
border-radius: 0px;
|
||||
}
|
||||
.rounded-t-lg{
|
||||
border-top-left-radius: 0.5rem;
|
||||
border-top-right-radius: 0.5rem;
|
||||
}
|
||||
.border{
|
||||
border-width: 1px;
|
||||
}
|
||||
.border-0{
|
||||
border-width: 0px;
|
||||
}
|
||||
.border-x-0{
|
||||
border-left-width: 0px;
|
||||
border-right-width: 0px;
|
||||
}
|
||||
.border-b{
|
||||
border-bottom-width: 1px;
|
||||
}
|
||||
.border-l{
|
||||
border-left-width: 1px;
|
||||
}
|
||||
.border-r{
|
||||
border-right-width: 1px;
|
||||
}
|
||||
.border-t-0{
|
||||
border-top-width: 0px;
|
||||
}
|
||||
.border-solid{
|
||||
border-style: solid;
|
||||
}
|
||||
.border-none{
|
||||
border-style: none;
|
||||
}
|
||||
@@ -2672,9 +2635,6 @@
|
||||
.p-5{
|
||||
padding: 1.25rem;
|
||||
}
|
||||
.p-6{
|
||||
padding: 1.5rem;
|
||||
}
|
||||
.p-8{
|
||||
padding: 2rem;
|
||||
}
|
||||
@@ -2741,9 +2701,6 @@
|
||||
.text-2xl{
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
.text-3xl{
|
||||
font-size: 1.875rem;
|
||||
}
|
||||
.text-4xl{
|
||||
font-size: 2.25rem;
|
||||
}
|
||||
@@ -2826,9 +2783,6 @@
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(239 68 68 / var(--tw-text-opacity));
|
||||
}
|
||||
.underline{
|
||||
text-decoration-line: underline;
|
||||
}
|
||||
.no-underline{
|
||||
text-decoration-line: none;
|
||||
}
|
||||
@@ -2914,7 +2868,6 @@
|
||||
--bg-color: #fff;
|
||||
--comfy-menu-bg: #353535;
|
||||
--comfy-menu-secondary-bg: #292929;
|
||||
--comfy-topbar-height: 2.5rem;
|
||||
--comfy-input-bg: #222;
|
||||
--input-text: #ddd;
|
||||
--descrip-text: #999;
|
||||
@@ -3672,33 +3625,24 @@ audio.comfy-audio.empty-audio-widget {
|
||||
padding: var(--comfy-tree-explorer-item-padding) !important;
|
||||
}
|
||||
|
||||
/* [Desktop] Electron window specific styles */
|
||||
.app-drag {
|
||||
app-region: drag;
|
||||
}
|
||||
|
||||
.no-drag {
|
||||
app-region: no-drag;
|
||||
}
|
||||
|
||||
.window-actions-spacer {
|
||||
width: calc(100vw - env(titlebar-area-width, 100vw));
|
||||
}
|
||||
/* End of [Desktop] Electron window specific styles */
|
||||
.hover\:bg-neutral-700:hover{
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(64 64 64 / var(--tw-bg-opacity));
|
||||
}
|
||||
|
||||
.hover\:bg-opacity-75:hover{
|
||||
--tw-bg-opacity: 0.75;
|
||||
}
|
||||
|
||||
.hover\:text-blue-300:hover{
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(144 205 244 / var(--tw-text-opacity));
|
||||
}
|
||||
|
||||
.hover\:opacity-100:hover{
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
@media (min-width: 768px){
|
||||
|
||||
.md\:flex{
|
||||
@@ -3709,6 +3653,7 @@ audio.comfy-audio.empty-audio-widget {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1536px){
|
||||
|
||||
.\32xl\:mx-4{
|
||||
@@ -3744,11 +3689,8 @@ audio.comfy-audio.empty-audio-widget {
|
||||
padding-left: 1rem;
|
||||
padding-right: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
.\32xl\:text-sm{
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
}
|
||||
@media (prefers-color-scheme: dark){
|
||||
|
||||
.dark\:bg-gray-800{
|
||||
@@ -3798,17 +3740,17 @@ audio.comfy-audio.empty-audio-widget {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.comfy-error-report[data-v-09b72a20] {
|
||||
.comfy-error-report[data-v-ddf3e2da] {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
}
|
||||
.action-container[data-v-09b72a20] {
|
||||
.action-container[data-v-ddf3e2da] {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.wrapper-pre[data-v-09b72a20] {
|
||||
.wrapper-pre[data-v-ddf3e2da] {
|
||||
white-space: pre-wrap;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
@@ -3892,7 +3834,7 @@ audio.comfy-audio.empty-audio-widget {
|
||||
padding-top: 0px !important;
|
||||
}
|
||||
|
||||
.settings-container[data-v-2e21278f] {
|
||||
.settings-container[data-v-67f71ae9] {
|
||||
display: flex;
|
||||
height: 70vh;
|
||||
width: 60vw;
|
||||
@@ -3900,25 +3842,25 @@ audio.comfy-audio.empty-audio-widget {
|
||||
overflow: hidden;
|
||||
}
|
||||
@media (max-width: 768px) {
|
||||
.settings-container[data-v-2e21278f] {
|
||||
.settings-container[data-v-67f71ae9] {
|
||||
flex-direction: column;
|
||||
height: auto;
|
||||
width: 80vw;
|
||||
}
|
||||
.settings-sidebar[data-v-2e21278f] {
|
||||
.settings-sidebar[data-v-67f71ae9] {
|
||||
width: 100%;
|
||||
}
|
||||
.settings-content[data-v-2e21278f] {
|
||||
.settings-content[data-v-67f71ae9] {
|
||||
height: 350px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Show a separator line above the Keybinding tab */
|
||||
/* This indicates the start of custom setting panels */
|
||||
.settings-sidebar[data-v-2e21278f] .p-listbox-option[aria-label='Keybinding'] {
|
||||
.settings-sidebar[data-v-67f71ae9] .p-listbox-option[aria-label='Keybinding'] {
|
||||
position: relative;
|
||||
}
|
||||
.settings-sidebar[data-v-2e21278f] .p-listbox-option[aria-label='Keybinding']::before {
|
||||
.settings-sidebar[data-v-67f71ae9] .p-listbox-option[aria-label='Keybinding']::before {
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
@@ -3936,15 +3878,15 @@ audio.comfy-audio.empty-audio-widget {
|
||||
margin-left: 0.5rem;
|
||||
}
|
||||
|
||||
.p-card[data-v-ffc83afa] {
|
||||
.p-card[data-v-d65acb9a] {
|
||||
--p-card-body-padding: 10px 0 0 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
[data-v-ffc83afa] .p-card-subtitle {
|
||||
[data-v-d65acb9a] .p-card-subtitle {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.carousel[data-v-d9962275] {
|
||||
.carousel[data-v-fc26284b] {
|
||||
width: 66vw;
|
||||
}
|
||||
/**
|
||||
@@ -4181,18 +4123,18 @@ audio.comfy-audio.empty-audio-widget {
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
[data-v-90a7f075] .p-terminal .xterm {
|
||||
[data-v-6187144a] .p-terminal .xterm {
|
||||
overflow-x: auto;
|
||||
}
|
||||
[data-v-90a7f075] .p-terminal .xterm-screen {
|
||||
[data-v-6187144a] .p-terminal .xterm-screen {
|
||||
background-color: black;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
[data-v-03daf1c8] .p-terminal .xterm {
|
||||
[data-v-b27b58f4] .p-terminal .xterm {
|
||||
overflow-x: auto;
|
||||
}
|
||||
[data-v-03daf1c8] .p-terminal .xterm-screen {
|
||||
[data-v-b27b58f4] .p-terminal .xterm-screen {
|
||||
background-color: black;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
@@ -4552,28 +4494,16 @@ audio.comfy-audio.empty-audio-widget {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
[data-v-5e759e25] .p-toolbar-end .p-button {
|
||||
|
||||
[data-v-9159c070] .p-toolbar-end .p-button {
|
||||
padding-top: 0.25rem;
|
||||
|
||||
padding-bottom: 0.25rem
|
||||
}
|
||||
@media (min-width: 1536px) {
|
||||
[data-v-5e759e25] .p-toolbar-end .p-button {
|
||||
|
||||
[data-v-9159c070] .p-toolbar-end .p-button {
|
||||
padding-top: 0.5rem;
|
||||
|
||||
padding-bottom: 0.5rem
|
||||
}
|
||||
}
|
||||
[data-v-5e759e25] .p-toolbar-start {
|
||||
|
||||
min-width: 0px;
|
||||
|
||||
flex: 1 1 0%;
|
||||
|
||||
overflow: hidden
|
||||
}
|
||||
|
||||
.model_preview[data-v-32e6c4d9] {
|
||||
background-color: var(--comfy-menu-bg);
|
||||
@@ -4806,18 +4736,18 @@ audio.comfy-audio.empty-audio-widget {
|
||||
width: 100%
|
||||
}
|
||||
|
||||
.p-selectbutton .p-button[data-v-05364174] {
|
||||
.p-selectbutton .p-button[data-v-4b8adc78] {
|
||||
padding: 0.5rem;
|
||||
}
|
||||
.p-selectbutton .p-button .pi[data-v-05364174] {
|
||||
.p-selectbutton .p-button .pi[data-v-4b8adc78] {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
.field[data-v-05364174] {
|
||||
.field[data-v-4b8adc78] {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
.color-picker-container[data-v-05364174] {
|
||||
.color-picker-container[data-v-4b8adc78] {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
@@ -4837,10 +4767,10 @@ audio.comfy-audio.empty-audio-widget {
|
||||
}
|
||||
}
|
||||
|
||||
.comfy-image-wrap[data-v-a748ccd8] {
|
||||
.comfy-image-wrap[data-v-ffe66146] {
|
||||
display: contents;
|
||||
}
|
||||
.comfy-image-blur[data-v-a748ccd8] {
|
||||
.comfy-image-blur[data-v-ffe66146] {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
@@ -4849,7 +4779,7 @@ audio.comfy-audio.empty-audio-widget {
|
||||
-o-object-fit: cover;
|
||||
object-fit: cover;
|
||||
}
|
||||
.comfy-image-main[data-v-a748ccd8] {
|
||||
.comfy-image-main[data-v-ffe66146] {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
-o-object-fit: cover;
|
||||
@@ -4858,19 +4788,19 @@ audio.comfy-audio.empty-audio-widget {
|
||||
object-position: center;
|
||||
z-index: 1;
|
||||
}
|
||||
.contain .comfy-image-wrap[data-v-a748ccd8] {
|
||||
.contain .comfy-image-wrap[data-v-ffe66146] {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.contain .comfy-image-main[data-v-a748ccd8] {
|
||||
.contain .comfy-image-main[data-v-ffe66146] {
|
||||
-o-object-fit: contain;
|
||||
object-fit: contain;
|
||||
-webkit-backdrop-filter: blur(10px);
|
||||
backdrop-filter: blur(10px);
|
||||
position: absolute;
|
||||
}
|
||||
.broken-image-placeholder[data-v-a748ccd8] {
|
||||
.broken-image-placeholder[data-v-ffe66146] {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
@@ -4879,7 +4809,7 @@ audio.comfy-audio.empty-audio-widget {
|
||||
height: 100%;
|
||||
margin: 2rem;
|
||||
}
|
||||
.broken-image-placeholder i[data-v-a748ccd8] {
|
||||
.broken-image-placeholder i[data-v-ffe66146] {
|
||||
font-size: 3rem;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
@@ -4897,7 +4827,7 @@ img.galleria-image {
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.result-container[data-v-2403edc6] {
|
||||
.result-container[data-v-61515e14] {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
aspect-ratio: 1 / 1;
|
||||
@@ -4907,7 +4837,7 @@ img.galleria-image {
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.preview-mask[data-v-2403edc6] {
|
||||
.preview-mask[data-v-61515e14] {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
@@ -4919,7 +4849,7 @@ img.galleria-image {
|
||||
transition: opacity 0.3s ease;
|
||||
z-index: 1;
|
||||
}
|
||||
.result-container:hover .preview-mask[data-v-2403edc6] {
|
||||
.result-container:hover .preview-mask[data-v-61515e14] {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
24
web/assets/keybindingService-Cak1En5n.js → web/assets/keybindingService-Bx7YdkXn.js
generated
vendored
24
web/assets/keybindingService-Cak1En5n.js → web/assets/keybindingService-Bx7YdkXn.js
generated
vendored
@@ -1,6 +1,6 @@
|
||||
var __defProp = Object.defineProperty;
|
||||
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
||||
import { a$ as useKeybindingStore, a4 as useCommandStore, a as useSettingStore, cx as KeyComboImpl, cy as KeybindingImpl } from "./index-QvfM__ze.js";
|
||||
import { a$ as useKeybindingStore, a2 as useCommandStore, a as useSettingStore, cq as KeyComboImpl, cr as KeybindingImpl } from "./index-DjNHn37O.js";
|
||||
const CORE_KEYBINDINGS = [
|
||||
{
|
||||
combo: {
|
||||
@@ -96,7 +96,7 @@ const CORE_KEYBINDINGS = [
|
||||
alt: true
|
||||
},
|
||||
commandId: "Comfy.Canvas.ZoomIn",
|
||||
targetElementId: "graph-canvas"
|
||||
targetSelector: "#graph-canvas"
|
||||
},
|
||||
{
|
||||
combo: {
|
||||
@@ -105,7 +105,7 @@ const CORE_KEYBINDINGS = [
|
||||
shift: true
|
||||
},
|
||||
commandId: "Comfy.Canvas.ZoomIn",
|
||||
targetElementId: "graph-canvas"
|
||||
targetSelector: "#graph-canvas"
|
||||
},
|
||||
// For number pad '+'
|
||||
{
|
||||
@@ -114,7 +114,7 @@ const CORE_KEYBINDINGS = [
|
||||
alt: true
|
||||
},
|
||||
commandId: "Comfy.Canvas.ZoomIn",
|
||||
targetElementId: "graph-canvas"
|
||||
targetSelector: "#graph-canvas"
|
||||
},
|
||||
{
|
||||
combo: {
|
||||
@@ -122,21 +122,21 @@ const CORE_KEYBINDINGS = [
|
||||
alt: true
|
||||
},
|
||||
commandId: "Comfy.Canvas.ZoomOut",
|
||||
targetElementId: "graph-canvas"
|
||||
targetSelector: "#graph-canvas"
|
||||
},
|
||||
{
|
||||
combo: {
|
||||
key: "."
|
||||
},
|
||||
commandId: "Comfy.Canvas.FitView",
|
||||
targetElementId: "graph-canvas"
|
||||
targetSelector: "#graph-canvas"
|
||||
},
|
||||
{
|
||||
combo: {
|
||||
key: "p"
|
||||
},
|
||||
commandId: "Comfy.Canvas.ToggleSelected.Pin",
|
||||
targetElementId: "graph-canvas"
|
||||
targetSelector: "#graph-canvas"
|
||||
},
|
||||
{
|
||||
combo: {
|
||||
@@ -144,7 +144,7 @@ const CORE_KEYBINDINGS = [
|
||||
alt: true
|
||||
},
|
||||
commandId: "Comfy.Canvas.ToggleSelectedNodes.Collapse",
|
||||
targetElementId: "graph-canvas"
|
||||
targetSelector: "#graph-canvas"
|
||||
},
|
||||
{
|
||||
combo: {
|
||||
@@ -152,7 +152,7 @@ const CORE_KEYBINDINGS = [
|
||||
ctrl: true
|
||||
},
|
||||
commandId: "Comfy.Canvas.ToggleSelectedNodes.Bypass",
|
||||
targetElementId: "graph-canvas"
|
||||
targetSelector: "#graph-canvas"
|
||||
},
|
||||
{
|
||||
combo: {
|
||||
@@ -160,7 +160,7 @@ const CORE_KEYBINDINGS = [
|
||||
ctrl: true
|
||||
},
|
||||
commandId: "Comfy.Canvas.ToggleSelectedNodes.Mute",
|
||||
targetElementId: "graph-canvas"
|
||||
targetSelector: "#graph-canvas"
|
||||
},
|
||||
{
|
||||
combo: {
|
||||
@@ -190,7 +190,7 @@ const useKeybindingService = /* @__PURE__ */ __name(() => {
|
||||
return;
|
||||
}
|
||||
const keybinding = keybindingStore.getKeybinding(keyCombo);
|
||||
if (keybinding && keybinding.targetElementId !== "graph-canvas") {
|
||||
if (keybinding && keybinding.targetSelector !== "#graph-canvas") {
|
||||
event.preventDefault();
|
||||
await commandStore.execute(keybinding.commandId);
|
||||
return;
|
||||
@@ -247,4 +247,4 @@ const useKeybindingService = /* @__PURE__ */ __name(() => {
|
||||
export {
|
||||
useKeybindingService as u
|
||||
};
|
||||
//# sourceMappingURL=keybindingService-Cak1En5n.js.map
|
||||
//# sourceMappingURL=keybindingService-Bx7YdkXn.js.map
|
||||
4
web/assets/serverConfigStore-DCme3xlV.js → web/assets/serverConfigStore-CvyKFVuP.js
generated
vendored
4
web/assets/serverConfigStore-DCme3xlV.js → web/assets/serverConfigStore-CvyKFVuP.js
generated
vendored
@@ -1,6 +1,6 @@
|
||||
var __defProp = Object.defineProperty;
|
||||
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
||||
import { a1 as defineStore, ad as ref, c as computed } from "./index-QvfM__ze.js";
|
||||
import { $ as defineStore, ab as ref, c as computed } from "./index-DjNHn37O.js";
|
||||
const useServerConfigStore = defineStore("serverConfig", () => {
|
||||
const serverConfigById = ref({});
|
||||
const serverConfigs = computed(() => {
|
||||
@@ -87,4 +87,4 @@ const useServerConfigStore = defineStore("serverConfig", () => {
|
||||
export {
|
||||
useServerConfigStore as u
|
||||
};
|
||||
//# sourceMappingURL=serverConfigStore-DCme3xlV.js.map
|
||||
//# sourceMappingURL=serverConfigStore-CvyKFVuP.js.map
|
||||
4
web/index.html
vendored
4
web/index.html
vendored
@@ -6,8 +6,8 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
|
||||
<link rel="stylesheet" type="text/css" href="user.css" />
|
||||
<link rel="stylesheet" type="text/css" href="materialdesignicons.min.css" />
|
||||
<script type="module" crossorigin src="./assets/index-QvfM__ze.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="./assets/index-Cf-n7v0V.css">
|
||||
<script type="module" crossorigin src="./assets/index-DjNHn37O.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="./assets/index-t-sFBuUC.css">
|
||||
</head>
|
||||
<body class="litegraph grid">
|
||||
<div id="vue-app"></div>
|
||||
|
||||
Reference in New Issue
Block a user