Skip to content

Commit 8b1a49b

Browse files
committed
Merge branch 'gempoll' into gempoll-docker
2 parents 4aa1d28 + 735974e commit 8b1a49b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+62110
-50501
lines changed

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
blank_issues_enabled: true
22
contact_links:
3+
- name: ComfyUI Frontend Issues
4+
url: https://github.com/Comfy-Org/ComfyUI_frontend/issues
5+
about: Issues related to the ComfyUI frontend (display issues, user interaction bugs), please go to the frontend repo to file the issue
36
- name: ComfyUI Matrix Space
47
url: https://app.element.io/#/room/%23comfyui_space%3Amatrix.org
58
about: The ComfyUI Matrix Space is available for support and general discussion related to ComfyUI (Matrix is like Discord but open source).

README.md

Lines changed: 72 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,35 @@
1-
ComfyUI
2-
=======
3-
The most powerful and modular stable diffusion GUI and backend.
4-
-----------
1+
<div align="center">
2+
3+
# ComfyUI
4+
**The most powerful and modular stable diffusion GUI and backend.**
5+
6+
7+
[![Website][website-shield]][website-url]
8+
[![Dynamic JSON Badge][discord-shield]][discord-url]
9+
[![Matrix][matrix-shield]][matrix-url]
10+
<br>
11+
[![][github-release-shield]][github-release-link]
12+
[![][github-release-date-shield]][github-release-link]
13+
[![][github-downloads-shield]][github-downloads-link]
14+
[![][github-downloads-latest-shield]][github-downloads-link]
15+
16+
[matrix-shield]: https://img.shields.io/badge/Matrix-000000?style=flat&logo=matrix&logoColor=white
17+
[matrix-url]: https://app.element.io/#/room/%23comfyui_space%3Amatrix.org
18+
[website-shield]: https://img.shields.io/badge/ComfyOrg-4285F4?style=flat
19+
[website-url]: https://www.comfy.org/
20+
<!-- Workaround to display total user from https://github.com/badges/shields/issues/4500#issuecomment-2060079995 -->
21+
[discord-shield]: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fdiscord.com%2Fapi%2Finvites%2Fcomfyorg%3Fwith_counts%3Dtrue&query=%24.approximate_member_count&logo=discord&logoColor=white&label=Discord&color=green&suffix=%20total
22+
[discord-url]: https://www.comfy.org/discord
23+
24+
[github-release-shield]: https://img.shields.io/github/v/release/comfyanonymous/ComfyUI?style=flat&sort=semver
25+
[github-release-link]: https://github.com/comfyanonymous/ComfyUI/releases
26+
[github-release-date-shield]: https://img.shields.io/github/release-date/comfyanonymous/ComfyUI?style=flat
27+
[github-downloads-shield]: https://img.shields.io/github/downloads/comfyanonymous/ComfyUI/total?style=flat
28+
[github-downloads-latest-shield]: https://img.shields.io/github/downloads/comfyanonymous/ComfyUI/latest/total?style=flat&label=downloads%40latest
29+
[github-downloads-link]: https://github.com/comfyanonymous/ComfyUI/releases
30+
531
![ComfyUI Screenshot](comfyui_screenshot.png)
32+
</div>
633

734
This ui will let you design and execute advanced stable diffusion pipelines using a graph/nodes/flowchart based interface. For some workflow examples and see what ComfyUI can do you can check out:
835
### [ComfyUI Examples](https://comfyanonymous.github.io/ComfyUI_examples/)
@@ -219,6 +246,47 @@ Use `--tls-keyfile key.pem --tls-certfile cert.pem` to enable TLS/SSL, the app w
219246

