Nodes Browser
ComfyDeploy: How MilitantHitchhiker-SwitchbladePack works in ComfyUI?
What is MilitantHitchhiker-SwitchbladePack?
Militant Hitchhiker's Switchblade Pack is a collection of custom nodes for ComfyUI that provide various multi-function capabilities.
How to install it in ComfyDeploy?
Head over to the machine page
- Click on the "Create a new machine" button
- Select the
Edit
build steps - Add a new step -> Custom Node
- Search for
MilitantHitchhiker-SwitchbladePack
and select it - Close the build step dialig and then click on the "Save" button to rebuild the machine
Militant Hitchhiker's Switchblade Pack
Militant Hitchhiker's Switchblade Pack is a collection of custom nodes for ComfyUI that provide various multi-function capabilities. It currently includes the following nodes:
- Text Appender
- Integrated Random Prompt Generator
- Model Analyser
- Militant Merge Node (FLUX)
- Save Flux Model
Installation
- Open a terminal or command prompt.
- Navigate to the
custom_nodes
directory of your ComfyUI installation. - Run the following command to clone the repository:
git clone https://github.com/MilitantHitchhiker/MilitantHitchhiker-SwitchbladePack.git
- Restart ComfyUI to load the new nodes.
Node Details
Text Appender
The Text Appender node allows you to concatenate up to five text inputs with a specified delimiter and optionally append the result to a file.
Inputs
text1
(optional): The first text input. Default is an empty string.text2
(optional): The second text input. Default isNone
.text3
(optional): The third text input. Default isNone
.text4
(optional): The fourth text input. Default isNone
.text5
(optional): The fifth text input. Default isNone
.delimiter
(optional): The delimiter to use for joining the text inputs. Default is\n
(newline). Use\n
in the input field to represent a newline character.output_file
(optional): The name of the file to append the result to. The file will be created in thedictionaries
folder. Default is an empty string (no file output).
Outputs
result
: The concatenated text, with the specified delimiter joining the non-empty text inputs.
Integrated Random Prompt Generator
The Integrated Random Prompt Generator node generates random prompts by selecting items from up to four dictionary files and joining them with a specified delimiter.
Inputs
dict1_file
,dict2_file
,dict3_file
,dict4_file
(required): The names of the dictionary files to use. The files should be placed in theinput/Dictionaries
folder of your ComfyUI installation. Usenone
to disable a dictionary.enable_dict1
,enable_dict2
,enable_dict3
,enable_dict4
(required): Boolean values indicating whether to enable each dictionary. Default isTrue
for all dictionaries.dict1_delimiter
,dict2_delimiter
,dict3_delimiter
,dict4_delimiter
(required): The delimiters used to split the items in each dictionary file. Default is\n
(newline) for all dictionaries.output_delimiter
(required): The delimiter used to join the selected items from each dictionary. Default is a space.seed
(required): The random seed for reproducibility. Default is0
.
Outputs
result
: The generated prompt, with items randomly selected from the enabled dictionaries and joined by theoutput_delimiter
.
Model Analyser
The Model Analyser node provides detailed analysis of a given model's structure, size, and parameters.
Inputs
model
(required): The model to be analyzed.
Outputs
analysis
: A JSON string containing detailed information about the model's structure, size, block information, and data types.
Militant Merge Node (FLUX)
The Militant Merge Node allows for advanced merging of two models with various options and analysis.
Inputs
model1
,model2
(required): The two models to be merged.use_smaller_model
(required): Boolean indicating whether to use the smaller model as the base.merge_mode
(required): The merge mode to use ("simple" or "dare").input_blocks_merge_amount
,middle_block_merge_amount
,output_blocks_merge_amount
(required): Float values (0.0 to 1.0) indicating the merge amount for different parts of the model.force_keep_dim
(required): Boolean indicating whether to force keeping dimensions when merging.random_drop_probability
(required): Float value (0.0 to 1.0) for random drop probability in DARE merge mode.mask_model
(optional): An optional mask model for the merge process.
Outputs
merged_model
: The resulting merged model.analysis_summary
: A JSON string containing a summary of the merge process and results.
Save Flux Model
The Save Flux Model node allows saving a model in various formats with additional information.
Inputs
model
(required): The model to be saved.filename_prefix
(required): The prefix for the output filename.output_format
(required): The desired output format ("bfloat16", "float16", "float32", or "int8").
Outputs
This node has no outputs but saves the model to a file and generates an additional JSON file with tensor information.
Usage Examples
Text Appender
- Connect the Text Appender node to a text input node.
- Set the
delimiter
to\n
to join the text inputs with newline characters. - Specify the
output_file
to append the result to a file. - Run the workflow to concatenate the text inputs and save the result to the specified file.
Integrated Random Prompt Generator
- Place the dictionary files you want to use in the
input/Dictionaries
folder of your ComfyUI installation. - Connect the Integrated Random Prompt Generator node to other nodes as desired.
- Select the dictionary files you want to use and set the corresponding
enable_dict
inputs toTrue
. - Specify the delimiters for each dictionary file using the
dict_delimiter
inputs. - Set the
output_delimiter
to control how the selected items are joined. - Specify a
seed
value for reproducibility, or leave it as0
for random results. - Run the workflow to generate random prompts based on the selected dictionaries.
Model Analyser
- Connect the Model Analyser node to a model output from another node.
- Run the workflow to generate a detailed analysis of the model's structure and parameters.
Militant Merge Node (FLUX)
- Connect two model inputs to the Militant Merge Node.
- Configure the merge settings, including merge mode, block merge amounts, and other options.
- Optionally, connect a mask model if desired.
- Run the workflow to merge the models and obtain the merged model along with an analysis summary.
Save Flux Model
- Connect a model output to the Save Flux Model node.
- Specify the desired filename prefix and output format.
- Run the workflow to save the model in the specified format and generate additional tensor information.
Contributing
Contributions to the Militant Hitchhiker's Switchblade Pack are welcome! If you have any ideas, bug reports, or feature requests, please open an issue on the GitHub repository. Pull requests are also encouraged.
License
The Militant Hitchhiker's Switchblade Pack is released under the MIT License.