File size: 839 Bytes
b26990a
 
 
 
 
9131a83
b26990a
 
 
 
 
 
9131a83
 
 
 
b26990a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import gradio as gr
import requests

url = "https://api.prodia.com/v1/job"

payload = { "model": "timeless-1.0.ckpt [7c4971d4]" }
headers = {
    "accept": "application/json",
    "content-type": "application/json",
    "X-Prodia-Key": "69e66898-010d-4cd1-9e22-090f73ad007b"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)

response = requests.post(url, headers=headers)

print(response.text)
#generator = DiffusionPipeline.from_pretrained("CompVis/ldm-text2im-large-256")

def generate(prompts):
  images = generator(list(prompts)).images
  return [images]

demo = gr.Interface(generate, 
             "textbox", 
             "image", 
             batch=True, 
             max_batch_size=4  # Set the batch size based on your CPU/GPU memory
).queue()

if __name__ == "__main__":
    demo.launch()