mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-03-12 12:47:45 +08:00
cleaning up; removing unused subflows folder and routes
This commit is contained in:
parent
32f7fd663a
commit
2299b677eb
1
.gitignore
vendored
1
.gitignore
vendored
@ -5,7 +5,6 @@ __pycache__/
|
|||||||
!/input/example.png
|
!/input/example.png
|
||||||
/models/
|
/models/
|
||||||
/temp/
|
/temp/
|
||||||
/subflows/
|
|
||||||
/custom_nodes/
|
/custom_nodes/
|
||||||
!custom_nodes/example_node.py.example
|
!custom_nodes/example_node.py.example
|
||||||
extra_model_paths.yaml
|
extra_model_paths.yaml
|
||||||
|
|||||||
@ -67,6 +67,7 @@ def get_input_directory():
|
|||||||
global input_directory
|
global input_directory
|
||||||
return input_directory
|
return input_directory
|
||||||
|
|
||||||
|
|
||||||
#NOTE: used in http server so don't put folders that should not be accessed remotely
|
#NOTE: used in http server so don't put folders that should not be accessed remotely
|
||||||
def get_directory_by_type(type_name):
|
def get_directory_by_type(type_name):
|
||||||
if type_name == "output":
|
if type_name == "output":
|
||||||
|
|||||||
18
server.py
18
server.py
@ -1,5 +1,4 @@
|
|||||||
import os
|
import os
|
||||||
import os.path as osp
|
|
||||||
import sys
|
import sys
|
||||||
import asyncio
|
import asyncio
|
||||||
import traceback
|
import traceback
|
||||||
@ -155,8 +154,6 @@ class PromptServer():
|
|||||||
type_dir = folder_paths.get_temp_directory()
|
type_dir = folder_paths.get_temp_directory()
|
||||||
elif dir_type == "output":
|
elif dir_type == "output":
|
||||||
type_dir = folder_paths.get_output_directory()
|
type_dir = folder_paths.get_output_directory()
|
||||||
elif dir_type == "subflows":
|
|
||||||
type_dir = folder_paths.get_subflows_directory()
|
|
||||||
|
|
||||||
return type_dir, dir_type
|
return type_dir, dir_type
|
||||||
|
|
||||||
@ -522,21 +519,6 @@ class PromptServer():
|
|||||||
self.prompt_queue.delete_history_item(id_to_delete)
|
self.prompt_queue.delete_history_item(id_to_delete)
|
||||||
|
|
||||||
return web.Response(status=200)
|
return web.Response(status=200)
|
||||||
|
|
||||||
@routes.get("/subflows/{subflow_name}")
|
|
||||||
async def get_subflow(request):
|
|
||||||
subflow_name = request.match_info.get("subflow_name", None)
|
|
||||||
if subflow_name != None:
|
|
||||||
subflow_path = folder_paths.get_full_path("subflows", subflow_name)
|
|
||||||
ext = osp.splitext(subflow_path)[1]
|
|
||||||
with open(subflow_path) as f:
|
|
||||||
if ext == ".json":
|
|
||||||
subflow_data = json.load(f)
|
|
||||||
return web.json_response({"subflow": subflow_data}, status=200)
|
|
||||||
elif ext == ".png":
|
|
||||||
return web.json_response({"error": "todo", "node_errors": []}, status=400)
|
|
||||||
return web.json_response({"error": "no subflow_name provided", "node_errors": []}, status=400)
|
|
||||||
|
|
||||||
|
|
||||||
def add_routes(self):
|
def add_routes(self):
|
||||||
self.app.add_routes(self.routes)
|
self.app.add_routes(self.routes)
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import { app } from "../../scripts/app.js";
|
|||||||
const CONVERTED_TYPE = "converted-widget";
|
const CONVERTED_TYPE = "converted-widget";
|
||||||
const VALID_TYPES = ["STRING", "combo", "number", "BOOLEAN"];
|
const VALID_TYPES = ["STRING", "combo", "number", "BOOLEAN"];
|
||||||
const CONFIG = Symbol();
|
const CONFIG = Symbol();
|
||||||
export const GET_CONFIG = Symbol();
|
const GET_CONFIG = Symbol();
|
||||||
|
|
||||||
function getConfig(widgetName) {
|
function getConfig(widgetName) {
|
||||||
const { nodeData } = this.constructor;
|
const { nodeData } = this.constructor;
|
||||||
|
|||||||
@ -13315,7 +13315,7 @@ LGraphNode.prototype.executeAction = function(action)
|
|||||||
content: "Align Selected To",
|
content: "Align Selected To",
|
||||||
has_submenu: true,
|
has_submenu: true,
|
||||||
callback: LGraphCanvas.onNodeAlign,
|
callback: LGraphCanvas.onNodeAlign,
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
options.push(null, {
|
options.push(null, {
|
||||||
|
|||||||
@ -264,19 +264,6 @@ class ComfyApi extends EventTarget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the subflow json data
|
|
||||||
* @returns Prompt history including node outputs
|
|
||||||
*/
|
|
||||||
async getSubflow(subflowName) {
|
|
||||||
try {
|
|
||||||
const res = await this.fetchApi(`/subflows/${subflowName}`);
|
|
||||||
return await res.json();
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
return { };
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets system & device stats
|
* Gets system & device stats
|
||||||
|
|||||||
@ -1622,9 +1622,6 @@ export class ComfyApp {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts the current graph workflow for sending to the API
|
* Converts the current graph workflow for sending to the API
|
||||||
* @returns The workflow and node links
|
* @returns The workflow and node links
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user