diff --git a/.gitignore b/.gitignore index bee8a64..82adb58 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ __pycache__ +venv diff --git a/import_schemas.py b/import_schemas.py index 9bff6a9..df35270 100644 --- a/import_schemas.py +++ b/import_schemas.py @@ -7,8 +7,10 @@ models_to_import = [ "bytedance/sdxl-lightning-4step", "fofr/face-to-many", "fofr/sd3-with-chaos", - "fofr/toolkit", + "meta/llama-2-7b-chat", "meta/llama-2-70b-chat", + "replicate-internal/llama-3-8b-instruct-int8-triton", + "replicate-internal/llama-3-70b-instruct-fp16-8xa100-triton", "meta/meta-llama-3-70b-instruct", "meta/meta-llama-3-8b-instruct", "mistralai/mixtral-8x7b-instruct-v0.1", @@ -20,6 +22,19 @@ models_to_import = [ "yorickvp/llava-13b", "yorickvp/llava-v1.6-34b", "yorickvp/llava-v1.6-mistral-7b", + "snowflake/snowflake-arctic-instruct", + "batouresearch/high-resolution-controlnet-tile", + "batouresearch/magic-style-transfer", + "batouresearch/magic-image-refiner", + "lucataco/pasd-magnify", + "cjwbw/supir", + "lucataco/qwen-vl-chat", + "omniedgeio/face-swap", + "ai-forever/kandinsky-2.2", + "pharmapsychotic/clip-interrogator", + "cuuupid/idm-vton", + "cuuupid/glm-4v-9b", + "lucataco/moondream2", ] @@ -27,6 +42,7 @@ def format_json_file(file_path): try: with open(file_path, "r") as f: data = json.load(f) + data["run_count"] = 0 with open(file_path, "w") as f: json.dump(data, f, indent=4, ensure_ascii=False) diff --git a/node.py b/node.py index 9fb2c85..1fa669e 100644 --- a/node.py +++ b/node.py @@ -62,6 +62,7 @@ def convert_schema_to_comfyui(schema, schemas): input_config["max"] = prop_data["maximum"] if input_type == "FLOAT": input_config["step"] = 0.01 + input_config["round"] = 0.001 if "prompt" in prop_name and prop_data.get("type") == "string": input_config["multiline"] = True @@ -106,7 +107,10 @@ def reorder_input_types(input_types, schema): def get_return_type(schemas, model_info): output_schema = schemas["components"]["schemas"].get("Output") - default_example_output = model_info.get("default_example", {}).get("output", []) + default_example = model_info.get("default_example") + default_example_output = ( + default_example.get("output", []) if default_example else [] + ) if ( output_schema @@ -132,7 +136,6 @@ def create_comfyui_node(schemas, model_info): node_name = f"Replicate {author}/{name}" input_schema = schemas["components"]["schemas"]["Input"] return_type = get_return_type(schemas, model_info) - print(f"{node_name} - {return_type}") class ReplicateToComfyUI: @classmethod @@ -251,29 +254,3 @@ def get_node_class_mappings(): NODE_CLASS_MAPPINGS = get_node_class_mappings() -print(NODE_CLASS_MAPPINGS) - -# # Load the schema -# with open("schema.json", "r") as f: -# schema = json.load(f) -# openapi_schema = schema["latest_version"]["openapi_schema"] - -# # Create the ComfyUI node -# ComfyUINode = create_comfyui_node(openapi_schema, schema) - -# # Print the resulting node class -# print(ComfyUINode.INPUT_TYPES()) - -# # Create an instance of the node and pass in defaults -# node_instance = ComfyUINode() -# defaults = { -# "seed": 0, -# "image": "https://example.com/default_image.png", -# "style": "3D", -# "prompt": "a person", -# "lora_scale": 1.0 -# } - -# # Run the node with the defaults -# result = node_instance.run_openapi_to_comfyui(**defaults) -# print(result)