File size: 741 Bytes
5e6e594
f9edb9f
5e6e594
 
cbf8c71
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5e6e594
d1b1569
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
# import gradio as gr

# gr.Interface.load("models/prompthero/openjourney").launch()

# from diffusers import StableDiffusionPipeline
# import torch
# model_id = "prompthero/openjourney"
# pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
# pipe = pipe.to("")
# prompt = "retro serie of different cars with different colors and shapes, mdjrny-v4 style"
# image = pipe(prompt).images[0]
# print(image)

from diffusers import StableDiffusionOnnxPipeline

pipe = StableDiffusionOnnxPipeline.from_pretrained(
    "runwayml/stable-diffusion-v1-5",
    revision="onnx",
    provider="CUDAExecutionProvider",
)

prompt = "a photo of an astronaut riding a horse on mars"
image = pipe(prompt).images[0]
print(image)