How to hide st.image

I need to add a loading image until I get the data from the model, so after that, I need to hide it.
How to hide st.image?

I tried the following, but it didnโ€™t work, the image is still there:

placeholder= st.image('loading4.gif')
#call mode
placeholder = st.empty()
1 Like

Iโ€™ve just found why it didn;t work.
I have to do the following:

placeholder.empty()

instead of

placeholder = st.empty()

2 Likes