ComfyUI > Nodes > ComfyUI Level Pixel > Merge JSON Node [LP]

ComfyUI Node: Merge JSON Node [LP]

Class Name

MergeJSONNode|LP

Category
LevelPixel/JSON
Author
LevelPixel (Account age: 647days)
Extension
ComfyUI Level Pixel
Latest Updated
2026-02-24
Github Stars
0.03K

How to Install ComfyUI Level Pixel

Install this extension via the ComfyUI Manager by searching for ComfyUI Level Pixel
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI Level Pixel in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Merge JSON Node [LP] Description

Combines two JSON strings into one, supporting objects and arrays with customizable merge strategies.

Merge JSON Node [LP]| Merge JSON Node [LP]:

The MergeJSONNode| Merge JSON Node [LP] is a powerful utility designed to seamlessly combine two JSON strings into a single cohesive JSON structure. This node is particularly beneficial when you need to integrate data from multiple JSON sources, ensuring that the resulting JSON is both comprehensive and organized according to your specified strategy. The node supports merging both JSON objects and arrays, providing flexibility in handling different data structures. By offering various merge strategies, it allows you to control how conflicts between the two JSON inputs are resolved, making it an essential tool for managing complex JSON data in your AI art projects.

Merge JSON Node [LP]| Merge JSON Node [LP] Input Parameters:

json_string_1

This parameter represents the first JSON string that you want to merge. It should be a valid JSON string, and it can be either an object or an array. The content of this JSON string will be combined with json_string_2 based on the selected merge strategy. There are no specific minimum or maximum values, but it must be a valid JSON format.

json_string_2

Similar to json_string_1, this parameter is the second JSON string that you wish to merge. It must also be a valid JSON string and should match the type of json_string_1 (either both should be objects or both should be arrays). The merging process will consider this JSON string in conjunction with json_string_1.

merge_strategy

This parameter determines how the merging process handles conflicts between json_string_1 and json_string_2. It offers three options: "override", "preserve", and "concat". The "override" strategy replaces values in json_string_1 with those from json_string_2 when conflicts arise. The "preserve" strategy retains the original values from json_string_1, ignoring conflicting values from json_string_2. The "concat" strategy combines values, which is particularly useful for lists or strings. The default value is "override".

Merge JSON Node [LP]| Merge JSON Node [LP] Output Parameters:

json_string

The output parameter is a single JSON string that represents the merged result of json_string_1 and json_string_2. This JSON string is formatted with indentation for readability and ensures that the merged data is presented in a structured and accessible manner. The output reflects the chosen merge strategy, providing a clear and concise representation of the combined JSON data.

Merge JSON Node [LP]| Merge JSON Node [LP] Usage Tips:

  • Ensure that both json_string_1 and json_string_2 are valid JSON strings and of the same type (either both objects or both arrays) to avoid errors during the merging process.
  • Choose the appropriate merge_strategy based on your data needs. Use "override" when you want the second JSON to take precedence, "preserve" to maintain the original data, and "concat" to combine lists or strings.
  • Utilize the node to simplify the integration of JSON data from different sources, making it easier to manage and manipulate complex datasets in your projects.

Merge JSON Node [LP]| Merge JSON Node [LP] Common Errors and Solutions:

Invalid JSON input

  • Explanation: This error occurs when either json_string_1 or json_string_2 is not a valid JSON format, which prevents the node from parsing the input correctly.
  • Solution: Verify that both input strings are correctly formatted JSON. Use a JSON validator tool to check and correct any syntax errors before using the node.

Both inputs must be of the same type (either objects or arrays)

  • Explanation: This error arises when json_string_1 and json_string_2 are of different types, such as one being an object and the other an array.
  • Solution: Ensure that both JSON inputs are of the same type. Convert one of the inputs to match the type of the other if necessary before attempting to merge them.

Merge JSON Node [LP] Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI Level Pixel
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.