prompt-extend-2 / app.py
RamAnanth1's picture
Update app.py
52d9e34
raw
history blame
514 Bytes
import gradio as gr
from transformers import pipeline
pipe = pipeline('text-generation', model='daspartho/prompt-extend')
def extend_prompt(input):
return pipe(prompt+',', num_return_sequences=1)[0]["generated_text"]
input_prompt = gr.Text(label="Enter the initial prompt")
sd2_output = gr.Text(label="Extended prompt suitable for Stable Diffusion 2")
demo = gr.Interface(fn=extend_prompt, inputs=input_prompt, outputs=sd2_output)
demo.queue(max_size=10,concurrency_count=20)
demo.launch(enable_queue=True)