Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into feat/install_snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
yoland68 committed May 1, 2024
2 parents ca28817 + 74d5dc9 commit 853f4f2
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 19 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Lint

on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: psf/black@stable
4 changes: 4 additions & 0 deletions DEV_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ This guide provides an overview of how to develop in this repository.

`comfy --help`

4. Use pre commit hook

`pre-commit install`

## Make changes to the code base

There is a potential need for you to reinstall the package. You can do this by
Expand Down
23 changes: 10 additions & 13 deletions comfy_cli/cmdline.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,26 @@
import os
import subprocess
import sys
import time
import uuid
import webbrowser
from typing import Optional

import questionary
import typer
from typing_extensions import List, Annotated
from comfy_cli.command.models import models as models_command
from rich import print
import os
import subprocess
from rich.console import Console
from typing_extensions import Annotated, List

from comfy_cli import constants, env_checker, logging, tracking, ui, utils
from comfy_cli.command import custom_nodes
from comfy_cli.command import install as install_inner
from comfy_cli.command import run as run_inner
from comfy_cli import constants, tracking, logging, ui
from comfy_cli.command.models import models as models_command
from comfy_cli.config_manager import ConfigManager
from comfy_cli.env_checker import EnvChecker, check_comfy_server_running
from comfy_cli.meta_data import MetadataManager
from comfy_cli import env_checker
from rich.console import Console
import time
import uuid
from comfy_cli.config_manager import ConfigManager
from comfy_cli.workspace_manager import WorkspaceManager
import webbrowser
from comfy_cli import utils


app = typer.Typer()
workspace_manager = WorkspaceManager()
Expand Down
4 changes: 1 addition & 3 deletions comfy_cli/env_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,7 @@ def get_isolated_env(self):
return None

def check(self):
self.virtualenv_path = (
os.environ.get("VIRTUAL_ENV") if os.environ.get("VIRTUAL_ENV") else None
)
self.virtualenv_path = ()
self.conda_env = (
os.environ.get("CONDA_DEFAULT_ENV")
if os.environ.get("CONDA_DEFAULT_ENV")
Expand Down
7 changes: 4 additions & 3 deletions comfy_cli/meta_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from comfy_cli import constants
from comfy_cli.env_checker import EnvChecker
from comfy_cli.utils import singleton
from comfy_cli.workspace_manager import WorkspaceManager


@dataclass
Expand Down Expand Up @@ -70,6 +71,7 @@ def load_yaml(file_path: str) -> ComfyLockYAMLStruct:
custom_nodes = []


# Generate and update this following method using chatGPT
def save_yaml(file_path: str, metadata: ComfyLockYAMLStruct):
data = {
"basics": {
Expand Down Expand Up @@ -100,15 +102,14 @@ def check_file(path):

@singleton
class MetadataManager:

"""
Manages the metadata (comfy.yaml) for ComfyUI when running comfy cli, including loading,
validating, and saving metadata to a file.
"""

def __init__(self):
self.metadata_file = None
self.env_checker = EnvChecker()
self.workspace_manager = WorkspaceManager()
self.metadata = ComfyLockYAMLStruct(basics=Basics(), models=[])

def scan_dir(self):
Expand All @@ -133,7 +134,7 @@ def scan_dir_concur(self):
return model_files

def load_metadata(self):
if os.path.exists(self.metadata_file):
if os.path.exists(self.com):
with open(self.metadata_file, "r", encoding="utf-8") as file:
return yaml.safe_load(file)
else:
Expand Down

0 comments on commit 853f4f2

Please sign in to comment.