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.
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.
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.
- 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
"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.
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.
- 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.
- 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`.