File size: 984 Bytes
2e40cec
 
 
 
a65d535
 
 
 
 
 
711c278
a65d535
 
2069ee0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import modal

f = modal.Cls.lookup("casa-interior-hf-v1", "DesignModel")

def casa_ai_run(image=None, text=None):

    if image is None and text is None: 
        print('Please provide context in form of image, audio, text')
        return None
    
    result_image = f.inference.remote(image, text)
    return result_image

import gradio as gr 

title = "Casa-AI Demo"
description = "A Gradio interface to use CasaAI for virtual staging"

demo = gr.Interface(casa_ai_run,
                    inputs = [gr.ImageEditor(sources='upload', brush=gr.Brush(colors=["#000000"]), elem_id="image_upload", type="pil", label="Upload")
                              gr.Textbox(label="Prompt to design room"), 
                              ],
                    outputs = [
                              gr.Image(label="Generated room image"),
                              ],
                    title = title,
                    description = description,
                    )
demo.launch()