blackify pr

This commit is contained in:
Lincoln Stein
2023-07-29 10:47:55 -04:00
parent d79d5a4ff7
commit 982a568349
4 changed files with 13 additions and 12 deletions

View File

@ -6,8 +6,7 @@ from pydantic import Field
from invokeai.app.invocations.prompt import PromptOutput from invokeai.app.invocations.prompt import PromptOutput
from .baseinvocation import (BaseInvocation, BaseInvocationOutput, from .baseinvocation import BaseInvocation, BaseInvocationOutput, InvocationConfig, InvocationContext
InvocationConfig, InvocationContext)
from .math import FloatOutput, IntOutput from .math import FloatOutput, IntOutput
# Pass-through parameter nodes - used by subgraphs # Pass-through parameter nodes - used by subgraphs
@ -68,6 +67,7 @@ class ParamStringInvocation(BaseInvocation):
def invoke(self, context: InvocationContext) -> StringOutput: def invoke(self, context: InvocationContext) -> StringOutput:
return StringOutput(text=self.text) return StringOutput(text=self.text)
class ParamPromptInvocation(BaseInvocation): class ParamPromptInvocation(BaseInvocation):
"""A prompt input parameter""" """A prompt input parameter"""

View File

@ -348,7 +348,7 @@ class ModelInstall(object):
if key in self.datasets: if key in self.datasets:
description = self.datasets[key].get("description") or description description = self.datasets[key].get("description") or description
rel_path = self.relative_to_root(path,self.config.models_path) rel_path = self.relative_to_root(path, self.config.models_path)
attributes = dict( attributes = dict(
path=str(rel_path), path=str(rel_path),

View File

@ -423,7 +423,7 @@ class ModelManager(object):
return (model_name, base_model, model_type) return (model_name, base_model, model_type)
def _get_model_cache_path(self, model_path): def _get_model_cache_path(self, model_path):
return self.resolve_model_path(".cache" + '/' + hashlib.md5(str(model_path).encode()).hexdigest()) return self.resolve_model_path(".cache" + "/" + hashlib.md5(str(model_path).encode()).hexdigest())
@classmethod @classmethod
def initialize_model_config(cls, config_path: Path): def initialize_model_config(cls, config_path: Path):
@ -893,7 +893,7 @@ class ModelManager(object):
# Patch for relative path bug in older models.yaml - paths should not # Patch for relative path bug in older models.yaml - paths should not
# be starting with a hard-coded 'models'. This will also fix up # be starting with a hard-coded 'models'. This will also fix up
# models.yaml when committed. # models.yaml when committed.
if model_config.path.startswith('models'): if model_config.path.startswith("models"):
model_config.path = str(Path(*Path(model_config.path).parts[1:])) model_config.path = str(Path(*Path(model_config.path).parts[1:]))
model_path = self.app_config.models_path.absolute() / model_config.path model_path = self.app_config.models_path.absolute() / model_config.path

View File

@ -541,6 +541,7 @@ class addModelsForm(CyclingForm, npyscreen.FormMultiPage):
if downloads := section.get("download_ids"): if downloads := section.get("download_ids"):
selections.install_models.extend(downloads.value.split()) selections.install_models.extend(downloads.value.split())
class AddModelApplication(npyscreen.NPSAppManaged): class AddModelApplication(npyscreen.NPSAppManaged):
def __init__(self, opt): def __init__(self, opt):
super().__init__() super().__init__()
@ -625,9 +626,9 @@ def _ask_user_for_pt_tui(model_path: Path, tui_conn: Connection) -> SchedulerPre
# -------------------------------------------------------- # --------------------------------------------------------
def process_and_execute( def process_and_execute(
opt: Namespace, opt: Namespace,
selections: InstallSelections, selections: InstallSelections,
conn_out: Connection = None, conn_out: Connection = None,
): ):
# need to reinitialize config in subprocess # need to reinitialize config in subprocess
config = InvokeAIAppConfig.get_config() config = InvokeAIAppConfig.get_config()