Spaces:
Runtime error
Runtime error
TenPoisk commited on
Commit ·
9182f4a
1
Parent(s): a1d6d92
Create sd-xl.py
Browse files123456789101112131415import requests
API_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))sd-xl.pyAdded+15