cleaning up; removing unused subflows folder and routes

This commit is contained in:
Sammy Franklin 2023-11-29 13:04:14 -08:00
parent 32f7fd663a
commit 2299b677eb
7 changed files with 3 additions and 37 deletions

1
.gitignore vendored
View File

@ -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

View File

@ -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":

View File

@ -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
@ -523,21 +520,6 @@ class PromptServer():
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)

View File

@ -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;

View File

@ -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, {

View File

@ -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

View File

@ -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