dkapur17/streamlit-flow

Image Support?

shuZro opened this issue · 4 comments

Is there support for images in the nodes?

The StreamlitFlowNode class is a thin wrapper over the ReactFlow node, which doesn't directly support images. Adding support for images within nodes would require creating a custom ReactFlow node and a new class (something like StreamlitFlowImageNode) to interface with it. Will add this to the roadmap.

TL;DR: Currently, images in nodes are not supported.

I was able to implement an image in the node using a background image in the styles.

style={"backgroundImage": f"url({im})", "backgroundRepeat": "no-repeat", "width": 500, "height": 500}

But from within in the flow editor would be nice

This is a clever work around! Thanks for sharing.

Images within nodes is supported natively through Markdown since v1.2.8! Check out the demo at https://stflow.streamlit.app/Markdown_Node.