import streamlit as st x = st.slider('Select a value') st.write(x, 'squared is', x * x) from diffusers import DiffusionPipeline import torch pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float32, use_safetensors=True, variant="fp32") # if using torch < 2.0 # pipe.enable_xformers_memory_efficient_attention() prompt = "An astronaut riding a green horse" images = pipe(prompt=prompt).images[0] st.image(images) st.write("hello") """ import json import requests API_URL = "https://api-inference.huggingface.co/models/gpt2" token = "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" headers = {"Authorization": f"Bearer {token}"} def query(payload): data = json.dumps(payload) response = requests.request("POST", API_URL, headers=headers, data=data) return json.loads(response.content.decode("utf-8")) data = query("Can you please let us know more details about your ") print(data) """