Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,7 @@ import asyncio
|
|
2 |
import json
|
3 |
import gradio as gr
|
4 |
from diffusers import AutoPipelineForText2Image
|
5 |
-
from
|
6 |
|
7 |
# Load the model once outside of the function
|
8 |
model = AutoPipelineForText2Image.from_pretrained("stabilityai/sdxl-turbo")
|
@@ -47,7 +47,8 @@ with gr.Blocks() as demo:
|
|
47 |
character_dict_input = gr.Textbox(label="Character Dictionary")
|
48 |
selected_style_input = gr.Textbox(label="Selected Style")
|
49 |
submit_btn = gr.Button(value='Submit')
|
50 |
-
prompt_responses = [
|
|
|
51 |
submit_btn.click(fn=gradio_interface,
|
52 |
inputs=[sentence_mapping_input, character_dict_input, selected_style_input],
|
53 |
outputs=prompt_responses)
|
|
|
2 |
import json
|
3 |
import gradio as gr
|
4 |
from diffusers import AutoPipelineForText2Image
|
5 |
+
from generate_prompts import generate_prompt
|
6 |
|
7 |
# Load the model once outside of the function
|
8 |
model = AutoPipelineForText2Image.from_pretrained("stabilityai/sdxl-turbo")
|
|
|
47 |
character_dict_input = gr.Textbox(label="Character Dictionary")
|
48 |
selected_style_input = gr.Textbox(label="Selected Style")
|
49 |
submit_btn = gr.Button(value='Submit')
|
50 |
+
prompt_responses = [] # Empty list for dynamic addition of Image components
|
51 |
+
demo.load(fn=lambda x: x, inputs=[], outputs=prompt_responses)
|
52 |
submit_btn.click(fn=gradio_interface,
|
53 |
inputs=[sentence_mapping_input, character_dict_input, selected_style_input],
|
54 |
outputs=prompt_responses)
|