Skip to content
This repository was archived by the owner on Aug 28, 2026. It is now read-only.
This repository was archived by the owner on Aug 28, 2026. It is now read-only.

Shared input incorrectly routed when intermediary node output used #71

Description

@pablovela5620

I'm trying to build a simple hand estimation graph. Input is an image, and it consists of 2 nodes, 1 that estimates the hand bounding boxes from the image, and another that takes the bounding box JSON and the same input image to estimate the hand keypoints.

I'm having the following problem when using the output JSON from the hand detection node: the input image doesn't get correctly routed to the keypoint estimation node, as if it's not connected

Image

here is what the code looks like

"""Daggr workflow connecting hand detection and keypoint estimation.

This requires running both apps on separate ports:
- Detection app: pixi run -e dev python tools/app_detection.py (defaults to 7860)
- Keypoint app: pixi run -e dev python tools/app_keypoint.py (port 7861)

Then run this script to launch the daggr graph:
- pixi run -e dev python tools/daggr_wilor.py
"""

from daggr import GradioNode, Graph
import gradio as gr
from gradio_rerun import Rerun


# Shared image input - both detection and keypoint nodes use this
shared_image = gr.Image(label="Input Image")

# Detection node - connects to hand detection app at port 7860
detection_node = GradioNode(
    "http://localhost:7860",
    api_name="/pred_fn",
    name="Hand Detection Node",
    inputs={"rgb_hw3": shared_image},
    outputs={
        "rrd": Rerun(streaming=True, visible=False),
        "detection_json": gr.JSON(visible=True),
    },
)

# Keypoint node - connects to keypoint estimation app at port 7861
# Uses same shared_image input + detection_json from upstream
keypoint_node = GradioNode(
    "http://localhost:7861",
    api_name="/pred_fn",
    name="Keypoint Estimation Node",
    inputs={
        "rgb_hw3": shared_image,  # Same shared input as detection
        "detection_json": detection_node.detection_json,  # Detection results
    },
    outputs={
        "rrd": Rerun(streaming=True, visible=False),
        "keypoint_json": gr.JSON(visible=True),
    },
)


graph = Graph(
    name="WiLor Hand Pose Pipeline",
    nodes=[detection_node, keypoint_node],
)

if __name__ == "__main__":
    graph.launch()

The strange bit is, if I instead of passing detection_node.detection_json to the keypoint estimation node, I just set a fixed value, such as

inputs={
        "rgb_hw3": shared_image,  # Same shared input as detection
        "detection_json": "fixed value",  # Detection results
    },

Then things correctly get routed.

Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions