Commit Graph
19 Commits
Author SHA1 Message Date
Tasha Upchurch 6062733ff6 Added input validation patch for execution module in __init__.py.
Refined NODE_CLASS_MAPPINGS to include new classes like SelectStrFromDict, Text_ETK, and StringsToList.
Enhanced functionality for string and list operations in basic.py.
Introduced FuncAnysToDict in functional.py for dynamic dictionary generation from multiple inputs.
Removed redundant redefinitions of mappings in audio.py."
2024-09-22 20:03:12 -06:00
Tasha Upchurch d9170f804b New Features: Added nodes for advanced video and audio processing
Key updates:

Added AddFramesToVideoFolder node to add frames to a video folder
Introduced VideoFolderProvider and VideoDefinitionProvider nodes to manage video folders and video definitions
Added FadeToInVideoFolder node for fading between frames in a video folder
Implemented ListedSVDConditioning node for applying SVD conditioning to a list of parameters
Added VideoFolderFFMPEGVideoInterpolate node to interpolate frames in a video folder using FFmpeg
Introduced AudioFolderProvider and AudioDefinitionProvider nodes for managing audio folders and definitions
Added AddAudioToAudioFolder and AddSilenceToAudioFolder nodes for adding audio files and silence to audio folders
Implemented GetAudioFilesLengthsFromAudioFolder node to retrieve lengths of audio files in a folder
Added AudioFolderRenderAudio node to join audio files in an audio folder
Introduced GenerateMusic node for generating music from descriptions using the AudioCraft library
Added XttsNode for text-to-speech conversion using the XTTS library
Implemented AdjustAudioVolumeForFiles node to adjust volume for a list of audio files
The changes also include the addition of LiteLLM nodes for text generation:

Added FuncAnysToText node that runs Python code with multiple input types and outputs a string
Introduced FuncAnysToLatent node for running code that outputs a latent representation
Added FuncAnysToString node for executing code with various inputs and producing a string output
Implemented FuncAnysToList node to run code that takes different input types and returns a list
Added FuncAnysToCond node for running code with multiple inputs and generating a conditioning output

These new nodes expand the capabilities for video and audio processing, allowing more advanced manipulations and generation of video and audio content within the graph.
2024-04-15 13:29:31 -04:00
Tasha Upchurch d2d16cadfe Enhanced PyTorch Functionalities and Server Endpoints; Introduced Torchvision and Hugging Face Diffusers Integration
This commit introduces significant enhancements and new features across multiple files in the project. Major changes include:

1. `pytorch_nodes.py`: Expanded PyTorch node functionalities with additional imports, device compatibility checks, optimizer state updates, and training enhancements. Introduced new methods like `optimizer_to` for transferring optimizer state to a specified device, `reset_optimizer_weights` to clear optimizer states, and `make_image_tensor` for converting outputs to image tensors. Also, improved the training process with device compatibility checks, optimizer updates, and the ability to save and load models during training for efficiency.

2. `server_endpoints.py`: Modified server endpoints for improved git integration and user management. Adjustments include dynamic handling of different git repositories, refined branch and user management in GitIO class, and the integration of user-specific git settings in user management functions.

3. `config.yaml`: Added new configurations for temporary directory and git repositories, providing more flexibility and control over file management and version control integration.

4. `torchvision_nodes.py`: Introduced a new file to integrate torchvision functionalities. It includes classes for transform composition, application of torchvision transforms, and handling of torchvision-specific data structures.

5. `hf_diffusers_nodes.py`: Integrated Hugging Face's diffusers library with new nodes for loading and utilizing DDPMPipelines, handling tensor to image conversions, and managing datasets from the Hugging Face ecosystem.

6. `image.py`, `video.py`, `functional.py`: Refactored and enhanced existing functionalities. Included minor tweaks and bug fixes to improve the overall efficiency and robustness of image and video processing capabilities.

7. `requirements.txt`: Updated dependencies, replacing `fastnoisesimd` with `diffusers` to align with the newly integrated Hugging Face diffusers functionalities.

8. `config.py`: Improved the configuration file loading mechanism with dynamic path handling and the ability to replace placeholders with actual paths, enhancing the flexibility of configuration management.

