ComfyUI Node: pop

Class Name

Basic data handling: DictPop

Category
Basic/DICT
Author
StableLlama (Account age: 861days)
Extension
Basic data handling
Latest Updated
2026-05-07
Github Stars
0.04K

How to Install Basic data handling

Install this extension via the ComfyUI Manager by searching for Basic data handling
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter Basic data handling 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

pop Description

DictPop node removes a key-value pair from a dictionary, returning a default if key absent.

pop:

The DictPop node is designed to facilitate the removal of a specified key-value pair from a dictionary, providing a streamlined way to manage and manipulate dictionary data structures. This node is particularly useful when you need to extract a specific value from a dictionary while simultaneously updating the dictionary by removing the key associated with that value. If the specified key does not exist within the dictionary, the node can return a default value, ensuring that your workflow remains uninterrupted. This functionality is essential for scenarios where dynamic data handling is required, allowing you to efficiently manage data without manually checking for key existence or handling exceptions. By using DictPop, you can maintain cleaner and more efficient code, as it abstracts the complexity of dictionary manipulation into a simple and reliable operation.

pop Input Parameters:

input_dict

The input_dict parameter represents the dictionary from which you want to remove a key-value pair. This parameter is crucial as it serves as the source of data for the operation. The dictionary can be of any mapping type, including immutable types like frozendict. There are no specific minimum or maximum values for this parameter, but it must be a valid dictionary object. The node will create a copy of this dictionary to perform the operation, ensuring that the original dictionary remains unchanged.

key

The key parameter specifies the key of the key-value pair you wish to remove from the dictionary. This parameter is essential because it determines which entry in the dictionary will be extracted and removed. If the key is not present in the dictionary, the node will return the default value specified. There are no restrictions on the type of key, but it must be compatible with the keys used in the dictionary.

default_value

The default_value parameter provides a fallback value that is returned if the specified key is not found in the dictionary. This parameter is optional and can be set to any value that suits your needs. If not provided, it defaults to None. This feature is particularly useful for handling cases where the key might not exist, allowing your workflow to continue smoothly without errors.

pop Output Parameters:

dict

The dict output parameter returns the modified dictionary after the specified key-value pair has been removed. This output is crucial as it reflects the updated state of the dictionary, allowing you to continue using it in subsequent operations. The type of the returned dictionary will match the type of the input dictionary, preserving any specific characteristics or constraints of the original data structure.

value

The value output parameter provides the value associated with the removed key. If the key was found and successfully removed, this parameter will contain the corresponding value. If the key was not found, it will contain the default_value specified in the input parameters. This output is important for retrieving the data you intended to extract from the dictionary.

pop Usage Tips:

  • Use the default_value parameter to handle cases where the key might not exist in the dictionary, preventing potential errors and ensuring smooth execution.
  • Ensure that the key parameter is correctly specified to avoid unintended removals or retrievals from the dictionary.
  • Consider the type of the input dictionary, especially if it is an immutable type, as the node will handle these appropriately by creating a mutable copy for the operation.

pop Common Errors and Solutions:

Error popping key from dictionary: <error_message>

  • Explanation: This error occurs when there is an issue with removing the specified key from the dictionary, possibly due to the key not existing or the dictionary being in an unexpected state.
  • Solution: Verify that the key parameter is correct and exists in the dictionary. Ensure that the input_dict is a valid dictionary object and not in a corrupted state. If the key might not exist, use the default_value parameter to handle such cases gracefully.

pop Related Nodes

Go back to the extension to check out more related nodes.
Basic data handling
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.

pop