Politrees commited on
Commit
e5648d6
·
verified ·
1 Parent(s): 570e9e3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -1,10 +1,10 @@
1
  import gradio as gr
2
  from PIL import Image
3
- import io
4
 
5
  # ─── Доступные размеры для даунскейла ───
6
  SIZES = ["8×8", "16×16", "32×32", "64×64", "128×128"]
7
 
 
8
  def parse_size(label: str) -> tuple[int, int]:
9
  """'16×16' → (16, 16)"""
10
  w, h = label.split("×")
@@ -101,6 +101,7 @@ with gr.Blocks(
101
  label="📤 Результат (реальный размер)",
102
  type="pil",
103
  image_mode="RGBA",
 
104
  show_download_button=True,
105
  elem_classes=["pixelated"],
106
  )
@@ -108,6 +109,7 @@ with gr.Blocks(
108
  label="🔎 Превью (увеличенное)",
109
  type="pil",
110
  image_mode="RGBA",
 
111
  elem_classes=["pixelated"],
112
  )
113
  info_box = gr.Textbox(
@@ -123,7 +125,6 @@ with gr.Blocks(
123
  outputs=[img_small, img_preview, info_box],
124
  )
125
 
126
- # ── Примеры (необязательно, можно убрать) ──
127
  gr.Markdown(
128
  """
129
  ---
 
1
  import gradio as gr
2
  from PIL import Image
 
3
 
4
  # ─── Доступные размеры для даунскейла ───
5
  SIZES = ["8×8", "16×16", "32×32", "64×64", "128×128"]
6
 
7
+
8
  def parse_size(label: str) -> tuple[int, int]:
9
  """'16×16' → (16, 16)"""
10
  w, h = label.split("×")
 
101
  label="📤 Результат (реальный размер)",
102
  type="pil",
103
  image_mode="RGBA",
104
+ format="png",
105
  show_download_button=True,
106
  elem_classes=["pixelated"],
107
  )
 
109
  label="🔎 Превью (увеличенное)",
110
  type="pil",
111
  image_mode="RGBA",
112
+ format="png",
113
  elem_classes=["pixelated"],
114
  )
115
  info_box = gr.Textbox(
 
125
  outputs=[img_small, img_preview, info_box],
126
  )
127
 
 
128
  gr.Markdown(
129
  """
130
  ---