Text-to-Image
Diffusers
Safetensors
English
whragyhrstjhj commited on
Commit
de07ed9
1 Parent(s): 92fc2cf
Files changed (1) hide show
  1. A1 +14 -0
A1 ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import requests
2
+
3
+ API_URL = "https://api-inference.huggingface.co/models/mhdang/dpo-sdxl-text2image-v1"
4
+
5
+ def query(payload):
6
+ response = requests.post(API_URL, headers=headers, json=payload)
7
+ return response.content
8
+ image_bytes = query({
9
+ "inputs": "A stunning young blonde supermodel wearing a tight red silk dress that emphasizes her ample bosom",
10
+ })
11
+ # You can access the image with PIL.Image for example
12
+ import io
13
+ from PIL import Image
14
+ image = Image.open(io.BytesIO(image_bytes))