File size: 655 Bytes
c24b225
1f861e3
 
 
 
 
 
 
 
 
ff580f1
1f861e3
 
 
 
 
 
 
 
 
c24b225
5acc1ac
 
 
c24b225
5acc1ac
c24b225
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
import gradio as gr
from PIL import Image
from pathlib import Path
from multiprocessing import cpu_count
import requests
import io
import os
from PIL import Image

from diffusers import (
    DiffusionPipeline,
    StableDiffusionPipeline,
    StableDiffusionControlNetImg2ImgPipeline,
    ControlNetModel,
    DDIMScheduler,
    DPMSolverMultistepScheduler,
    DEISMultistepScheduler,
    HeunDiscreteScheduler,
    EulerDiscreteScheduler,
)

pipeline = DiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5")
def generate(prompt):
    return pipeline(prompt)

iface = gr.Interface(fn=generate, inputs="text", outputs="image")
iface.launch()