ComfyUI > Nodes > Basic data handling > pop random

ComfyUI Node: pop random

Class Name

Basic data handling: DictPopRandom

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 random Description

DictPopRandom node randomly removes and retrieves key-value pairs from a dictionary, handling empty cases.

pop random:

The DictPopRandom node is designed to enhance your workflow by allowing you to randomly remove and retrieve a key-value pair from a dictionary. This functionality is particularly useful when you need to process or analyze data in a non-sequential manner, adding an element of randomness to your operations. By using this node, you can efficiently manage dictionaries by dynamically altering their contents, which can be beneficial in scenarios where the order of processing is not predetermined. The node ensures that even if the dictionary is empty, it gracefully handles the situation by returning empty values, thus maintaining the stability of your workflow.

pop random Input Parameters:

input_dict

The input_dict parameter is the dictionary from which a random key-value pair will be removed. This parameter is crucial as it serves as the source of data for the node's operation. The dictionary can contain any type of keys and values, and the node will handle them appropriately. There are no specific minimum or maximum values for this parameter, but it should be a valid dictionary. If the dictionary is empty, the node will return empty values, indicating that no operation was performed.

pop random Output Parameters:

dict

The dict output parameter returns the modified dictionary after a random key-value pair has been removed. This output is essential as it reflects the current state of the dictionary post-operation, allowing you to continue processing with the updated data.

key

The key output parameter provides the key of the randomly removed key-value pair. This output is important for understanding which element was extracted from the dictionary, enabling you to track changes or perform further operations based on the removed key.

value

The value output parameter contains the value associated with the randomly removed key. This output is crucial for accessing the data that was extracted, allowing you to utilize it in subsequent processes or analyses.

success

The success output parameter is a boolean that indicates whether the operation was successful. A value of True means a key-value pair was successfully removed, while False indicates that the dictionary was empty and no operation was performed. This output helps in determining the outcome of the node's execution and can be used to handle different scenarios in your workflow.

pop random Usage Tips:

  • Use the DictPopRandom node when you need to introduce randomness into your data processing tasks, such as in simulations or randomized testing scenarios.
  • Ensure that the input dictionary is not empty to avoid unnecessary operations and to make full use of the node's capabilities.
  • Consider using the success output to conditionally execute further nodes or operations based on whether a key-value pair was successfully removed.

pop random Common Errors and Solutions:

Empty dictionary operation

  • Explanation: The node attempted to remove a key-value pair from an empty dictionary.
  • Solution: Ensure that the input dictionary contains at least one key-value pair before executing the node.

Random choice failure

  • Explanation: An error occurred while attempting to randomly select a key from the dictionary.
  • Solution: Verify that the input dictionary is correctly formatted and contains valid keys. If the issue persists, check for any underlying issues with the dictionary's data structure.

pop random 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 random