Spaces:
Runtime error
Runtime error
TenPoisk commited on
Commit ·
cc06673
1
Parent(s): ce1e5a1
Update sd-xl.py
Browse files123456789101112131415import requestsAPI_URL = "https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-xl-refiner-1.0"headers = {"Authorization": "Bearer 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"}def query(payload):response = requests.post(API_URL, headers=headers, json=payload)return response.contentimage_bytes = query({"inputs": "Astronaut riding a horse",})# You can access the image with PIL.Image for exampleimport iofrom PIL import Imageimage = Image.open(io.BytesIO(image_bytes))123import gradio as grgr.Interface.load("models/stabilityai/stable-diffusion-xl-refiner-1.0").launch()
sd-xl.py+2-14