Building text to image app using stable diffusion model and stream lit

Hi Community,

I’m building a Text-to-Image app using a pre-trained Stable Diffusion model and Streamlit. I’ve downloaded the Juggernaut model in safetensors format and I’m trying to load and use it with PyTorch.

Since this format contains multiple components (like VAE, CLIP, etc.) in one file, I’m unsure of the exact requirements or how to properly load and use the files.

My questions are:

  1. Is there specific information on how to load and use a pre-trained Stable Diffusion model in safetensors format with Streamlit?
  2. Could you point me to any resources or examples that explain how to do this?

In my previous app, I used ComfyUI to create the workflow, then linked it to the Streamlit front end via a simple web API. Now, I’d like to remove ComfyUI and use only Streamlit and Python libraries to design and run the workflow.

To clarify, I’m not trying to train the model, just load it and generate images.

Any links or guidance would be greatly appreciated!