Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -843,7 +843,6 @@ footer {
|
|
843 |
|
844 |
def create_demo():
|
845 |
with gr.Blocks(theme="Yntec/HaleyCH_Theme_Orange", css=css) as demo:
|
846 |
-
|
847 |
with gr.Row():
|
848 |
with gr.Column():
|
849 |
prompt = gr.Textbox(label="Prompt(한글 가능)", value="A cute and fluffy golden retriever puppy sitting upright, holding a neatly designed white sign with bold, colorful lettering that reads 'Have a Happy Day!' in cheerful fonts. The puppy has expressive, sparkling eyes, a happy smile, and fluffy ears slightly flopped. The background is a vibrant and sunny meadow with soft-focus flowers, glowing sunlight filtering through the trees, and a warm golden glow that enhances the joyful atmosphere. The sign is framed with small decorative flowers, adding a charming and wholesome touch. Ensure the text on the sign is clear and legible.")
|
@@ -868,6 +867,17 @@ def create_demo():
|
|
868 |
with gr.Column():
|
869 |
output_image = gr.Image(label="Generated Image")
|
870 |
output_seed = gr.Text(label="Used Seed")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
871 |
|
872 |
do_img2img.change(
|
873 |
fn=lambda x: [gr.update(visible=x), gr.update(visible=x), gr.update(visible=x)],
|
@@ -878,16 +888,11 @@ def create_demo():
|
|
878 |
generate_button.click(
|
879 |
fn=generate_image,
|
880 |
inputs=[prompt, width, height, guidance, inference_steps, seed, do_img2img, init_image, image2image_strength, resize_img],
|
881 |
-
outputs=[output_image, output_seed]
|
882 |
)
|
883 |
-
|
884 |
-
examples = [
|
885 |
-
"a tiny astronaut hatching from an egg on the moon",
|
886 |
-
"a cat holding a sign that says hello world",
|
887 |
-
"an anime illustration of a wiener schnitzel",
|
888 |
-
]
|
889 |
|
890 |
return demo
|
891 |
|
892 |
if __name__ == "__main__":
|
893 |
-
demo = create_demo()
|
|
|
|
843 |
|
844 |
def create_demo():
|
845 |
with gr.Blocks(theme="Yntec/HaleyCH_Theme_Orange", css=css) as demo:
|
|
|
846 |
with gr.Row():
|
847 |
with gr.Column():
|
848 |
prompt = gr.Textbox(label="Prompt(한글 가능)", value="A cute and fluffy golden retriever puppy sitting upright, holding a neatly designed white sign with bold, colorful lettering that reads 'Have a Happy Day!' in cheerful fonts. The puppy has expressive, sparkling eyes, a happy smile, and fluffy ears slightly flopped. The background is a vibrant and sunny meadow with soft-focus flowers, glowing sunlight filtering through the trees, and a warm golden glow that enhances the joyful atmosphere. The sign is framed with small decorative flowers, adding a charming and wholesome touch. Ensure the text on the sign is clear and legible.")
|
|
|
867 |
with gr.Column():
|
868 |
output_image = gr.Image(label="Generated Image")
|
869 |
output_seed = gr.Text(label="Used Seed")
|
870 |
+
output_translated = gr.Text(label="Translated Prompt")
|
871 |
+
|
872 |
+
# Examples 컴포넌트 추가
|
873 |
+
gr.Examples(
|
874 |
+
examples=[
|
875 |
+
"a tiny astronaut hatching from an egg on the moon",
|
876 |
+
"a cat holding a sign that says hello world",
|
877 |
+
"an anime illustration of a wiener schnitzel",
|
878 |
+
],
|
879 |
+
inputs=prompt, # 예제가 입력될 컴포넌트 지정
|
880 |
+
)
|
881 |
|
882 |
do_img2img.change(
|
883 |
fn=lambda x: [gr.update(visible=x), gr.update(visible=x), gr.update(visible=x)],
|
|
|
888 |
generate_button.click(
|
889 |
fn=generate_image,
|
890 |
inputs=[prompt, width, height, guidance, inference_steps, seed, do_img2img, init_image, image2image_strength, resize_img],
|
891 |
+
outputs=[output_image, output_seed, output_translated]
|
892 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
893 |
|
894 |
return demo
|
895 |
|
896 |
if __name__ == "__main__":
|
897 |
+
demo = create_demo()
|
898 |
+
demo.launch()
|