diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..24a8e87 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.png filter=lfs diff=lfs merge=lfs -text diff --git a/README.md b/README.md index 8d6be62..6804a99 100644 --- a/README.md +++ b/README.md @@ -39,3 +39,31 @@ You should see RTX Remix nodes: - **RTX Remix Layer Types**: Select multiple layer types from a list of supported layer types. - **RTX Remix Layer Type**: Select from a list of supported layer types. +## Example Workflows and Templates + +To help you get started, we have included the following templates and workflow examples in the ./workflows folder. + +Simple to Use: +1. Open RTX Remix +1. Open your project +1. Select the objects with textures you want to upscale +1. Launch ComfyUI, load a graph using the .png file and hit "Queue Prompt" + +Note: for subsequent runs: disable the "Create Layer" portion of the graph since it will already exist. + +### Texture workflow template +`./workflows/rtx_remix_texture_workflow_template.png` + +![Template](workflows/rtx_remix_texture_workflow_template.png "Texture Workflow Template") + + +Use this graph to start your own ai workflow and modify textures in RTX Remix. + +### Plug n Play PBRify workflow +`./workflows/rtx_remix_pbrify_workflow.png` + +![Template](workflows/rtx_remix_pbrify_workflow.png "PBRify Workflow") + +A working example of an upscaling workflow to upscale the diffuse textures in your mod and automatically create Normal, Roughness and Height maps using https://github.com/Kim2091/PBRify_Remix + +This graph requires downloading some custom nodes and models from the above PBRify repo. diff --git a/images/remix_nodes.png b/images/remix_nodes.png index 5c531e0..b5f932f 100644 Binary files a/images/remix_nodes.png and b/images/remix_nodes.png differ diff --git a/nodes/__init__.py b/nodes/__init__.py index 5621457..0889f46 100644 --- a/nodes/__init__.py +++ b/nodes/__init__.py @@ -15,7 +15,7 @@ * limitations under the License. """ -from .common import RestAPIDetails, StringConstant, StartContext, EndContext +from .common import RestAPIDetails, StringConstant, StartContext, EndContext, StringConcatenate from .ingestion import IngestTexture from .textures import ( GetTextures, @@ -46,6 +46,7 @@ NODE_CLASS_MAPPINGS = { "RTXRemixRestAPIDetails": RestAPIDetails, "RTXRemixSetTexture": SetTexture, "RTXRemixStringConstant": StringConstant, + "RTXRemixStringConcatenate": StringConcatenate, "RTXRemixTexturesType": TexturesType, "RTXRemixTexturesTypes": TexturesTypes, "RTXRemixDefineLayerId": DefineLayerId, @@ -70,6 +71,7 @@ NODE_DISPLAY_NAME_MAPPINGS = { "RTXRemixRestAPIDetails": "RTX Remix Rest API Details", "RTXRemixSetTexture": "RTX Remix Set Texture", "RTXRemixStringConstant": "RTX Remix String Constant", + "RTXRemixStringConcatenate": "RTX Remix String Concatenate", "RTXRemixTexturesType": "RTX Remix Texture Type", "RTXRemixTexturesTypes": "RTX Remix Texture Types", "RTXRemixDefineLayerId": "RTX Remix Define Layer ID", diff --git a/nodes/common.py b/nodes/common.py index a876ca6..a6e1bb9 100644 --- a/nodes/common.py +++ b/nodes/common.py @@ -181,3 +181,27 @@ class StringConstant: def get_string(self, string): return (string,) + + +class StringConcatenate: + """Concatenate two strings""" + + @classmethod + def INPUT_TYPES(cls): # noqa N802 + return { + "required": { + "string1": ("STRING", {"default": "", "forceInput": True}), + "string2": ("STRING", {"default": "", "forceInput": True}), + }, + "optional": { + "separator": ("STRING", {"default": "_"}), + } + + } + + RETURN_TYPES = ("STRING",) + FUNCTION = "execute" + CATEGORY = f"{PREFIX_MENU}/{_file_name}" + + def execute(self, string1, string2, separator="_"): + return (string1 + separator + string2,) diff --git a/nodes/ingestion.py b/nodes/ingestion.py index 9ab58fe..401c7c6 100644 --- a/nodes/ingestion.py +++ b/nodes/ingestion.py @@ -109,9 +109,6 @@ class IngestTexture: check_response_status_code(r) output_folder = json.loads(r.text).get("asset_path", {}) - if not os.path.exists(output_folder): - raise ValueError(f"Output folder doesn't exist: {output_folder}") - full_output_folder, filename, _counter, _subfolder, _filename_prefix = folder_paths.get_save_image_path( texture_name, folder_paths.get_output_directory(), texture[0].shape[1], texture[0].shape[0] ) diff --git a/workflows/rtx_remix_pbrify_workflow.png b/workflows/rtx_remix_pbrify_workflow.png new file mode 100644 index 0000000..fc57dc1 --- /dev/null +++ b/workflows/rtx_remix_pbrify_workflow.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:828f48904332ea48ef0f08eaa19650f54d0e936a8acfe419bb122759f93f8db9 +size 9373123 diff --git a/workflows/rtx_remix_texture_workflow_template.png b/workflows/rtx_remix_texture_workflow_template.png new file mode 100644 index 0000000..7edad0f --- /dev/null +++ b/workflows/rtx_remix_texture_workflow_template.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f766feda932035912f956b8efbe492d10df4aac04877fddcbedd79044cfd03c8 +size 7276334