Spaces:
Runtime error
Runtime error
File size: 1,352 Bytes
de19639 25d5798 de19639 25d5798 de19639 cbdd327 de19639 cbdd327 de19639 cbdd327 de19639 cbdd327 de19639 cbdd327 de19639 cbdd327 de19639 25d5798 b50f77d ab44c03 3b739ce b941c57 a8a49ad |
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 37 38 39 |
# import gradio as gr
# from diffusers import DiffusionPipeline
# # get_completion = pipeline("image-to-text",model="nlpconnect/vit-gpt2-image-captioning")
# # pipeline = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0")
# pipeline = DiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5")
# # def summarize(input):
# # output = get_completion(input)
# # return output[0]['generated_text']
# # def captioner(image):
# # result = get_completion(image)
# # return result[0]['generated_text']
# def generate(prompt):
# return pipeline(prompt).images[0]
# gr.close_all()
# demo = gr.Interface(fn=generate,
# inputs=[gr.Textbox(label="Your prompt")],
# outputs=[gr.Image(label="Result")],
# title="Image Generation with Stable Diffusion",
# description="Generate any image with Stable Diffusion",
# allow_flagging="never",
# examples=["the spirit of a tamagotchi wandering in the city of Vienna","a mecha robot in a favela"])
# demo.launch()
import gradio as gr
gr.close_all()
demo = gr.load(name="models/stabilityai/stable-diffusion-2-1",
title='PicassoBot',
description='Because paint splatters are so last century')
demo.launch() |