File size: 984 Bytes
cc3741b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
36
from diffusers import AutoPipelineForText2Image
import torch
import gradio as gr

pipeline = AutoPipelineForText2Image.from_pretrained('dataautogpt3/OpenDalleV1.1', torch_dtype=torch.float16)       

text0 = 'black fluffy gorgeous dangerous cat animal creature, large orange eyes, big fluffy ears, piercing gaze, full moon, dark ambiance, best quality, extremely detailed'

def generation(text):
    image = pipeline(text).images[0]
    return image

demo = gr.Blocks()

title = '# 3D print failures detection App'
description = 'App for detect errors in the 3D printing'

with demo:
    gr.Markdown(title)
    gr.Markdown(description)
    
    with gr.Row():
        img_input = gr.Textbox ( label="Text 1",info="Initial text",lines=5,value=text0)

        button = gr.Button(value="Reverse")

        
    with gr.Row():
        img_output= gr.Image()
    
    button.click( generation, inputs=img_input, outputs=[img_output])
        


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