From 5cd4ca9906166d48661ead4d9d38eccb1cdc12a7 Mon Sep 17 00:00:00 2001 From: Max Tretikov Date: Fri, 14 Jun 2024 12:42:40 -0600 Subject: [PATCH] Fix function name dupes in comfy.cmd.server --- comfy/cmd/server.py | 10 +++++----- requirements.txt | 1 - 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/comfy/cmd/server.py b/comfy/cmd/server.py index 28a047e28..be3d6a761 100644 --- a/comfy/cmd/server.py +++ b/comfy/cmd/server.py @@ -22,7 +22,7 @@ import aiohttp from PIL import Image from PIL.PngImagePlugin import PngInfo from aiohttp import web -from can_ada import URL, parse as urlparse +from can_ada import URL, parse as urlparse # pylint: disable=no-name-in-module from typing_extensions import NamedTuple from .. import interruption @@ -382,7 +382,7 @@ class PromptServer(ExecutorToClientProgress): return web.json_response(dt["__metadata__"]) @routes.get("/system_stats") - async def get_queue(request): + async def get_system_stats(request): device = model_management.get_torch_device() device_name = model_management.get_torch_device_name(device) vram_total, torch_vram_total = model_management.get_total_memory(device, torch_total_too=True) @@ -458,7 +458,7 @@ class PromptServer(ExecutorToClientProgress): return web.json_response(self.prompt_queue.get_history(max_items=max_items)) @routes.get("/history/{prompt_id}") - async def get_history(request): + async def get_history_prompt(request): prompt_id = request.match_info.get("prompt_id", None) return web.json_response(self.prompt_queue.get_history(prompt_id=prompt_id)) @@ -555,7 +555,7 @@ class PromptServer(ExecutorToClientProgress): return web.Response(status=200) @routes.post("/api/v1/prompts") - async def post_prompt(request: web.Request) -> web.Response | web.FileResponse: + async def post_api_prompt(request: web.Request) -> web.Response | web.FileResponse: # check if the queue is too long accept = request.headers.get("accept", "application/json") content_type = request.headers.get("content-type", "application/json") @@ -685,7 +685,7 @@ class PromptServer(ExecutorToClientProgress): return web.Response(status=204) @routes.get("/api/v1/prompts") - async def get_prompt(_: web.Request) -> web.Response: + async def get_api_prompt(_: web.Request) -> web.Response: history = self.prompt_queue.get_history() history_items = list(history.values()) if len(history_items) == 0: diff --git a/requirements.txt b/requirements.txt index 8bc0a6766..453ac8e15 100644 --- a/requirements.txt +++ b/requirements.txt @@ -37,7 +37,6 @@ kornia>=0.7.1 mpmath>=1.0,!=1.4.0a0 huggingface_hub lazy-object-proxy -can_ada fsspec natsort OpenEXR