Dev/nkendallbar/add workflow examples

This commit is contained in:
Nicolas Kendall-Bar
2024-06-18 19:21:11 -07:00
parent 126fb8a8de
commit 0a05d55bc0
8 changed files with 62 additions and 4 deletions
+1
View File
@@ -0,0 +1 @@
*.png filter=lfs diff=lfs merge=lfs -text
+28
View File
@@ -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.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 130 B

+3 -1
View File
@@ -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",
+24
View File
@@ -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,)
-3
View File
@@ -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]
)
+3
View File
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:828f48904332ea48ef0f08eaa19650f54d0e936a8acfe419bb122759f93f8db9
size 9373123
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f766feda932035912f956b8efbe492d10df4aac04877fddcbedd79044cfd03c8
size 7276334