This comprehensive update significantly enhances the project's capabilities in machine learning, especially in PyTorch and torchvision, and improves server endpoint functionalities for better user and version control management.
2023-12-27 13:22:48 -05:00
Tasha Upchurch f3435c7fc8 git.py:
Imports Repo from the git module.
Removes unused imports such as InvalidGitRepositoryError, os, copy, re, and imports from custom modules.
Removes the check_for_js_extension() function and its related logic, which checked for and copied JavaScript extension files.
image.py:

Modifies the ImageStackAndMatch class:
Updates the input type specifications.
Adds a new function hex_to_rgb to convert hex color codes to RGB tuples.
Adds a new function pad_to_max_size to pad images to a specified size.
Adds a new function resize_image to resize images with interpolation.
Modifies the process_image function to use the new functions for scaling and padding.
Modifies the process_images function to process up to four images, scaling them, and stacking them into a tensor.
functional.py:

Adds a new class FuncAnysToLatent:
This class runs eval on given text with five "any" inputs and outputs a latent value.
Specifies input types for five "any" inputs and the text to evaluate.
Provides a func function that executes the provided code with the inputs and returns the result as a latent value.
basic.py:

Modifies the get_value function:
Adds a check to ensure that LIST is a list type before returning it; otherwise, it returns an error message.
2023-11-28 20:07:32 -05:00
Tasha Upchurch 5df039c107 added a bit of security around the exec calls in the functional nodes.
env GDE_SECURE_MODE can be set to NO_EXEC

to disable execution of code
2023-10-23 17:40:06 -04:00
Tasha Upchurch 35b3ec4f66 Add nodes for flexible typing and conversion to Any
This commit adds several new nodes to enable flexible typing and conversion between types:

- ValueToAny - Converts primitive values like ints, floats, strings, bools to Any type
- IterableToAny - Converts iterable values like lists, dicts to Any
- CallableToAny - Converts callables like functions to Any
- ObjectToAny - Converts tensor objects like images, latents etc to Any

The motivation is to allow passing different types flexibly into functions using Any typing. This enables writing functions in a more generic way by accepting Any instead of specific types.

The nodes convert the input values to Any and return debug info on what was converted. This allows tracing what types entered a function even if the function uses generic Any types.

No breaking changes, new nodes added:
- ValueToAny
- IterableToAny
- CallableToAny
- ObjectToAny

These provide building blocks for more flexible typing, opening up possibilities like:

- Writing utility and processing functions accepting Any instead of specific types
- Calling functions dynamically with values of different types
- Tracing and logging what types passed through a function

Next steps could include AnyToValue nodes, more specialized Any converters, and exploring uses for generic functions.
2023-09-18 17:18:35 -04:00
Tasha Upchurch f1da0e19c6 Renamed variable and added new assignment in func method
In the func method, the variable name 'text' has been updated to 'lst' to better reflect its purpose. Additionally, a new variable 'x_list' has been assigned the value of 'lst', which may be a preparation for further enhancements.
2023-08-20 13:46:00 -04:00
Tasha Upchurch 57e514b0b6 Add several new nodes:
- DecodeTranscriptNode to parse transcript text
- YoutubeUploadNode to upload videos to YouTube
- Audio metadata and file list nodes
- Image stack blending and stripping alpha channel
- Sampler dataset creation node
- Utils for deep copying tensors and arrays

Also includes:

- Testing for new utils module
- Git nodes marked with base class
- Renamed nodes.py to avoid conflicts
- Import refactoring to handle naming

Specifics:

- descript.py: New transcript parsing node
- youtube_nodes.py: New YouTube upload node
- audio.py: New audio metadata and file list nodes
- utils.py: Deep copy utility functions
- image.py: New image stack blending and alpha stripping
- tests/test_utils.py: Tests for new utils
- git.py: Marked git nodes with base class
- __init__.py: Refactored imports and mappings
- requirements.txt: Added YouTube dependencies
- functional.py: Minor tweaks
- modules/youtube.py: Helper for upload node
- video.py: Minor cleanup
- tests/test_youtube_nodes.py: Test for YouTube upload
2023-08-05 15:19:21 -04:00
Tasha Upchurch 8e57955410 Commit message:
"Added GetFirstCodeBlock class to functional.py"

