File size: 1,436 Bytes
c43b0d6
38e694c
c43b0d6
 
38e694c
c43b0d6
38e694c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c160de1
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
import gradio as gr
from anything2image.api import Anything2Image


anything2img = Anything2Image(imagebind_download_dir='checkpoints')

with gr.Blocks() as demo:
    gr.HTML(
            """
            <div align='center'> <h1>Anything To Image </h1> </div>
            <p align="center"> Generate image from anything with ImageBind's unified latent space and stable-diffusion-2-1-unclip. </p>
            <p align="center"><a href="https://github.com/Zeqiang-Lai/Anything2Image"><b>https://github.com/Zeqiang-Lai/Anything2Image</b></p>
            """)
    gr.Interface(fn=anything2img, 
                    inputs=[gr.Text(placeholder="Enter a prompt in addition to the audio, image, text condition below", label="Prompt (Could be empty)"),
                            "audio", 
                            "image", 
                            "text"
                            ], 
                    outputs="image",
                    examples=[['', 'assets/wav/dog_audio.wav', None, None],
                            ['A painting', 'assets/wav/cat.wav', None, None],
                            ['', 'assets/wav/wave.wav', 'assets/image/bird.png', None],
                            ['', None, 'assets/image/bird_image.jpg', None],
                            ['', None, None, 'A sunset over the ocean.'],
                            ],
                    cache_examples=True,
                    )
demo.queue(1).launch()