Oysiyl commited on
Commit
faa27af
·
1 Parent(s): b738f5e

add gallery, better exampels, add example with neapolitano pizza

Browse files
Files changed (1) hide show
  1. app.py +105 -0
app.py CHANGED
@@ -1689,6 +1689,111 @@ if __name__ == "__main__" and not os.environ.get('QR_TESTING_MODE'):
1689
  outputs=[artistic_seed]
1690
  )
1691
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1692
  # Add examples for artistic QR
1693
  artistic_examples = [
1694
  [
 
1689
  outputs=[artistic_seed]
1690
  )
1691
 
1692
+ # Custom Examples Gallery with Images
1693
+ gr.Markdown("### Featured Examples")
1694
+ gr.Markdown("Click 'Load Settings' under any example to populate the form with those exact settings")
1695
+
1696
+ # First row (3 images)
1697
+ with gr.Row():
1698
+ # Example 1: Japanese Temple
1699
+ with gr.Column(scale=1):
1700
+ ex1_img = gr.Image("examples/artistic/japanese_temple.jpg", label="Japanese Temple", show_label=True, interactive=False, show_download_button=False, height=280)
1701
+ ex1_btn = gr.Button("Load Settings", size="sm", variant="secondary")
1702
+
1703
+ # Example 2: Sunset Mountains
1704
+ with gr.Column(scale=1):
1705
+ ex2_img = gr.Image("examples/artistic/sunset_mountains.jpg", label="Sunset Mountains", show_label=True, interactive=False, show_download_button=False, height=280)
1706
+ ex2_btn = gr.Button("Load Settings", size="sm", variant="secondary")
1707
+
1708
+ # Example 3: Roman City
1709
+ with gr.Column(scale=1):
1710
+ ex3_img = gr.Image("examples/artistic/roman_city.jpg", label="Roman City", show_label=True, interactive=False, show_download_button=False, height=280)
1711
+ ex3_btn = gr.Button("Load Settings", size="sm", variant="secondary")
1712
+
1713
+ # Second row (3 images)
1714
+ with gr.Row():
1715
+ # Example 4: Neapolitan Pizza
1716
+ with gr.Column(scale=1):
1717
+ ex4_img = gr.Image("examples/artistic/neapolitan_pizza.webp", label="Neapolitan Pizza", show_label=True, interactive=False, show_download_button=False, height=280)
1718
+ ex4_btn = gr.Button("Load Settings", size="sm", variant="secondary")
1719
+
1720
+ # Example 5: Poker Chips
1721
+ with gr.Column(scale=1):
1722
+ ex5_img = gr.Image("examples/artistic/poker_chips.webp", label="Poker Chips", show_label=True, interactive=False, show_download_button=False, height=280)
1723
+ ex5_btn = gr.Button("Load Settings", size="sm", variant="secondary")
1724
+
1725
+ # Example 6: Underwater Fish
1726
+ with gr.Column(scale=1):
1727
+ ex6_img = gr.Image("examples/artistic/underwater_fish.webp", label="Underwater Fish", show_label=True, interactive=False, show_download_button=False, height=280)
1728
+ ex6_btn = gr.Button("Load Settings", size="sm", variant="secondary")
1729
+
1730
+ # Third row (3 images)
1731
+ with gr.Row():
1732
+ # Example 7: Mediterranean Garden
1733
+ with gr.Column(scale=1):
1734
+ ex7_img = gr.Image("examples/artistic/mediterranean_garden.jpg", label="Mediterranean Garden", show_label=True, interactive=False, show_download_button=False, height=280)
1735
+ ex7_btn = gr.Button("Load Settings", size="sm", variant="secondary")
1736
+
1737
+ # Example 8: Rice Fields
1738
+ with gr.Column(scale=1):
1739
+ ex8_img = gr.Image("examples/artistic/rice_fields.jpg", label="Rice Fields", show_label=True, interactive=False, show_download_button=False, height=280)
1740
+ ex8_btn = gr.Button("Load Settings", size="sm", variant="secondary")
1741
+
1742
+ # Example 9: Cyberpunk City
1743
+ with gr.Column(scale=1):
1744
+ ex9_img = gr.Image("examples/artistic/cyberpunk_city.webp", label="Cyberpunk City", show_label=True, interactive=False, show_download_button=False, height=280)
1745
+ ex9_btn = gr.Button("Load Settings", size="sm", variant="secondary")
1746
+
1747
+ # Load settings button handlers
1748
+ # Ex1: Japanese Temple
1749
+ ex1_btn.click(
1750
+ fn=lambda: ("some clothes spread on ropes, Japanese girl sits inside in the middle of the image, few sakura flowers, realistic, great details, out in the open air sunny day realistic, great details, absence of people, Detailed and Intricate, CGI, Photoshoot, rim light, 8k, 16k, ultra detail", "https://www.google.com", "URL", 640, 6, "Medium (15%)", 14, "Square", True, 718313, 0.5),
1751
+ outputs=[artistic_prompt_input, artistic_text_input, artistic_input_type, artistic_image_size, artistic_border_size, artistic_error_correction, artistic_module_size, artistic_module_drawer, artistic_use_custom_seed, artistic_seed, sag_blur_sigma]
1752
+ )
1753
+ # Ex2: Sunset Mountains
1754
+ ex2_btn.click(
1755
+ fn=lambda: ("a beautiful sunset over mountains, photorealistic, detailed landscape, golden hour, dramatic lighting, 8k, ultra detailed", "https://github.com", "URL", 704, 6, "High (30%)", 16, "Square", True, 718313, 0.5),
1756
+ outputs=[artistic_prompt_input, artistic_text_input, artistic_input_type, artistic_image_size, artistic_border_size, artistic_error_correction, artistic_module_size, artistic_module_drawer, artistic_use_custom_seed, artistic_seed, sag_blur_sigma]
1757
+ )
1758
+ # Ex3: Roman City
1759
+ ex3_btn.click(
1760
+ fn=lambda: ("aerial bird view of ancient Roman city, cobblestone streets and pathways forming intricate patterns, vintage illustration style, sepia tones, aged parchment look, detailed architecture, 8k, ultra detailed", "WIFI:T:WPA;S:MyNetwork;P:MyPassword123;;", "Plain Text", 832, 6, "High (30%)", 16, "Square", True, 718313, 0.5),
1761
+ outputs=[artistic_prompt_input, artistic_text_input, artistic_input_type, artistic_image_size, artistic_border_size, artistic_error_correction, artistic_module_size, artistic_module_drawer, artistic_use_custom_seed, artistic_seed, sag_blur_sigma]
1762
+ )
1763
+ # Ex4: Neapolitan Pizza
1764
+ ex4_btn.click(
1765
+ fn=lambda: ("artisan Neapolitan pizza on rustic wooden board, fresh basil leaves scattered on top and around, oregano sprinkled, flour dust particles floating in air, melted mozzarella with char marks, traditional Italian pizzeria ambiance, warm brick oven glow in background, detailed food photography, photorealistic, 8k, ultra detailed", "https://www.pizzamaking.com", "URL", 704, 6, "High (30%)", 16, "Square", True, 856749, 2.0),
1766
+ outputs=[artistic_prompt_input, artistic_text_input, artistic_input_type, artistic_image_size, artistic_border_size, artistic_error_correction, artistic_module_size, artistic_module_drawer, artistic_use_custom_seed, artistic_seed, sag_blur_sigma]
1767
+ )
1768
+ # Ex5: Poker Chips
1769
+ ex5_btn.click(
1770
+ fn=lambda: ("some cards on poker tale, realistic, great details, realistic, great details,absence of people, Detailed and Intricate, CGI, Photoshoot,rim light, 8k, 16k, ultra detail", "https://store.steampowered.com", "URL", 768, 6, "High (30%)", 16, "Square", True, 718313, 2.5),
1771
+ outputs=[artistic_prompt_input, artistic_text_input, artistic_input_type, artistic_image_size, artistic_border_size, artistic_error_correction, artistic_module_size, artistic_module_drawer, artistic_use_custom_seed, artistic_seed, sag_blur_sigma]
1772
+ )
1773
+ # Ex6: Underwater Fish
1774
+ ex6_btn.click(
1775
+ fn=lambda: ("underwater scene with tropical fish, coral reef, rays of sunlight penetrating water, vibrant colors, detailed marine life, photorealistic, 8k, ultra detailed", "https://www.reddit.com", "URL", 704, 6, "High (30%)", 16, "Square", True, 718313, 0.5),
1776
+ outputs=[artistic_prompt_input, artistic_text_input, artistic_input_type, artistic_image_size, artistic_border_size, artistic_error_correction, artistic_module_size, artistic_module_drawer, artistic_use_custom_seed, artistic_seed, sag_blur_sigma]
1777
+ )
1778
+ # Ex7: Mediterranean Garden
1779
+ ex7_btn.click(
1780
+ fn=lambda: ("ancient stone sundial in Mediterranean garden, olive trees, dappled sunlight through leaves, weathered stone texture, peaceful afternoon scene, photorealistic, detailed, 8k, ultra detailed", "BEGIN:VEVENT\\nSUMMARY:Team Meeting\\nDTSTART:20251115T140000Z\\nDTEND:20251115T150000Z\\nLOCATION:Conference Room A\\nEND:VEVENT", "Plain Text", 1024, 6, "High (30%)", 14, "Square", True, 413468, 0.5),
1781
+ outputs=[artistic_prompt_input, artistic_text_input, artistic_input_type, artistic_image_size, artistic_border_size, artistic_error_correction, artistic_module_size, artistic_module_drawer, artistic_use_custom_seed, artistic_seed, sag_blur_sigma]
1782
+ )
1783
+ # Ex8: Rice Fields
1784
+ ex8_btn.click(
1785
+ fn=lambda: ("aerial view of terraced rice fields on mountainside, winding pathways between green paddies, Asian countryside, bird's eye perspective, detailed landscape, golden hour lighting, photorealistic, 8k, ultra detailed", "geo:37.7749,-122.4194", "Plain Text", 704, 6, "High (30%)", 16, "Square", True, 962359, 0.5),
1786
+ outputs=[artistic_prompt_input, artistic_text_input, artistic_input_type, artistic_image_size, artistic_border_size, artistic_error_correction, artistic_module_size, artistic_module_drawer, artistic_use_custom_seed, artistic_seed, sag_blur_sigma]
1787
+ )
1788
+ # Ex9: Cyberpunk City
1789
+ ex9_btn.click(
1790
+ fn=lambda: ("futuristic cityscape with flying cars and neon lights, cyberpunk style, detailed architecture, night scene, 8k, ultra detailed", "https://linkedin.com", "URL", 704, 6, "High (30%)", 16, "Square", True, 718313, 1.5),
1791
+ outputs=[artistic_prompt_input, artistic_text_input, artistic_input_type, artistic_image_size, artistic_border_size, artistic_error_correction, artistic_module_size, artistic_module_drawer, artistic_use_custom_seed, artistic_seed, sag_blur_sigma]
1792
+ )
1793
+
1794
+ gr.Markdown("---")
1795
+ gr.Markdown("### All Examples (Text-based)")
1796
+
1797
  # Add examples for artistic QR
1798
  artistic_examples = [
1799
  [