File size: 951 Bytes
6afe459
 
 
 
 
 
 
521420f
771240c
6afe459
 
df059ae
a3d8132
9c26ab1
6afe459
 
 
 
 
 
 
 
 
 
 
 
 
 
 
771240c
 
521420f
b32ef1c
aed2387
0acd57a
6afe459
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36


import streamlit as st
import requests
import io
from PIL import Image
import os


# Create a text input

API_KEY = os.environ.get("API_KEY")
API_URL = "https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-xl-base-1.0"
headers = {"Authorization": f"Bearer {API_KEY}"}

user_input = st.text_input("Enter your text here:")

# Process the input (you can replace this with your own logic)
processed_output = user_input.upper()

# Display the processed output
# st.write(f"Processed output: {processed_output}")
def query(payload):
	response = requests.post(API_URL, headers=headers, json=payload)
	return response.content
image_bytes = query({
	"inputs": user_input,
})



image = Image.open(io.BytesIO(image_bytes))
st.image(image, caption="image", width=None, use_column_width=None, clamp=False, channels="RGB", output_format="auto")
# st.image(image=image,caption="image")
# st.image(image)
# st.image(image : image,caption=image)