220247
See also: [https://www.comfy.org/](https://www.comfy.org/)
221248

249+
## Frontend Development
250+
251+
As of August 15, 2024, we have transitioned to a new frontend, which is now hosted in a separate repository: [ComfyUI Frontend](https://github.com/Comfy-Org/ComfyUI_frontend). This repository now hosts the compiled JS (from TS/Vue) under the `web/` directory.
252+
253+
### Reporting Issues and Requesting Features
254+
255+
For any bugs, issues, or feature requests related to the frontend, please use the [ComfyUI Frontend repository](https://github.com/Comfy-Org/ComfyUI_frontend). This will help us manage and address frontend-specific concerns more efficiently.
256+
257+
### Using the Latest Frontend
258+
259+
The new frontend is now the default for ComfyUI. However, please note:
260+
261+
1. The frontend in the main ComfyUI repository is updated weekly.
262+
2. Daily releases are available in the separate frontend repository.
263+
264+
To use the most up-to-date frontend version:
265+
266+
1. For the latest daily release, launch ComfyUI with this command line argument:
267+
268+
```
269+
--front-end-version Comfy-Org/ComfyUI_frontend@latest
270+
```
271+
272+
2. For a specific version, replace `latest` with the desired version number:
273+
274+
```
275+
--front-end-version Comfy-Org/[email protected]
276+
```
277+
278+
This approach allows you to easily switch between the stable weekly release and the cutting-edge daily updates, or even specific versions for testing purposes.
279+
280+
### Accessing the Legacy Frontend
281+
282+
If you need to use the legacy frontend for any reason, you can access it using the following command line argument:
283+
284+
```
285+
--front-end-version Comfy-Org/ComfyUI_legacy_frontend@latest
286+
```
287+
288+
This will use a snapshot of the legacy frontend preserved in the [ComfyUI Legacy Frontend repository](https://github.com/Comfy-Org/ComfyUI_legacy_frontend).
289+
222290
# QA
223291

224292
### Which GPU should I buy for this?

api_server/__init__.py

Whitespace-only changes.

api_server/routes/__init__.py

Whitespace-only changes.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# ComfyUI Internal Routes
2+
3+
All routes under the `/internal` path are designated for **internal use by ComfyUI only**. These routes are not intended for use by external applications may change at any time without notice.

api_server/routes/internal/__init__.py

Whitespace-only changes.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
from aiohttp import web
2+
from typing import Optional
3+
from folder_paths import models_dir, user_directory, output_directory
4+
from api_server.services.file_service import FileService
5+
6+
class InternalRoutes:
7+
'''
8+
The top level web router for internal routes: /internal/*
9+
The endpoints here should NOT be depended upon. It is for ComfyUI frontend use only.
10+
Check README.md for more information.
11+
12+
'''
13+
def __init__(self):
14+
self.routes: web.RouteTableDef = web.RouteTableDef()
15+
self._app: Optional[web.Application] = None
16+
self.file_service = FileService({
17+
"models": models_dir,
18+
"user": user_directory,
19+
"output": output_directory
20+
})
21+
22+
def setup_routes(self):
23+
@self.routes.get('/files')
24+
async def list_files(request):
25+
directory_key = request.query.get('directory', '')
26+
try:
27+
file_list = self.file_service.list_files(directory_key)
28+
return web.json_response({"files": file_list})
29+
except ValueError as e:
30+
return web.json_response({"error": str(e)}, status=400)
31+
except Exception as e:
32+
return web.json_response({"error": str(e)}, status=500)
33+
34+
35+
def get_app(self):
36+
if self._app is None:
37+
self._app = web.Application()
38+
self.setup_routes()
39+
self._app.add_routes(self.routes)
40+
return self._app

api_server/services/__init__.py

Whitespace-only changes.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from typing import Dict, List, Optional
2+
from api_server.utils.file_operations import FileSystemOperations, FileSystemItem
3+
4+
class FileService:
5+
def __init__(self, allowed_directories: Dict[str, str], file_system_ops: Optional[FileSystemOperations] = None):
6+
self.allowed_directories: Dict[str, str] = allowed_directories
7+
self.file_system_ops: FileSystemOperations = file_system_ops or FileSystemOperations()
8+
9+
def list_files(self, directory_key: str) -> List[FileSystemItem]:
10+
if directory_key not in self.allowed_directories:
11+
raise ValueError("Invalid directory key")
12+
directory_path: str = self.allowed_directories[directory_key]
13+
return self.file_system_ops.walk_directory(directory_path)
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import os
2+
from typing import List, Union, TypedDict, Literal
3+
from typing_extensions import TypeGuard
4+
class FileInfo(TypedDict):
5+
name: str
6+
path: str
7+
type: Literal["file"]
8+
size: int
9+
10+
class DirectoryInfo(TypedDict):
11+
name: str
12+
path: str
13+
type: Literal["directory"]
14+
15+
FileSystemItem = Union[FileInfo, DirectoryInfo]
16+
17+
def is_file_info(item: FileSystemItem) -> TypeGuard[FileInfo]:
18+
return item["type"] == "file"
19+
20+
class FileSystemOperations:
21+
@staticmethod
22+
def walk_directory(directory: str) -> List[FileSystemItem]:
23+
file_list: List[FileSystemItem] = []
24+
for root, dirs, files in os.walk(directory):
25+
for name in files:
26+
file_path = os.path.join(root, name)
27+
relative_path = os.path.relpath(file_path, directory)
28+
file_list.append({
29+
"name": name,
30+
"path": relative_path,
31+
"type": "file",
32+
"size": os.path.getsize(file_path)
33+
})
34+
for name in dirs:
35+
dir_path = os.path.join(root, name)
36+
relative_path = os.path.relpath(dir_path, directory)
37+
file_list.append({
38+
"name": name,
39+
"path": relative_path,
40+
"type": "directory"
41+
})
42+
return file_list

0 commit comments

Comments
 (0)