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()