From 7669230cfb5defc5d47914d9a63bc3a02a4b8046 Mon Sep 17 00:00:00 2001 From: RunDevelopment Date: Sat, 22 Jul 2023 14:14:25 +0200 Subject: [PATCH] Enforce naming conventions --- .../ncnn/batch_processing/model_file_iterator.py | 4 ++-- .../ncnn/utility/{get_scale.py => get_model_scale.py} | 2 +- .../onnx/batch_processing/model_file_iterator.py | 4 ++-- .../onnx/processing/{rembg.py => remove_background.py} | 2 +- .../pytorch/iteration/model_file_iterator.py | 4 ++-- .../chaiNNer_pytorch/pytorch/restoration/upscale_face.py | 2 +- .../pytorch/utility/{get_scale.py => get_model_scale.py} | 2 +- .../image/batch_processing/image_file_iterator.py | 4 ++-- ...aired_image_file_iterator.py => image_pairs_iterator.py} | 4 ++-- .../{sprite_sheet_iterator.py => spritesheet_iterator.py} | 6 +++--- .../image/batch_processing/video_frame_iterator.py | 6 +++--- .../chaiNNer_standard/image/io/view_image_external.py | 2 +- .../image_adjustment/adjustments/hue_and_saturation.py | 2 +- .../adjustments/{invert.py => invert_color.py} | 2 +- .../image_adjustment/adjustments/threshold_adaptive.py | 2 +- .../image_channel/all/{rgba_merge.py => merge_channels.py} | 2 +- .../all/{rgba_separate.py => separate_rgba.py} | 2 +- .../{transparency_merge.py => merge_transparency.py} | 0 .../{transparency_split.py => split_transparency.py} | 2 +- .../chaiNNer_standard/image_dimension/crop/crop_border.py | 2 +- .../chaiNNer_standard/image_dimension/crop/crop_edges.py | 2 +- .../image_filter/blur/{gauss_blur.py => gaussian_blur.py} | 0 .../chaiNNer_standard/image_filter/blur/surface_blur.py | 2 +- .../correction/{avg_color_fix.py => average_color_fix.py} | 0 .../image_filter/miscellaneous/convolve.py | 2 +- .../image_filter/miscellaneous/high_pass.py | 2 +- .../noise/{fast_nlmeans.py => fast_nl_means.py} | 2 +- .../image_filter/quantize/dither_palette.py | 2 +- .../sharpen/{high_boost_sharpen.py => high_boost_filter.py} | 2 +- .../image_filter/sharpen/{sharpen.py => unsharp_mask.py} | 2 +- .../compositing/{caption.py => add_caption.py} | 2 +- .../image_utility/compositing/{blend.py => blend_images.py} | 2 +- .../image_utility/compositing/{stack.py => stack_images.py} | 2 +- .../compositing/{z_stack.py => z_stack_images.py} | 2 +- .../image_utility/miscellaneous/{lut.py => apply_lut.py} | 2 +- .../{convert_color.py => change_colorspace.py} | 2 +- .../image_utility/miscellaneous/generate_hash.py | 2 +- .../miscellaneous/{metrics.py => image_metrics.py} | 0 .../miscellaneous/{image_stat.py => image_statistics.py} | 2 +- .../{palette_extraction.py => palette_from_image.py} | 0 .../normal_map/{normal_addition.py => add_normals.py} | 2 +- .../normal_map/{normal_convert.py => convert_normals.py} | 2 +- .../{normal_generator.py => normal_map_generator.py} | 0 .../packages/chaiNNer_standard/utility/color/color_from.py | 2 +- .../utility/math/{math_node.py => math.py} | 0 .../chaiNNer_standard/utility/text/regex_replace.py | 2 +- .../utility/text/{text_pad.py => text_padding.py} | 0 .../packages/chaiNNer_standard/utility/text/text_replace.py | 2 +- .../src/packages/chaiNNer_standard/utility/value/number.py | 2 +- .../src/packages/chaiNNer_standard/utility/value/text.py | 2 +- 50 files changed, 51 insertions(+), 51 deletions(-) rename backend/src/packages/chaiNNer_ncnn/ncnn/utility/{get_scale.py => get_model_scale.py} (89%) rename backend/src/packages/chaiNNer_onnx/onnx/processing/{rembg.py => remove_background.py} (98%) rename backend/src/packages/chaiNNer_pytorch/pytorch/utility/{get_scale.py => get_model_scale.py} (90%) rename backend/src/packages/chaiNNer_standard/image/batch_processing/{paired_image_file_iterator.py => image_pairs_iterator.py} (98%) rename backend/src/packages/chaiNNer_standard/image/batch_processing/{sprite_sheet_iterator.py => spritesheet_iterator.py} (97%) rename backend/src/packages/chaiNNer_standard/image_adjustment/adjustments/{invert.py => invert_color.py} (92%) rename backend/src/packages/chaiNNer_standard/image_channel/all/{rgba_merge.py => merge_channels.py} (98%) rename backend/src/packages/chaiNNer_standard/image_channel/all/{rgba_separate.py => separate_rgba.py} (98%) rename backend/src/packages/chaiNNer_standard/image_channel/transparency/{transparency_merge.py => merge_transparency.py} (100%) rename backend/src/packages/chaiNNer_standard/image_channel/transparency/{transparency_split.py => split_transparency.py} (93%) rename backend/src/packages/chaiNNer_standard/image_filter/blur/{gauss_blur.py => gaussian_blur.py} (100%) rename backend/src/packages/chaiNNer_standard/image_filter/correction/{avg_color_fix.py => average_color_fix.py} (100%) rename backend/src/packages/chaiNNer_standard/image_filter/noise/{fast_nlmeans.py => fast_nl_means.py} (98%) rename backend/src/packages/chaiNNer_standard/image_filter/sharpen/{high_boost_sharpen.py => high_boost_filter.py} (99%) rename backend/src/packages/chaiNNer_standard/image_filter/sharpen/{sharpen.py => unsharp_mask.py} (98%) rename backend/src/packages/chaiNNer_standard/image_utility/compositing/{caption.py => add_caption.py} (98%) rename backend/src/packages/chaiNNer_standard/image_utility/compositing/{blend.py => blend_images.py} (99%) rename backend/src/packages/chaiNNer_standard/image_utility/compositing/{stack.py => stack_images.py} (99%) rename backend/src/packages/chaiNNer_standard/image_utility/compositing/{z_stack.py => z_stack_images.py} (99%) rename backend/src/packages/chaiNNer_standard/image_utility/miscellaneous/{lut.py => apply_lut.py} (98%) rename backend/src/packages/chaiNNer_standard/image_utility/miscellaneous/{convert_color.py => change_colorspace.py} (98%) rename backend/src/packages/chaiNNer_standard/image_utility/miscellaneous/{metrics.py => image_metrics.py} (100%) rename backend/src/packages/chaiNNer_standard/image_utility/miscellaneous/{image_stat.py => image_statistics.py} (98%) rename backend/src/packages/chaiNNer_standard/image_utility/miscellaneous/{palette_extraction.py => palette_from_image.py} (100%) rename backend/src/packages/chaiNNer_standard/material_textures/normal_map/{normal_addition.py => add_normals.py} (98%) rename backend/src/packages/chaiNNer_standard/material_textures/normal_map/{normal_convert.py => convert_normals.py} (98%) rename backend/src/packages/chaiNNer_standard/material_textures/normal_map/{normal_generator.py => normal_map_generator.py} (100%) rename backend/src/packages/chaiNNer_standard/utility/math/{math_node.py => math.py} (100%) rename backend/src/packages/chaiNNer_standard/utility/text/{text_pad.py => text_padding.py} (100%) diff --git a/backend/src/packages/chaiNNer_ncnn/ncnn/batch_processing/model_file_iterator.py b/backend/src/packages/chaiNNer_ncnn/ncnn/batch_processing/model_file_iterator.py index 0207ae42c..7ceb32acf 100644 --- a/backend/src/packages/chaiNNer_ncnn/ncnn/batch_processing/model_file_iterator.py +++ b/backend/src/packages/chaiNNer_ncnn/ncnn/batch_processing/model_file_iterator.py @@ -40,7 +40,7 @@ node_type="iteratorHelper", side_effects=True, ) -def ModelFileIteratorLoadModelNode( +def iterator_helper_load_model_node( param_path: str, bin_path: str, root_dir: str, index: int ) -> Tuple[NcnnModelWrapper, str, str, str, int]: model, _, model_name = load_model_node(param_path, bin_path) @@ -71,7 +71,7 @@ def ModelFileIteratorLoadModelNode( node_type="iterator", side_effects=True, ) -async def ModelFileIteratorNode(directory: str, context: IteratorContext) -> None: +async def model_file_iterator_node(directory: str, context: IteratorContext) -> None: logger.debug(f"Iterating over models in directory: {directory}") model_path_node_id = context.get_helper(NCNN_ITERATOR_NODE_ID).id diff --git a/backend/src/packages/chaiNNer_ncnn/ncnn/utility/get_scale.py b/backend/src/packages/chaiNNer_ncnn/ncnn/utility/get_model_scale.py similarity index 89% rename from backend/src/packages/chaiNNer_ncnn/ncnn/utility/get_scale.py rename to backend/src/packages/chaiNNer_ncnn/ncnn/utility/get_model_scale.py index 35829c2c8..5c04c29f4 100644 --- a/backend/src/packages/chaiNNer_ncnn/ncnn/utility/get_scale.py +++ b/backend/src/packages/chaiNNer_ncnn/ncnn/utility/get_model_scale.py @@ -15,5 +15,5 @@ inputs=[NcnnModelInput()], outputs=[NumberOutput("Scale", output_type="Input0.scale")], ) -def model_dim_node(model: NcnnModelWrapper) -> int: +def get_model_scale_node(model: NcnnModelWrapper) -> int: return model.scale diff --git a/backend/src/packages/chaiNNer_onnx/onnx/batch_processing/model_file_iterator.py b/backend/src/packages/chaiNNer_onnx/onnx/batch_processing/model_file_iterator.py index 03d55e7d0..7fff0eba4 100644 --- a/backend/src/packages/chaiNNer_onnx/onnx/batch_processing/model_file_iterator.py +++ b/backend/src/packages/chaiNNer_onnx/onnx/batch_processing/model_file_iterator.py @@ -40,7 +40,7 @@ node_type="iteratorHelper", side_effects=True, ) -def ModelFileIteratorLoadModelNode( +def iterator_helper_load_model_node( path: str, root_dir: str, index: int ) -> Tuple[OnnxModel, str, str, str, int]: model, dirname, basename = load_model_node(path) @@ -69,7 +69,7 @@ def ModelFileIteratorLoadModelNode( node_type="iterator", side_effects=True, ) -async def ModelFileIteratorNode(directory: str, context: IteratorContext) -> None: +async def model_file_iterator_node(directory: str, context: IteratorContext) -> None: logger.debug(f"Iterating over models in directory: {directory}") model_path_node_id = context.get_helper(ONNX_ITERATOR_NODE_ID).id diff --git a/backend/src/packages/chaiNNer_onnx/onnx/processing/rembg.py b/backend/src/packages/chaiNNer_onnx/onnx/processing/remove_background.py similarity index 98% rename from backend/src/packages/chaiNNer_onnx/onnx/processing/rembg.py rename to backend/src/packages/chaiNNer_onnx/onnx/processing/remove_background.py index c66bc7223..9380a0a72 100644 --- a/backend/src/packages/chaiNNer_onnx/onnx/processing/rembg.py +++ b/backend/src/packages/chaiNNer_onnx/onnx/processing/remove_background.py @@ -43,7 +43,7 @@ ImageOutput("Mask", image_type=navi.Image(size_as="Input0"), channels=1), ], ) -def rembg_node( +def remove_background_node( img: np.ndarray, model: OnnxRemBg, post_process_mask: bool, diff --git a/backend/src/packages/chaiNNer_pytorch/pytorch/iteration/model_file_iterator.py b/backend/src/packages/chaiNNer_pytorch/pytorch/iteration/model_file_iterator.py index 5a6c65193..eb1da48e2 100644 --- a/backend/src/packages/chaiNNer_pytorch/pytorch/iteration/model_file_iterator.py +++ b/backend/src/packages/chaiNNer_pytorch/pytorch/iteration/model_file_iterator.py @@ -40,7 +40,7 @@ node_type="iteratorHelper", side_effects=True, ) -def ModelFileIteratorLoadModelNode( +def iterator_helper_load_model_node( path: str, root_dir: str, index: int ) -> Tuple[PyTorchModel, str, str, str, int]: model, dirname, basename = load_model_node(path) @@ -69,7 +69,7 @@ def ModelFileIteratorLoadModelNode( node_type="iterator", side_effects=True, ) -async def ModelFileIteratorNode(directory: str, context: IteratorContext) -> None: +async def model_file_iterator_node(directory: str, context: IteratorContext) -> None: logger.debug(f"Iterating over models in directory: {directory}") model_path_node_id = context.get_helper(PYTORCH_ITERATOR_NODE_ID).id diff --git a/backend/src/packages/chaiNNer_pytorch/pytorch/restoration/upscale_face.py b/backend/src/packages/chaiNNer_pytorch/pytorch/restoration/upscale_face.py index 2525b6397..dc5a14f0e 100644 --- a/backend/src/packages/chaiNNer_pytorch/pytorch/restoration/upscale_face.py +++ b/backend/src/packages/chaiNNer_pytorch/pytorch/restoration/upscale_face.py @@ -147,7 +147,7 @@ def upscale( ) ], ) -def face_upscale_node( +def upscale_face_node( img: np.ndarray, face_model: PyTorchFaceModel, background_img: Union[np.ndarray, None], diff --git a/backend/src/packages/chaiNNer_pytorch/pytorch/utility/get_scale.py b/backend/src/packages/chaiNNer_pytorch/pytorch/utility/get_model_scale.py similarity index 90% rename from backend/src/packages/chaiNNer_pytorch/pytorch/utility/get_scale.py rename to backend/src/packages/chaiNNer_pytorch/pytorch/utility/get_model_scale.py index 5ade2095a..6c6d5bd3f 100644 --- a/backend/src/packages/chaiNNer_pytorch/pytorch/utility/get_scale.py +++ b/backend/src/packages/chaiNNer_pytorch/pytorch/utility/get_model_scale.py @@ -15,5 +15,5 @@ inputs=[ModelInput()], outputs=[NumberOutput("Scale", output_type="Input0.scale")], ) -def model_dim_node(model: PyTorchModel) -> int: +def get_model_scale_node(model: PyTorchModel) -> int: return model.scale diff --git a/backend/src/packages/chaiNNer_standard/image/batch_processing/image_file_iterator.py b/backend/src/packages/chaiNNer_standard/image/batch_processing/image_file_iterator.py index f6f2411ce..cc8a9bbd0 100644 --- a/backend/src/packages/chaiNNer_standard/image/batch_processing/image_file_iterator.py +++ b/backend/src/packages/chaiNNer_standard/image/batch_processing/image_file_iterator.py @@ -62,7 +62,7 @@ def list_glob(directory: str, globexpr: str, ext_filter: List[str]) -> List[str] ], side_effects=True, ) -def ImageFileIteratorLoadImageNode( +def iterator_helper_load_image_node( path: str, root_dir: str, index: int ) -> Tuple[np.ndarray, str, str, str, int]: img, img_dir, basename = load_image_node(path) @@ -106,7 +106,7 @@ def ImageFileIteratorLoadImageNode( "chainner:image:load", ], ) -async def ImageFileIteratorNode( +async def image_file_iterator_node( directory: str, use_glob: bool, is_recursive: bool, diff --git a/backend/src/packages/chaiNNer_standard/image/batch_processing/paired_image_file_iterator.py b/backend/src/packages/chaiNNer_standard/image/batch_processing/image_pairs_iterator.py similarity index 98% rename from backend/src/packages/chaiNNer_standard/image/batch_processing/paired_image_file_iterator.py rename to backend/src/packages/chaiNNer_standard/image/batch_processing/image_pairs_iterator.py index 260fb4280..afab28f4a 100644 --- a/backend/src/packages/chaiNNer_standard/image/batch_processing/paired_image_file_iterator.py +++ b/backend/src/packages/chaiNNer_standard/image/batch_processing/image_pairs_iterator.py @@ -45,7 +45,7 @@ ], side_effects=True, ) -def ImageFileIteratorLoadImageNodeA( +def iterator_helper_load_image_node( path_a: str, path_b: str, root_dir_a: str, root_dir_b: str, index: int ) -> Tuple[np.ndarray, np.ndarray, str, str, str, str, str, str, int]: img_a, img_dir_a, basename_a = load_image_node(path_a) @@ -90,7 +90,7 @@ def ImageFileIteratorLoadImageNodeA( "chainner:image:file_iterator", ], ) -async def PairedImageFileIteratorNode( +async def image_pairs_iterator_node( directory_a: str, directory_b: str, context: IteratorContext ) -> None: logger.debug(f"Iterating over images in directories: {directory_a}, {directory_b}") diff --git a/backend/src/packages/chaiNNer_standard/image/batch_processing/sprite_sheet_iterator.py b/backend/src/packages/chaiNNer_standard/image/batch_processing/spritesheet_iterator.py similarity index 97% rename from backend/src/packages/chaiNNer_standard/image/batch_processing/sprite_sheet_iterator.py rename to backend/src/packages/chaiNNer_standard/image/batch_processing/spritesheet_iterator.py index 45827f7f1..0602c5e70 100644 --- a/backend/src/packages/chaiNNer_standard/image/batch_processing/sprite_sheet_iterator.py +++ b/backend/src/packages/chaiNNer_standard/image/batch_processing/spritesheet_iterator.py @@ -30,7 +30,7 @@ ], side_effects=True, ) -def ImageSpriteSheetIteratorLoadImageNode( +def iterator_helper_load_image_node( img: np.ndarray, index: int ) -> Tuple[np.ndarray, int]: return img, index @@ -46,7 +46,7 @@ def ImageSpriteSheetIteratorLoadImageNode( outputs=[], side_effects=True, ) -def ImageSpriteSheetIteratorAppendImageNode( +def iterator_helper_append_image_node( img: np.ndarray, results: List[np.ndarray] ) -> None: results.append(img) @@ -92,7 +92,7 @@ def ImageSpriteSheetIteratorAppendImageNode( ], side_effects=True, ) -async def ImageSpriteSheetIteratorNode( +async def spritesheet_iterator_node( sprite_sheet: np.ndarray, rows: int, columns: int, diff --git a/backend/src/packages/chaiNNer_standard/image/batch_processing/video_frame_iterator.py b/backend/src/packages/chaiNNer_standard/image/batch_processing/video_frame_iterator.py index ea5fabefd..eeb2817cb 100644 --- a/backend/src/packages/chaiNNer_standard/image/batch_processing/video_frame_iterator.py +++ b/backend/src/packages/chaiNNer_standard/image/batch_processing/video_frame_iterator.py @@ -73,7 +73,7 @@ class Writer: ], side_effects=True, ) -def VideoFrameIteratorFrameLoaderNode( +def iterator_helper_load_frame_as_image_node( img: np.ndarray, idx: int, video_dir: str, video_name: str ) -> Tuple[np.ndarray, int, str, str]: return img, idx, video_dir, video_name @@ -113,7 +113,7 @@ def VideoFrameIteratorFrameLoaderNode( outputs=[], side_effects=True, ) -def VideoFrameIteratorFrameWriterNode( +def iterator_helper_write_output_frame_node( img: np.ndarray, save_dir: str, video_name: str, @@ -198,7 +198,7 @@ def VideoFrameIteratorFrameWriterNode( ], side_effects=True, ) -async def SimpleVideoFrameIteratorNode(path: str, context: IteratorContext) -> None: +async def video_frame_iterator_node(path: str, context: IteratorContext) -> None: logger.debug(f"{ffmpeg_path=}, {ffprobe_path=}") logger.debug(f"Iterating over frames in video file: {path}") diff --git a/backend/src/packages/chaiNNer_standard/image/io/view_image_external.py b/backend/src/packages/chaiNNer_standard/image/io/view_image_external.py index 12abaa5ae..93d37b6ee 100644 --- a/backend/src/packages/chaiNNer_standard/image/io/view_image_external.py +++ b/backend/src/packages/chaiNNer_standard/image/io/view_image_external.py @@ -25,7 +25,7 @@ outputs=[], side_effects=True, ) -def open_image_node(img: np.ndarray) -> None: +def view_image_external_node(img: np.ndarray) -> None: tempdir = mkdtemp(prefix="chaiNNer-") logger.debug(f"Writing image to temp path: {tempdir}") im_name = f"{time.time()}.png" diff --git a/backend/src/packages/chaiNNer_standard/image_adjustment/adjustments/hue_and_saturation.py b/backend/src/packages/chaiNNer_standard/image_adjustment/adjustments/hue_and_saturation.py index ca1a04606..2f0d94572 100644 --- a/backend/src/packages/chaiNNer_standard/image_adjustment/adjustments/hue_and_saturation.py +++ b/backend/src/packages/chaiNNer_standard/image_adjustment/adjustments/hue_and_saturation.py @@ -65,7 +65,7 @@ def with_lightness(img: np.ndarray, lightness: float) -> np.ndarray: ], outputs=[ImageOutput(image_type="Input0")], ) -def hue_and_sat( +def hue_and_saturation_node( img: np.ndarray, hue: float, saturation: float, diff --git a/backend/src/packages/chaiNNer_standard/image_adjustment/adjustments/invert.py b/backend/src/packages/chaiNNer_standard/image_adjustment/adjustments/invert_color.py similarity index 92% rename from backend/src/packages/chaiNNer_standard/image_adjustment/adjustments/invert.py rename to backend/src/packages/chaiNNer_standard/image_adjustment/adjustments/invert_color.py index b4c17baf2..c12025f16 100644 --- a/backend/src/packages/chaiNNer_standard/image_adjustment/adjustments/invert.py +++ b/backend/src/packages/chaiNNer_standard/image_adjustment/adjustments/invert_color.py @@ -17,7 +17,7 @@ inputs=[ImageInput()], outputs=[ImageOutput(image_type="Input0", assume_normalized=True)], ) -def invert_node(img: np.ndarray) -> np.ndarray: +def invert_color_node(img: np.ndarray) -> np.ndarray: c = get_h_w_c(img)[2] # invert the first 3 channels diff --git a/backend/src/packages/chaiNNer_standard/image_adjustment/adjustments/threshold_adaptive.py b/backend/src/packages/chaiNNer_standard/image_adjustment/adjustments/threshold_adaptive.py index 7254857fe..8e35e8d58 100644 --- a/backend/src/packages/chaiNNer_standard/image_adjustment/adjustments/threshold_adaptive.py +++ b/backend/src/packages/chaiNNer_standard/image_adjustment/adjustments/threshold_adaptive.py @@ -37,7 +37,7 @@ ], outputs=[ImageOutput(image_type="Input0")], ) -def adaptive_threshold_node( +def threshold_adaptive_node( img: np.ndarray, maxval: float, adaptive_method: int, diff --git a/backend/src/packages/chaiNNer_standard/image_channel/all/rgba_merge.py b/backend/src/packages/chaiNNer_standard/image_channel/all/merge_channels.py similarity index 98% rename from backend/src/packages/chaiNNer_standard/image_channel/all/rgba_merge.py rename to backend/src/packages/chaiNNer_standard/image_channel/all/merge_channels.py index d86a0e9f0..a027e1535 100644 --- a/backend/src/packages/chaiNNer_standard/image_channel/all/rgba_merge.py +++ b/backend/src/packages/chaiNNer_standard/image_channel/all/merge_channels.py @@ -48,7 +48,7 @@ ], deprecated=True, ) -def merge_rgba_node( +def merge_channels_node( im1: np.ndarray, im2: Union[np.ndarray, None], im3: Union[np.ndarray, None], diff --git a/backend/src/packages/chaiNNer_standard/image_channel/all/rgba_separate.py b/backend/src/packages/chaiNNer_standard/image_channel/all/separate_rgba.py similarity index 98% rename from backend/src/packages/chaiNNer_standard/image_channel/all/rgba_separate.py rename to backend/src/packages/chaiNNer_standard/image_channel/all/separate_rgba.py index 1d09c85e4..e50fd8770 100644 --- a/backend/src/packages/chaiNNer_standard/image_channel/all/rgba_separate.py +++ b/backend/src/packages/chaiNNer_standard/image_channel/all/separate_rgba.py @@ -48,7 +48,7 @@ ), ], ) -def separate_rgba( +def separate_rgba_node( img: np.ndarray, ) -> Tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray]: h, w, c = get_h_w_c(img) diff --git a/backend/src/packages/chaiNNer_standard/image_channel/transparency/transparency_merge.py b/backend/src/packages/chaiNNer_standard/image_channel/transparency/merge_transparency.py similarity index 100% rename from backend/src/packages/chaiNNer_standard/image_channel/transparency/transparency_merge.py rename to backend/src/packages/chaiNNer_standard/image_channel/transparency/merge_transparency.py diff --git a/backend/src/packages/chaiNNer_standard/image_channel/transparency/transparency_split.py b/backend/src/packages/chaiNNer_standard/image_channel/transparency/split_transparency.py similarity index 93% rename from backend/src/packages/chaiNNer_standard/image_channel/transparency/transparency_split.py rename to backend/src/packages/chaiNNer_standard/image_channel/transparency/split_transparency.py index 4598a9cc3..a1fc028fe 100644 --- a/backend/src/packages/chaiNNer_standard/image_channel/transparency/transparency_split.py +++ b/backend/src/packages/chaiNNer_standard/image_channel/transparency/split_transparency.py @@ -33,7 +33,7 @@ ), ], ) -def split_transparency(img: np.ndarray) -> Tuple[np.ndarray, np.ndarray]: +def split_transparency_node(img: np.ndarray) -> Tuple[np.ndarray, np.ndarray]: """Split a multi-channel image into separate channels""" img = as_target_channels(img, 4) diff --git a/backend/src/packages/chaiNNer_standard/image_dimension/crop/crop_border.py b/backend/src/packages/chaiNNer_standard/image_dimension/crop/crop_border.py index 442437901..bde926e5a 100644 --- a/backend/src/packages/chaiNNer_standard/image_dimension/crop/crop_border.py +++ b/backend/src/packages/chaiNNer_standard/image_dimension/crop/crop_border.py @@ -34,7 +34,7 @@ ) ], ) -def border_crop_node(img: np.ndarray, amount: int) -> np.ndarray: +def crop_border_node(img: np.ndarray, amount: int) -> np.ndarray: h, w, _ = get_h_w_c(img) assert 2 * amount < h, "Cropped area would result in an image with no height" diff --git a/backend/src/packages/chaiNNer_standard/image_dimension/crop/crop_edges.py b/backend/src/packages/chaiNNer_standard/image_dimension/crop/crop_edges.py index 4b24837c4..efc1ac7cb 100644 --- a/backend/src/packages/chaiNNer_standard/image_dimension/crop/crop_edges.py +++ b/backend/src/packages/chaiNNer_standard/image_dimension/crop/crop_edges.py @@ -35,7 +35,7 @@ ) ], ) -def edge_crop_node( +def crop_edges_node( img: np.ndarray, top: int, left: int, right: int, bottom: int ) -> np.ndarray: h, w, _ = get_h_w_c(img) diff --git a/backend/src/packages/chaiNNer_standard/image_filter/blur/gauss_blur.py b/backend/src/packages/chaiNNer_standard/image_filter/blur/gaussian_blur.py similarity index 100% rename from backend/src/packages/chaiNNer_standard/image_filter/blur/gauss_blur.py rename to backend/src/packages/chaiNNer_standard/image_filter/blur/gaussian_blur.py diff --git a/backend/src/packages/chaiNNer_standard/image_filter/blur/surface_blur.py b/backend/src/packages/chaiNNer_standard/image_filter/blur/surface_blur.py index 60ebf1c7d..0d3c942e8 100644 --- a/backend/src/packages/chaiNNer_standard/image_filter/blur/surface_blur.py +++ b/backend/src/packages/chaiNNer_standard/image_filter/blur/surface_blur.py @@ -37,7 +37,7 @@ ], outputs=[ImageOutput(image_type="Input0")], ) -def bilateral_blur_node( +def surface_blur_node( img: np.ndarray, diameter: int, sigma_color: int, diff --git a/backend/src/packages/chaiNNer_standard/image_filter/correction/avg_color_fix.py b/backend/src/packages/chaiNNer_standard/image_filter/correction/average_color_fix.py similarity index 100% rename from backend/src/packages/chaiNNer_standard/image_filter/correction/avg_color_fix.py rename to backend/src/packages/chaiNNer_standard/image_filter/correction/average_color_fix.py diff --git a/backend/src/packages/chaiNNer_standard/image_filter/miscellaneous/convolve.py b/backend/src/packages/chaiNNer_standard/image_filter/miscellaneous/convolve.py index e3498fdfa..3266f2420 100644 --- a/backend/src/packages/chaiNNer_standard/image_filter/miscellaneous/convolve.py +++ b/backend/src/packages/chaiNNer_standard/image_filter/miscellaneous/convolve.py @@ -37,7 +37,7 @@ ) ], ) -def image_convolve_node( +def convolve_node( img: np.ndarray, kernel_in: str, padding: int, diff --git a/backend/src/packages/chaiNNer_standard/image_filter/miscellaneous/high_pass.py b/backend/src/packages/chaiNNer_standard/image_filter/miscellaneous/high_pass.py index d0515e290..eaee38806 100644 --- a/backend/src/packages/chaiNNer_standard/image_filter/miscellaneous/high_pass.py +++ b/backend/src/packages/chaiNNer_standard/image_filter/miscellaneous/high_pass.py @@ -33,7 +33,7 @@ ], outputs=[ImageOutput(image_type="Input0")], ) -def high_pass_filter_node( +def high_pass_node( img: np.ndarray, radius: float, contrast: float, diff --git a/backend/src/packages/chaiNNer_standard/image_filter/noise/fast_nlmeans.py b/backend/src/packages/chaiNNer_standard/image_filter/noise/fast_nl_means.py similarity index 98% rename from backend/src/packages/chaiNNer_standard/image_filter/noise/fast_nlmeans.py rename to backend/src/packages/chaiNNer_standard/image_filter/noise/fast_nl_means.py index 77062e154..16e9b6458 100644 --- a/backend/src/packages/chaiNNer_standard/image_filter/noise/fast_nlmeans.py +++ b/backend/src/packages/chaiNNer_standard/image_filter/noise/fast_nl_means.py @@ -44,7 +44,7 @@ ], outputs=[ImageOutput(image_type="Input0")], ) -def fast_nlmeans_node( +def fast_nl_means_node( img: np.ndarray, h: float, h_color: float, diff --git a/backend/src/packages/chaiNNer_standard/image_filter/quantize/dither_palette.py b/backend/src/packages/chaiNNer_standard/image_filter/quantize/dither_palette.py index 0328cc144..8f473bec1 100644 --- a/backend/src/packages/chaiNNer_standard/image_filter/quantize/dither_palette.py +++ b/backend/src/packages/chaiNNer_standard/image_filter/quantize/dither_palette.py @@ -63,7 +63,7 @@ class PaletteDitherAlgorithm(Enum): ], outputs=[ImageOutput(image_type="Input0")], ) -def palette_dither_node( +def dither_palette_node( img: np.ndarray, palette: np.ndarray, dither_algorithm: PaletteDitherAlgorithm, diff --git a/backend/src/packages/chaiNNer_standard/image_filter/sharpen/high_boost_sharpen.py b/backend/src/packages/chaiNNer_standard/image_filter/sharpen/high_boost_filter.py similarity index 99% rename from backend/src/packages/chaiNNer_standard/image_filter/sharpen/high_boost_sharpen.py rename to backend/src/packages/chaiNNer_standard/image_filter/sharpen/high_boost_filter.py index 68e8981c6..807a7a979 100644 --- a/backend/src/packages/chaiNNer_standard/image_filter/sharpen/high_boost_sharpen.py +++ b/backend/src/packages/chaiNNer_standard/image_filter/sharpen/high_boost_filter.py @@ -59,7 +59,7 @@ class KernelType(Enum): ], outputs=[ImageOutput(image_type="Input0")], ) -def sharpen_hbf_node( +def high_boost_filter_node( img: np.ndarray, kernel_type: KernelType, amount: float, diff --git a/backend/src/packages/chaiNNer_standard/image_filter/sharpen/sharpen.py b/backend/src/packages/chaiNNer_standard/image_filter/sharpen/unsharp_mask.py similarity index 98% rename from backend/src/packages/chaiNNer_standard/image_filter/sharpen/sharpen.py rename to backend/src/packages/chaiNNer_standard/image_filter/sharpen/unsharp_mask.py index 2f08c0a8d..9718c6cfd 100644 --- a/backend/src/packages/chaiNNer_standard/image_filter/sharpen/sharpen.py +++ b/backend/src/packages/chaiNNer_standard/image_filter/sharpen/unsharp_mask.py @@ -39,7 +39,7 @@ ], outputs=[ImageOutput(image_type="Input0")], ) -def sharpen_node( +def unsharp_mask_node( img: np.ndarray, radius: float, amount: float, diff --git a/backend/src/packages/chaiNNer_standard/image_utility/compositing/caption.py b/backend/src/packages/chaiNNer_standard/image_utility/compositing/add_caption.py similarity index 98% rename from backend/src/packages/chaiNNer_standard/image_utility/compositing/caption.py rename to backend/src/packages/chaiNNer_standard/image_utility/compositing/add_caption.py index 4709f505c..51989dcb4 100644 --- a/backend/src/packages/chaiNNer_standard/image_utility/compositing/caption.py +++ b/backend/src/packages/chaiNNer_standard/image_utility/compositing/add_caption.py @@ -35,7 +35,7 @@ ) ], ) -def caption_node( +def add_caption_node( img: np.ndarray, caption: str, size: int, position: CaptionPosition ) -> np.ndarray: """Add caption an image""" diff --git a/backend/src/packages/chaiNNer_standard/image_utility/compositing/blend.py b/backend/src/packages/chaiNNer_standard/image_utility/compositing/blend_images.py similarity index 99% rename from backend/src/packages/chaiNNer_standard/image_utility/compositing/blend.py rename to backend/src/packages/chaiNNer_standard/image_utility/compositing/blend_images.py index 5ae1cbff1..d6b659905 100644 --- a/backend/src/packages/chaiNNer_standard/image_utility/compositing/blend.py +++ b/backend/src/packages/chaiNNer_standard/image_utility/compositing/blend_images.py @@ -40,7 +40,7 @@ def getHeight(i: any) = match i { Image => i.height, _ => -inf }; ).with_never_reason("At least one layer must be an image"), ], ) -def blend_node( +def blend_images_node( base: np.ndarray | Color, ov: np.ndarray | Color, blend_mode: BlendMode, diff --git a/backend/src/packages/chaiNNer_standard/image_utility/compositing/stack.py b/backend/src/packages/chaiNNer_standard/image_utility/compositing/stack_images.py similarity index 99% rename from backend/src/packages/chaiNNer_standard/image_utility/compositing/stack.py rename to backend/src/packages/chaiNNer_standard/image_utility/compositing/stack_images.py index 6a5aa230f..aaae4ba2c 100644 --- a/backend/src/packages/chaiNNer_standard/image_utility/compositing/stack.py +++ b/backend/src/packages/chaiNNer_standard/image_utility/compositing/stack_images.py @@ -77,7 +77,7 @@ def getAdjustedHeight(img: Image | null) { ) ], ) -def stack_node( +def stack_images_node( im1: np.ndarray, im2: np.ndarray | None, im3: np.ndarray | None, diff --git a/backend/src/packages/chaiNNer_standard/image_utility/compositing/z_stack.py b/backend/src/packages/chaiNNer_standard/image_utility/compositing/z_stack_images.py similarity index 99% rename from backend/src/packages/chaiNNer_standard/image_utility/compositing/z_stack.py rename to backend/src/packages/chaiNNer_standard/image_utility/compositing/z_stack_images.py index 03b6bef29..2caebbce5 100644 --- a/backend/src/packages/chaiNNer_standard/image_utility/compositing/z_stack.py +++ b/backend/src/packages/chaiNNer_standard/image_utility/compositing/z_stack_images.py @@ -59,7 +59,7 @@ def conv(i: Image | null) = match i { Image => i, _ => any }; ), ], ) -def z_stack( +def z_stack_images_node( expression: Expression, *inputs: np.ndarray | None, ) -> np.ndarray: diff --git a/backend/src/packages/chaiNNer_standard/image_utility/miscellaneous/lut.py b/backend/src/packages/chaiNNer_standard/image_utility/miscellaneous/apply_lut.py similarity index 98% rename from backend/src/packages/chaiNNer_standard/image_utility/miscellaneous/lut.py rename to backend/src/packages/chaiNNer_standard/image_utility/miscellaneous/apply_lut.py index aa2e85659..65af1822a 100644 --- a/backend/src/packages/chaiNNer_standard/image_utility/miscellaneous/lut.py +++ b/backend/src/packages/chaiNNer_standard/image_utility/miscellaneous/apply_lut.py @@ -47,7 +47,7 @@ def quantize(img: np.ndarray, levels: int) -> np.ndarray: ImageOutput(image_type=navi.Image(size_as="Input0", channels_as="Input1")) ], ) -def lut_node( +def apply_lut_node( img: np.ndarray, lut: np.ndarray, ) -> np.ndarray: diff --git a/backend/src/packages/chaiNNer_standard/image_utility/miscellaneous/convert_color.py b/backend/src/packages/chaiNNer_standard/image_utility/miscellaneous/change_colorspace.py similarity index 98% rename from backend/src/packages/chaiNNer_standard/image_utility/miscellaneous/convert_color.py rename to backend/src/packages/chaiNNer_standard/image_utility/miscellaneous/change_colorspace.py index fd897b614..1995acead 100644 --- a/backend/src/packages/chaiNNer_standard/image_utility/miscellaneous/convert_color.py +++ b/backend/src/packages/chaiNNer_standard/image_utility/miscellaneous/change_colorspace.py @@ -60,7 +60,7 @@ ) ], ) -def convert_color_node( +def change_colorspace_node( img: np.ndarray, input_: int, output: int, alpha: bool ) -> np.ndarray: """Takes an image and changes the color mode it""" diff --git a/backend/src/packages/chaiNNer_standard/image_utility/miscellaneous/generate_hash.py b/backend/src/packages/chaiNNer_standard/image_utility/miscellaneous/generate_hash.py index 68166ae99..69d2cb29a 100644 --- a/backend/src/packages/chaiNNer_standard/image_utility/miscellaneous/generate_hash.py +++ b/backend/src/packages/chaiNNer_standard/image_utility/miscellaneous/generate_hash.py @@ -34,7 +34,7 @@ TextOutput("Base64"), ], ) -def run(img: np.ndarray, size: int) -> Tuple[str, str]: +def generate_hash_node(img: np.ndarray, size: int) -> Tuple[str, str]: """Generate a hash from the input image. The digest size determines the length of the hash that is output.""" img = np.ascontiguousarray(to_uint8(img)) h = hashlib.blake2b(img, digest_size=size) # type: ignore diff --git a/backend/src/packages/chaiNNer_standard/image_utility/miscellaneous/metrics.py b/backend/src/packages/chaiNNer_standard/image_utility/miscellaneous/image_metrics.py similarity index 100% rename from backend/src/packages/chaiNNer_standard/image_utility/miscellaneous/metrics.py rename to backend/src/packages/chaiNNer_standard/image_utility/miscellaneous/image_metrics.py diff --git a/backend/src/packages/chaiNNer_standard/image_utility/miscellaneous/image_stat.py b/backend/src/packages/chaiNNer_standard/image_utility/miscellaneous/image_statistics.py similarity index 98% rename from backend/src/packages/chaiNNer_standard/image_utility/miscellaneous/image_stat.py rename to backend/src/packages/chaiNNer_standard/image_utility/miscellaneous/image_statistics.py index 0041df8ea..0f14a1ca6 100644 --- a/backend/src/packages/chaiNNer_standard/image_utility/miscellaneous/image_stat.py +++ b/backend/src/packages/chaiNNer_standard/image_utility/miscellaneous/image_statistics.py @@ -35,7 +35,7 @@ NumberOutput("Percentile", output_type="0..255"), ], ) -def image_statistic( +def image_statistics_node( img: np.ndarray, percentile: float, ) -> Tuple[float, float, float, float]: diff --git a/backend/src/packages/chaiNNer_standard/image_utility/miscellaneous/palette_extraction.py b/backend/src/packages/chaiNNer_standard/image_utility/miscellaneous/palette_from_image.py similarity index 100% rename from backend/src/packages/chaiNNer_standard/image_utility/miscellaneous/palette_extraction.py rename to backend/src/packages/chaiNNer_standard/image_utility/miscellaneous/palette_from_image.py diff --git a/backend/src/packages/chaiNNer_standard/material_textures/normal_map/normal_addition.py b/backend/src/packages/chaiNNer_standard/material_textures/normal_map/add_normals.py similarity index 98% rename from backend/src/packages/chaiNNer_standard/material_textures/normal_map/normal_addition.py rename to backend/src/packages/chaiNNer_standard/material_textures/normal_map/add_normals.py index d16fc0727..76ee6392d 100644 --- a/backend/src/packages/chaiNNer_standard/material_textures/normal_map/normal_addition.py +++ b/backend/src/packages/chaiNNer_standard/material_textures/normal_map/add_normals.py @@ -42,7 +42,7 @@ ), ], ) -def normal_addition_node( +def add_normals_node( n1: np.ndarray, strength1: int, n2: np.ndarray, diff --git a/backend/src/packages/chaiNNer_standard/material_textures/normal_map/normal_convert.py b/backend/src/packages/chaiNNer_standard/material_textures/normal_map/convert_normals.py similarity index 98% rename from backend/src/packages/chaiNNer_standard/material_textures/normal_map/normal_convert.py rename to backend/src/packages/chaiNNer_standard/material_textures/normal_map/convert_normals.py index 5c1a25c27..03c3cc7fa 100644 --- a/backend/src/packages/chaiNNer_standard/material_textures/normal_map/normal_convert.py +++ b/backend/src/packages/chaiNNer_standard/material_textures/normal_map/convert_normals.py @@ -57,7 +57,7 @@ ), ], ) -def convert_normal_map_node( +def convert_normals_node( img: np.ndarray, from_type: NormalMapType, to_type: NormalMapType, diff --git a/backend/src/packages/chaiNNer_standard/material_textures/normal_map/normal_generator.py b/backend/src/packages/chaiNNer_standard/material_textures/normal_map/normal_map_generator.py similarity index 100% rename from backend/src/packages/chaiNNer_standard/material_textures/normal_map/normal_generator.py rename to backend/src/packages/chaiNNer_standard/material_textures/normal_map/normal_map_generator.py diff --git a/backend/src/packages/chaiNNer_standard/utility/color/color_from.py b/backend/src/packages/chaiNNer_standard/utility/color/color_from.py index 8a9e6c223..31650f16f 100644 --- a/backend/src/packages/chaiNNer_standard/utility/color/color_from.py +++ b/backend/src/packages/chaiNNer_standard/utility/color/color_from.py @@ -97,7 +97,7 @@ class ColorType(Enum): ) ], ) -def color_from( +def color_from_node( color_type: ColorType, gray: float, red: float, diff --git a/backend/src/packages/chaiNNer_standard/utility/math/math_node.py b/backend/src/packages/chaiNNer_standard/utility/math/math.py similarity index 100% rename from backend/src/packages/chaiNNer_standard/utility/math/math_node.py rename to backend/src/packages/chaiNNer_standard/utility/math/math.py diff --git a/backend/src/packages/chaiNNer_standard/utility/text/regex_replace.py b/backend/src/packages/chaiNNer_standard/utility/text/regex_replace.py index a0673b0ef..5c417eb6b 100644 --- a/backend/src/packages/chaiNNer_standard/utility/text/regex_replace.py +++ b/backend/src/packages/chaiNNer_standard/utility/text/regex_replace.py @@ -50,7 +50,7 @@ class ReplacementMode(Enum): ), ], ) -def regex_replace( +def regex_replace_node( text: str, regex_pattern: str, replacement_pattern: str, diff --git a/backend/src/packages/chaiNNer_standard/utility/text/text_pad.py b/backend/src/packages/chaiNNer_standard/utility/text/text_padding.py similarity index 100% rename from backend/src/packages/chaiNNer_standard/utility/text/text_pad.py rename to backend/src/packages/chaiNNer_standard/utility/text/text_padding.py diff --git a/backend/src/packages/chaiNNer_standard/utility/text/text_replace.py b/backend/src/packages/chaiNNer_standard/utility/text/text_replace.py index 231f94862..a4c6d5bd6 100644 --- a/backend/src/packages/chaiNNer_standard/utility/text/text_replace.py +++ b/backend/src/packages/chaiNNer_standard/utility/text/text_replace.py @@ -41,7 +41,7 @@ class ReplacementMode(Enum): ), ], ) -def text_replace(text: str, old: str, new: str, mode: ReplacementMode) -> str: +def text_replace_node(text: str, old: str, new: str, mode: ReplacementMode) -> str: if mode == ReplacementMode.REPLACE_ALL: return text.replace(old, new) else: diff --git a/backend/src/packages/chaiNNer_standard/utility/value/number.py b/backend/src/packages/chaiNNer_standard/utility/value/number.py index 38040f44f..e102e7cc7 100644 --- a/backend/src/packages/chaiNNer_standard/utility/value/number.py +++ b/backend/src/packages/chaiNNer_standard/utility/value/number.py @@ -25,5 +25,5 @@ NumberOutput("Number", output_type="Input0"), ], ) -def number_value_node(number: float) -> float: +def number_node(number: float) -> float: return number diff --git a/backend/src/packages/chaiNNer_standard/utility/value/text.py b/backend/src/packages/chaiNNer_standard/utility/value/text.py index 18cea1508..79bdeed03 100644 --- a/backend/src/packages/chaiNNer_standard/utility/value/text.py +++ b/backend/src/packages/chaiNNer_standard/utility/value/text.py @@ -18,5 +18,5 @@ TextOutput("Text", output_type="Input0"), ], ) -def text_value_node(text: str) -> str: +def text_node(text: str) -> str: return text