Commit details:
- Added a new class called GetFirstCodeBlock to the functional.py file.
- The GetFirstCodeBlock class is used to find and return the first code block in the input text. It checks for code blocks surrounded by "```" or "```python" tags, or "<code>" tags.
- Returns an empty string if no code block is found.
- Added a new function called func to the GetFirstCodeBlock class, which takes the input text as an argument and returns the first code block.
- Updated the functional.py file with the new class and function.
- The new class is categorized under "ETK/func" and has a return type of "STRING".
- The commit message and details were created using the IDEA additional info of the patch, with the charset set to UTF-8.
2023-07-03 22:05:45 -04:00
Tasha Upchurch 117d5e9a99 1. Added a new class FuncStrToList in functional.py
2. This class has a method func that takes a string and code as input and executes the code.
3. The executed code is expected to convert the input string into a list which is then returned.
4. Also, defined INPUT_TYPES, CATEGORY, RETURN_TYPES, and FUNCTION for the class.
2023-07-01 02:52:59 -04:00
Tasha Upchurch ae3305385d 1. custom_nodes/SWAIN/text.py:
- Added a new function handler called "LoadJson" that loads a JSON object from a file and returns it as a dictionary or list.
   - Updated the RETURN_TYPES and RETURN_NAMES for the "LoadJson" function.

2. custom_nodes/SWAIN/llm.py:
   - Updated the "get_openai_embedding" function to include additional keyword arguments.
   - Added exception handling for API connection errors and API errors in the "get_openai_embedding" function.
   - Modified the "get_k_nearest_vectors" function to handle tuples as input.
   - Removed unnecessary import statements in the LLMEmbedding class.
   - Added a new function handler called "FuncStrToStr" that runs the 'eval' function on the given text with a string as input and returns a string.
   - Updated the INPUT_TYPES and RETURN_TYPES for the "FuncStrToStr" function.

3. custom_nodes/SWAIN/tests/test_llm.py:
   - Added new unit tests for the "get_openai_embedding" and "get_k_nearest_vectors" functions.
   - Fixed import statements in the test file.

4. custom_nodes/EternalKernelLiteGraphNodes/functional.py:
   - Added a new function handler called "FuncStrToStr" that runs 'eval' on the given text with a string as input and returns a string.
   - Updated the INPUT_TYPES for the "FuncStrToStr" function.

5. custom_nodes/SWAIN/bases.py:
   - Added a new widget generator for the "number" parameter type.

These changes introduce new functionality and improve the error handling and testing in the project.
2023-06-28 21:37:27 -04:00
Tasha Upchurch d2ed980b6d - Added a new class called FuncListToList to the functional.py file.
- Modified the `func` method in the `FuncRender` class in `functional.py` to return a tuple.
- Modified the `video_folders` function in `video.py` to include a return statement.
- Modified the `video_files` function in `video.py` to include a return statement.
- Added a new parameter `func` with a default value of `None` to the `optional` dictionary in the `ImageStackToVideoFile` class in `video.py`.
- Updated the `handler` method in the `ImageStackToVideoFile` class in `video.py` to include a check for the `optional` parameter `func`.
2023-06-26 17:49:06 -04:00
Tasha Upchurch 006236637e Add support for additional function and code inputs in FuncBase and FuncRender classes. 2023-06-18 20:28:42 -04:00
Tasha Upchurch 4f9c3ed310 better functional integration 2023-06-14 16:00:50 -04:00
Tasha Upchurch 5599883244 fixed missing instructions 2023-06-13 01:54:47 -04:00
Tasha Upchurch 77535a77f1 bug fixs for various issues around module structure. 2023-06-12 23:24:02 -04:00
Tasha Upchurch dbb0643959 just moving things around 2023-06-12 15:55:08 -04:00
Timothy Eakin f9aaedc0f2 moved Code Execution widget to ETL/func and functional.py 2023-06-10 15:03:55 -04:00
Tasha Upchurch 26c8b8df0d beginnings of a node collection for functional composition etc. 2023-05-29 22:36:53 -04:00