To try this out, you can run a local Streamlit application that generates images in real-time using the SDXL model hosted on a Covalent service.
- Make a conda environment with:
covalent-cloud>=0.65.1
streamlit==1.35.0
torch==2.2.2
transformers==4.39.3
diffusers==0.27.2
-
Run the
sdxl-backend.ipynb
notebook to deploy the GPU Backend with Covalent. -
Run the command
streamlit run sdxl-frontend.py
to start the local Streamlit app. -
Copy-paste the deployment address and API key into the app's "Settings" sidebar.
That's all. You can now generate images in real-time with the SDXL model!
This example runs the following pipeline using a GPU-equipped backend via Covalent Cloud.
pipeline = AutoPipelineForText2Image.from_pretrained(
"stabilityai/sdxl-turbo",
torch_dtype=torch.float16,
variant="fp16",
).to("cuda")