github-actions[bot] commited on
Commit
e1a9f73
·
1 Parent(s): 0598f44

Deploy from GitHub - 2026-01-19 19:44:29

Browse files
Files changed (3) hide show
  1. README.md +1 -1
  2. app.py +16 -5
  3. requirements.txt +3 -3
README.md CHANGED
@@ -4,7 +4,7 @@ emoji: 🎨
4
  colorFrom: indigo
5
  colorTo: purple
6
  sdk: gradio
7
- sdk_version: 4.20.0
8
  app_file: app.py
9
  pinned: false
10
  license: mit
 
4
  colorFrom: indigo
5
  colorTo: purple
6
  sdk: gradio
7
+ sdk_version: 5.12.0
8
  app_file: app.py
9
  pinned: false
10
  license: mit
app.py CHANGED
@@ -2555,11 +2555,21 @@ with gr.Blocks(
2555
  gr.Markdown("---")
2556
 
2557
  def create_example_image():
 
2558
  arr = np.zeros((256, 256, 3), dtype=np.uint8)
 
2559
  for i in range(256):
2560
- arr[:, i, 0] = i
2561
- arr[:, i, 1] = 255 - i
2562
- arr[:, i, 2] = 128
 
 
 
 
 
 
 
 
2563
  return Image.fromarray(arr)
2564
 
2565
  example_img = create_example_image()
@@ -2569,12 +2579,13 @@ with gr.Blocks(
2569
  [example_img, "candy", "auto", False, False],
2570
  [example_img, "mosaic", "auto", False, False],
2571
  [example_img, "rain_princess", "auto", True, False],
 
2572
  ],
2573
  inputs=[quick_image, quick_style, quick_backend, quick_compare, quick_watermark],
2574
  outputs=[quick_output, quick_stats, quick_download],
2575
  fn=stylize_image,
2576
- cache_examples=False,
2577
- label="Quick Examples"
2578
  )
2579
 
2580
  # FAQ Section
 
2555
  gr.Markdown("---")
2556
 
2557
  def create_example_image():
2558
+ # Create a more interesting test image with geometric shapes
2559
  arr = np.zeros((256, 256, 3), dtype=np.uint8)
2560
+ # Background gradient
2561
  for i in range(256):
2562
+ arr[:, i, 0] = i // 2
2563
+ arr[:, i, 1] = 128
2564
+ arr[:, i, 2] = 255 - i // 2
2565
+ # Add a circle in the center
2566
+ cy, cx = 128, 128
2567
+ for y in range(256):
2568
+ for x in range(256):
2569
+ if (x - cx)**2 + (y - cy)**2 <= 50**2:
2570
+ arr[y, x, 0] = 255
2571
+ arr[y, x, 1] = 200
2572
+ arr[y, x, 2] = 100
2573
  return Image.fromarray(arr)
2574
 
2575
  example_img = create_example_image()
 
2579
  [example_img, "candy", "auto", False, False],
2580
  [example_img, "mosaic", "auto", False, False],
2581
  [example_img, "rain_princess", "auto", True, False],
2582
+ [example_img, "udnie", "auto", False, False],
2583
  ],
2584
  inputs=[quick_image, quick_style, quick_backend, quick_compare, quick_watermark],
2585
  outputs=[quick_output, quick_stats, quick_download],
2586
  fn=stylize_image,
2587
+ cache_examples=True, # Enable caching to pre-generate styled outputs
2588
+ label="Quick Examples (Click to see each style)"
2589
  )
2590
 
2591
  # FAQ Section
requirements.txt CHANGED
@@ -1,9 +1,9 @@
1
  # Core dependencies for StyleForge Hugging Face Space
2
  torch>=2.0.0
3
  torchvision>=0.15.0
4
- gradio==4.20.0
5
- huggingface_hub==0.20.0
6
- spaces
7
  Pillow>=9.5.0
8
  numpy>=1.24.0
9
 
 
1
  # Core dependencies for StyleForge Hugging Face Space
2
  torch>=2.0.0
3
  torchvision>=0.15.0
4
+ gradio>=5.0.0
5
+ huggingface_hub>=0.23.0
6
+ spaces>=0.30.0
7
  Pillow>=9.5.0
8
  numpy>=1.24.0
9