comfygit-core 0.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- comfygit_core/analyzers/custom_node_scanner.py +109 -0
- comfygit_core/analyzers/git_change_parser.py +156 -0
- comfygit_core/analyzers/model_scanner.py +318 -0
- comfygit_core/analyzers/node_classifier.py +58 -0
- comfygit_core/analyzers/node_git_analyzer.py +77 -0
- comfygit_core/analyzers/status_scanner.py +362 -0
- comfygit_core/analyzers/workflow_dependency_parser.py +143 -0
- comfygit_core/caching/__init__.py +16 -0
- comfygit_core/caching/api_cache.py +210 -0
- comfygit_core/caching/base.py +212 -0
- comfygit_core/caching/comfyui_cache.py +100 -0
- comfygit_core/caching/custom_node_cache.py +320 -0
- comfygit_core/caching/workflow_cache.py +797 -0
- comfygit_core/clients/__init__.py +4 -0
- comfygit_core/clients/civitai_client.py +412 -0
- comfygit_core/clients/github_client.py +349 -0
- comfygit_core/clients/registry_client.py +230 -0
- comfygit_core/configs/comfyui_builtin_nodes.py +1614 -0
- comfygit_core/configs/comfyui_models.py +62 -0
- comfygit_core/configs/model_config.py +151 -0
- comfygit_core/constants.py +82 -0
- comfygit_core/core/environment.py +1635 -0
- comfygit_core/core/workspace.py +898 -0
- comfygit_core/factories/environment_factory.py +419 -0
- comfygit_core/factories/uv_factory.py +61 -0
- comfygit_core/factories/workspace_factory.py +109 -0
- comfygit_core/infrastructure/sqlite_manager.py +156 -0
- comfygit_core/integrations/__init__.py +7 -0
- comfygit_core/integrations/uv_command.py +318 -0
- comfygit_core/logging/logging_config.py +15 -0
- comfygit_core/managers/environment_git_orchestrator.py +316 -0
- comfygit_core/managers/environment_model_manager.py +296 -0
- comfygit_core/managers/export_import_manager.py +116 -0
- comfygit_core/managers/git_manager.py +667 -0
- comfygit_core/managers/model_download_manager.py +252 -0
- comfygit_core/managers/model_symlink_manager.py +166 -0
- comfygit_core/managers/node_manager.py +1378 -0
- comfygit_core/managers/pyproject_manager.py +1321 -0
- comfygit_core/managers/user_content_symlink_manager.py +436 -0
- comfygit_core/managers/uv_project_manager.py +569 -0
- comfygit_core/managers/workflow_manager.py +1944 -0
- comfygit_core/models/civitai.py +432 -0
- comfygit_core/models/commit.py +18 -0
- comfygit_core/models/environment.py +293 -0
- comfygit_core/models/exceptions.py +378 -0
- comfygit_core/models/manifest.py +132 -0
- comfygit_core/models/node_mapping.py +201 -0
- comfygit_core/models/protocols.py +248 -0
- comfygit_core/models/registry.py +63 -0
- comfygit_core/models/shared.py +356 -0
- comfygit_core/models/sync.py +42 -0
- comfygit_core/models/system.py +204 -0
- comfygit_core/models/workflow.py +914 -0
- comfygit_core/models/workspace_config.py +71 -0
- comfygit_core/py.typed +0 -0
- comfygit_core/repositories/migrate_paths.py +49 -0
- comfygit_core/repositories/model_repository.py +958 -0
- comfygit_core/repositories/node_mappings_repository.py +246 -0
- comfygit_core/repositories/workflow_repository.py +57 -0
- comfygit_core/repositories/workspace_config_repository.py +121 -0
- comfygit_core/resolvers/global_node_resolver.py +459 -0
- comfygit_core/resolvers/model_resolver.py +250 -0
- comfygit_core/services/import_analyzer.py +218 -0
- comfygit_core/services/model_downloader.py +422 -0
- comfygit_core/services/node_lookup_service.py +251 -0
- comfygit_core/services/registry_data_manager.py +161 -0
- comfygit_core/strategies/__init__.py +4 -0
- comfygit_core/strategies/auto.py +72 -0
- comfygit_core/strategies/confirmation.py +69 -0
- comfygit_core/utils/comfyui_ops.py +125 -0
- comfygit_core/utils/common.py +164 -0
- comfygit_core/utils/conflict_parser.py +232 -0
- comfygit_core/utils/dependency_parser.py +231 -0
- comfygit_core/utils/download.py +216 -0
- comfygit_core/utils/environment_cleanup.py +111 -0
- comfygit_core/utils/filesystem.py +178 -0
- comfygit_core/utils/git.py +1184 -0
- comfygit_core/utils/input_signature.py +145 -0
- comfygit_core/utils/model_categories.py +52 -0
- comfygit_core/utils/pytorch.py +71 -0
- comfygit_core/utils/requirements.py +211 -0
- comfygit_core/utils/retry.py +242 -0
- comfygit_core/utils/symlink_utils.py +119 -0
- comfygit_core/utils/system_detector.py +258 -0
- comfygit_core/utils/uuid.py +28 -0
- comfygit_core/utils/uv_error_handler.py +158 -0
- comfygit_core/utils/version.py +73 -0
- comfygit_core/utils/workflow_hash.py +90 -0
- comfygit_core/validation/resolution_tester.py +297 -0
- comfygit_core-0.2.0.dist-info/METADATA +939 -0
- comfygit_core-0.2.0.dist-info/RECORD +93 -0
- comfygit_core-0.2.0.dist-info/WHEEL +4 -0
- comfygit_core-0.2.0.dist-info/licenses/LICENSE.txt +661 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
|
|
3
|
+
@dataclass(repr=False)
|
|
4
|
+
class APICredentials:
|
|
5
|
+
"""Secure storage for external API credentials."""
|
|
6
|
+
civitai_token: str | None = None
|
|
7
|
+
|
|
8
|
+
@classmethod
|
|
9
|
+
def from_dict(cls, data):
|
|
10
|
+
if not data:
|
|
11
|
+
return None
|
|
12
|
+
return cls(civitai_token=data.get("civitai_token"))
|
|
13
|
+
|
|
14
|
+
def to_dict(self):
|
|
15
|
+
return {"civitai_token": self.civitai_token} if self.civitai_token else {}
|
|
16
|
+
|
|
17
|
+
def __repr__(self):
|
|
18
|
+
"""Obfuscate token in logs."""
|
|
19
|
+
if self.civitai_token:
|
|
20
|
+
return f"APICredentials(civitai_token='***{self.civitai_token[-4:]}')"
|
|
21
|
+
return "APICredentials(civitai_token=None)"
|
|
22
|
+
|
|
23
|
+
@dataclass
|
|
24
|
+
class ModelDirectory:
|
|
25
|
+
path: str
|
|
26
|
+
added_at: str
|
|
27
|
+
last_sync: str
|
|
28
|
+
|
|
29
|
+
@classmethod
|
|
30
|
+
def from_dict(cls, data):
|
|
31
|
+
return cls(
|
|
32
|
+
path=data["path"],
|
|
33
|
+
added_at=data["added_at"],
|
|
34
|
+
last_sync=data["last_sync"],
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
@classmethod
|
|
38
|
+
def to_dict(cls, instance):
|
|
39
|
+
return instance.__dict__
|
|
40
|
+
|
|
41
|
+
@dataclass
|
|
42
|
+
class WorkspaceConfig:
|
|
43
|
+
version: int
|
|
44
|
+
active_environment: str
|
|
45
|
+
created_at: str
|
|
46
|
+
global_model_directory: ModelDirectory | None
|
|
47
|
+
api_credentials: APICredentials | None = None
|
|
48
|
+
prefer_registry_cache: bool = True # Use local node mappings cache instead of API
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def from_dict(cls, data):
|
|
52
|
+
return cls(
|
|
53
|
+
version=data["version"],
|
|
54
|
+
active_environment=data["active_environment"],
|
|
55
|
+
created_at=data["created_at"],
|
|
56
|
+
global_model_directory=ModelDirectory.from_dict(data["global_model_directory"]) if data.get("global_model_directory") else None,
|
|
57
|
+
api_credentials=APICredentials.from_dict(data.get("api_credentials")) if data.get("api_credentials") else None,
|
|
58
|
+
prefer_registry_cache=data.get("prefer_registry_cache", True),
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
@classmethod
|
|
62
|
+
def to_dict(cls, instance):
|
|
63
|
+
result = {
|
|
64
|
+
"version": instance.version,
|
|
65
|
+
"active_environment": instance.active_environment,
|
|
66
|
+
"created_at": instance.created_at,
|
|
67
|
+
"global_model_directory": ModelDirectory.to_dict(instance.global_model_directory) if instance.global_model_directory else None,
|
|
68
|
+
"api_credentials": instance.api_credentials.to_dict() if instance.api_credentials else None,
|
|
69
|
+
"prefer_registry_cache": instance.prefer_registry_cache,
|
|
70
|
+
}
|
|
71
|
+
return result
|
comfygit_core/py.typed
ADDED
|
File without changes
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"""One-time migration to normalize path separators in existing databases."""
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
from .model_repository import ModelRepository
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def migrate_path_separators(db_path: Path) -> int:
|
|
7
|
+
"""Normalize all path separators in model_locations to forward slashes.
|
|
8
|
+
|
|
9
|
+
Args:
|
|
10
|
+
db_path: Path to models.db database
|
|
11
|
+
|
|
12
|
+
Returns:
|
|
13
|
+
Number of paths updated
|
|
14
|
+
"""
|
|
15
|
+
repo = ModelRepository(db_path)
|
|
16
|
+
|
|
17
|
+
# Get all locations - we'll filter in Python to avoid SQL escaping issues
|
|
18
|
+
query = """
|
|
19
|
+
SELECT model_hash, base_directory, relative_path, filename, mtime
|
|
20
|
+
FROM model_locations
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
all_results = repo.sqlite.execute_query(query)
|
|
24
|
+
|
|
25
|
+
# Filter for paths with backslashes
|
|
26
|
+
results = [r for r in all_results if '\\' in r['relative_path']]
|
|
27
|
+
|
|
28
|
+
if not results:
|
|
29
|
+
return 0
|
|
30
|
+
|
|
31
|
+
# Update each path
|
|
32
|
+
update_query = """
|
|
33
|
+
UPDATE model_locations
|
|
34
|
+
SET relative_path = ?
|
|
35
|
+
WHERE model_hash = ? AND base_directory = ? AND relative_path = ?
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
count = 0
|
|
39
|
+
for row in results:
|
|
40
|
+
old_path = row['relative_path']
|
|
41
|
+
new_path = old_path.replace('\\', '/')
|
|
42
|
+
|
|
43
|
+
repo.sqlite.execute_write(
|
|
44
|
+
update_query,
|
|
45
|
+
(new_path, row['model_hash'], row['base_directory'], old_path)
|
|
46
|
+
)
|
|
47
|
+
count += 1
|
|
48
|
+
|
|
49
|
+
return count
|