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 file introduces a module containing various PyTorch-related classes and functionalities for use within the Eternal Toolkit (ETK) environment.
It imports essential PyTorch modules such as torch, torch.nn, and others.
Defines two dictionaries, NODE_CLASS_MAPPINGS and NODE_DISPLAY_NAME_MAPPINGS, for mapping class names to display names.
Implements a decorator ETK_pytorch_base to customize attributes of PyTorch-related classes.
Contains multiple PyTorch-related classes with the following key functionalities:
PyTorchDatasetDownloader: Downloads PyTorch datasets and returns them as tensors.
DatsetSplitter: Splits a dataset into training and validation sets.
AddLinearLayerNode: Adds linear layers to PyTorch models.
AddSoftmaxLayerNode: Adds softmax layers to PyTorch models.
SequentialModelProvider: Provides default sequential PyTorch models.
PyTorchInferenceNode: Performs inference using pre-trained PyTorch models.
FlattenTensor and FlattenDataset: Flatten tensors and datasets.
ReshapeTensor: Reshapes tensors.
ChangeTensorType: Changes the data type of tensors.
TensorToList: Converts tensors to lists.
SliceTensor: Slices tensors.
SaveModel and LoadModel: Save and load PyTorch models.
TrainModel: Trains PyTorch models on datasets.
TensorsToDataset and DatasetToDataloader: Convert tensors to datasets and datasets to data loaders, respectively.
Each class has well-defined input types, return types, and functions tailored to specific PyTorch operations.
Exception handling and error messages are provided to ensure robustness and usability.
The classes are designed to work seamlessly with both CPU and GPU devices based on the specified device parameter.
These classes extend the capabilities of ETK by providing powerful PyTorch functionalities for model development and data processing.
These new files and their contents enhance the functionality of ETK by enabling users to work with PyTorch models, datasets, and tensors more effectively. They offer a wide range of operations for deep learning and machine learning tasks within the ETK environment.
This file introduces a Python script for managing JavaScript extension files within a specific directory structure.
It includes an import statement for the os module.
Imports essential variables ETK_PATH and GDE_PATH from the custom_nodes.EternalKernelLiteGraphNodes.local_shared module.
Defines a function called check_for_js_extension(), which:
Verifies the existence of JavaScript extension files.
Compares modification timestamps to determine which file is newer.
Copies files between directories if they are outdated.
Provides user feedback during the copying process.
Calls the check_for_js_extension() function at the end of the script to perform the checks and copying.
Shared model instances across TinyTxtToImg objects for efficiency
Added option to unload models from memory
Improved CUDA and CPU memory handling
Introduced ScaleLatentChannelwise for latent scaling
Added TextInImage and DetectTextLines for OCR capabilities
Removed unnecessary comments and adjusted code formatting
updated openai and openai_function_calling using:
pip install --upgrade {package name}
found a missing RETURN_TYPES = ("IMAGE",) in ETKLGN/image.PreviewImageTest
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.
started creating whisper transcription node
modified how imports are handled to avoid importing the same moduels twice under different name spaces.
added basic.py to house simple functions that work on primitives.
NOTE: this update relies on change to /web/extensions that are not included in this commit, a future commit will include an install process for these changes.
This commit refactors the handling of the 'steps' attribute, making it configurable via arguments, and adds memory cleanup logic within the 'stackme' method. Additionally, conditional cloning of images ensures that operations are performed only if the images are not None. Commented-out code provides a placeholder for potential future modifications.
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.
This commit introduces the JoinAudioFiles class within the ETK/audio category. The class provides functionality to concatenate a list of audio files into a single file, using librosa and soundfile libraries. Metadata such as duration and samplerate are also retrieved. The code complies with the preferred import style.
- 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
- Introduced widget definitions for Git-related operations in `bases.py`.
These changes lay the foundation for Git-related functionality in the codebase and provide widget definitions for interacting with Git repositories.
# Context:
USER: I ran this command:
python E:/git/ComfyUI/custom_nodes/EternalKernelLiteGraphNodes/tests/test_git.py
And got this output:
Traceback (most recent call last):
File "E:\git\ComfyUI\custom_nodes\EternalKernelLiteGraphNodes\tests\test_git.py", line 6, in <module>
from custom_nodes.git import CreateRepoNode
ModuleNotFoundError: No module named 'custom_nodes.git'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "E:\git\ComfyUI\custom_nodes\EternalKernelLiteGraphNodes\tests\test_git.py", line 8, in <module>
from custom_nodes.git import CreateRepoNode
ModuleNotFoundError: No module named 'custom_nodes.git'
# Context:
USER: I ran this command:
python E:/git/ComfyUI/custom_nodes/EternalKernelLiteGraphNodes/tests/test_git.py
And got this output:
Traceback (most recent call last):
File "E:\git\ComfyUI\custom_nodes\EternalKernelLiteGraphNodes\tests\test_git.py", line 2, in <module>
from custom_nodes.EternalKernelLiteGraphNodes.git import CreateRepoNode
ModuleNotFoundError: No module named 'custom_nodes.EternalKernelLiteGraphNodes'