Text-to-Image
Diffusers
Safetensors
English
File size: 481 Bytes
de07ed9
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import requests

API_URL = "https://api-inference.huggingface.co/models/mhdang/dpo-sdxl-text2image-v1"

def query(payload):
	response = requests.post(API_URL, headers=headers, json=payload)
	return response.content
image_bytes = query({
	"inputs": "A stunning young blonde supermodel wearing a tight red silk dress that emphasizes her ample bosom",
})
# You can access the image with PIL.Image for example
import io
from PIL import Image
image = Image.open(io.BytesIO(image_bytes))