tchung1970 Claude commited on
Commit
47e50c0
ยท
1 Parent(s): 467f36e

Add Korean localization and CLAUDE.md documentation

Browse files

- Localize UI labels and example prompts to Korean
- Add CLAUDE.md with architecture overview and development guidance
- Translate all Gradio interface elements (title, labels, placeholders, buttons)
- Translate error messages to Korean

๐Ÿค– Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

Files changed (2) hide show
  1. CLAUDE.md +100 -0
  2. app.py +29 -29
CLAUDE.md ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+ ## Overview
6
+
7
+ Z-Image-Turbo is a Gradio-based Hugging Face Space for image generation using the Z-Image diffusion transformer model. It provides a web interface for text-to-image generation with optional prompt enhancement via API.
8
+
9
+ ## Running the Application
10
+
11
+ **Start the Gradio app:**
12
+ ```bash
13
+ python app.py
14
+ ```
15
+
16
+ The app will launch with MCP server support enabled and be accessible via the Gradio interface.
17
+
18
+ ## Environment Variables
19
+
20
+ Required environment variables (set these before running):
21
+
22
+ - `MODEL_PATH`: Path or HF model ID (default: "Tongyi-MAI/Z-Image-Turbo")
23
+ - `HF_TOKEN`: Hugging Face token for model access
24
+ - `DASHSCOPE_API_KEY`: Optional, for prompt enhancement feature (currently disabled in UI)
25
+ - `ENABLE_COMPILE`: Enable torch.compile optimizations (default: "true")
26
+ - `ENABLE_WARMUP`: Warmup model on startup (default: "true")
27
+ - `ATTENTION_BACKEND`: Attention implementation (default: "flash_3")
28
+
29
+ ## Architecture
30
+
31
+ ### Core Components
32
+
33
+ **app.py** - Main application file containing:
34
+ - Model loading and initialization (`load_models`, `init_app`)
35
+ - Image generation pipeline using ZImagePipeline from diffusers
36
+ - Gradio UI with resolution presets and generation controls
37
+ - Optional prompt enhancement via DashScope API (currently disabled in UI)
38
+ - Zero GPU integration with AoTI (Ahead of Time Inductor) compilation
39
+
40
+ **pe.py** - Contains `prompt_template` for the prompt expander, a Chinese language system prompt that guides LLMs to transform user prompts into detailed visual descriptions suitable for image generation models.
41
+
42
+ ### Key Functions
43
+
44
+ **`generate(prompt, resolution, seed, steps, shift, enhance, random_seed, gallery_images, progress)`** (app.py:366)
45
+ - Main generation function decorated with `@spaces.GPU`
46
+ - Processes prompt, applies settings, generates image
47
+ - Returns updated gallery, seed used
48
+ - The `enhance` parameter is currently disabled in the UI but functional in code
49
+
50
+ **`load_models(model_path, enable_compile, attention_backend)`** (app.py:100)
51
+ - Loads VAE, text encoder, tokenizer, and transformer
52
+ - Applies torch.compile optimizations if enabled
53
+ - Configures attention backend (native/flash_3)
54
+
55
+ **`warmup_model(pipe, resolutions)`** (app.py:205)
56
+ - Pre-warms model for all resolution configurations
57
+ - Reduces first-generation latency
58
+
59
+ ### Resolution System
60
+
61
+ The app supports two resolution categories (1024 and 1280) with multiple aspect ratios:
62
+ - 1:1, 9:7, 7:9, 4:3, 3:4, 3:2, 2:3, 16:9, 9:16, 21:9, 9:21
63
+ - Resolutions are stored in `RES_CHOICES` dict and parsed via `get_resolution()`
64
+
65
+ ### Prompt Enhancement (Currently Disabled)
66
+
67
+ The `PromptExpander` and `APIPromptExpander` classes provide optional prompt enhancement via DashScope API:
68
+ - Backend: OpenAI-compatible API at dashscope.aliyuncs.com
69
+ - Model: qwen3-max-preview
70
+ - System prompt from `pe.prompt_template` guides detailed visual description generation
71
+ - UI controls are commented out but underlying code is functional
72
+
73
+ ## Dependencies
74
+
75
+ Install via:
76
+ ```bash
77
+ pip install -r requirements.txt
78
+ ```
79
+
80
+ Key dependencies:
81
+ - gradio (UI framework)
82
+ - torch, transformers, diffusers (ML models)
83
+ - spaces (Hugging Face Spaces integration)
84
+ - openai (for optional prompt enhancement)
85
+ - Custom diffusers fork from GitHub with Z-Image support
86
+
87
+ ## Model Details
88
+
89
+ - Architecture: Single-stream diffusion transformer (Z-Image)
90
+ - Scheduler: FlowMatchEulerDiscreteScheduler with configurable shift parameter
91
+ - Precision: bfloat16
92
+ - Device: CUDA required
93
+ - Attention: Configurable backend (native or flash_3)
94
+
95
+ ## Zero GPU Integration
96
+
97
+ The app uses Hugging Face Spaces Zero GPU features:
98
+ - `@spaces.GPU` decorator on generate function
99
+ - AoTI (Ahead of Time Inductor) compilation for transformer blocks (app.py:458-459)
100
+ - Pre-compiled blocks loaded from "zerogpu-aoti/Z-Image" with flash_attention_3 variant
app.py CHANGED
@@ -68,24 +68,24 @@ for resolutions in RES_CHOICES.values():
68
  RESOLUTION_SET.extend(resolutions)
69
 
70
  EXAMPLE_PROMPTS = [
71
- ["ไธ€ไฝ็”ทๅฃซๅ’Œไป–็š„่ดตๅฎพ็Šฌ็ฉฟ็€้…ๅฅ—็š„ๆœ่ฃ…ๅ‚ๅŠ ็‹—็‹—็ง€๏ผŒๅฎคๅ†…็ฏๅ…‰๏ผŒ่ƒŒๆ™ฏไธญๆœ‰่ง‚ไผ—ใ€‚"],
72
  [
73
- "ๆžๅ…ทๆฐ›ๅ›ดๆ„Ÿ็š„ๆš—่ฐƒไบบๅƒ๏ผŒไธ€ไฝไผ˜้›…็š„ไธญๅ›ฝ็พŽๅฅณๅœจ้ป‘ๆš—็š„ๆˆฟ้—ด้‡Œใ€‚ไธ€ๆŸๅผบๅ…‰้€š่ฟ‡้ฎๅ…‰ๆฟ๏ผŒๅœจๅฅน็š„่„ธไธŠๆŠ•ๅฐ„ๅ‡บไธ€ไธชๆธ…ๆ™ฐ็š„้—ช็”ตๅฝข็Šถ็š„ๅ…‰ๅฝฑ๏ผŒๆญฃๅฅฝ็…งไบฎไธ€ๅช็œผ็›ใ€‚้ซ˜ๅฏนๆฏ”ๅบฆ๏ผŒๆ˜Žๆš—ไบค็•Œๆธ…ๆ™ฐ๏ผŒ็ฅž็ง˜ๆ„Ÿ๏ผŒ่Žฑๅก็›ธๆœบ่‰ฒ่ฐƒใ€‚"
74
  ],
75
  [
76
- "ไธ€ๅผ ไธญๆ™ฏๆ‰‹ๆœบ่‡ชๆ‹็…ง็‰‡ๆ‹ๆ‘„ไบ†ไธ€ไฝ็•™็€้•ฟ้ป‘ๅ‘็š„ๅนด่ฝปไธœไบšๅฅณๅญๅœจ็ฏๅ…‰ๆ˜Žไบฎ็š„็”ตๆขฏๅ†…ๅฏน็€้•œๅญ่‡ชๆ‹ใ€‚ๅฅน็ฉฟ็€ไธ€ไปถๅธฆๆœ‰็™ฝ่‰ฒ่Šฑๆœตๅ›พๆกˆ็š„้ป‘่‰ฒ้œฒ่‚ฉ็ŸญไธŠ่กฃๅ’Œๆทฑ่‰ฒ็‰›ไป”่ฃคใ€‚ๅฅน็š„ๅคดๅพฎๅพฎๅ€พๆ–œ๏ผŒๅ˜ดๅ”‡ๅ˜Ÿ่ตทๅšไบฒๅป็Šถ๏ผŒ้žๅธธๅฏ็ˆฑไฟ็šฎใ€‚ๅฅนๅณๆ‰‹ๆ‹ฟ็€ไธ€้ƒจๆทฑ็ฐ่‰ฒๆ™บ่ƒฝๆ‰‹ๆœบ๏ผŒ้ฎไฝไบ†้ƒจๅˆ†่„ธ๏ผŒๅŽ็ฝฎๆ‘„ๅƒๅคด้•œๅคดๅฏน็€้•œๅญ"
77
  ],
78
  [
79
- "Young Chinese woman in red Hanfu, intricate embroidery. Impeccable makeup, red floral forehead pattern. Elaborate high bun, golden phoenix headdress, red flowers, beads. Holds round folding fan with lady, trees, bird. Neon lightning-bolt lamp (โšก๏ธ), bright yellow glow, above extended left palm. Soft-lit outdoor night background, silhouetted tiered pagoda (่ฅฟๅฎ‰ๅคง้›ๅก”), blurred colorful distant lights."
80
  ],
81
  [
82
- '''A vertical digital illustration depicting a serene and majestic Chinese landscape, rendered in a style reminiscent of traditional Shanshui painting but with a modern, clean aesthetic. The scene is dominated by towering, steep cliffs in various shades of blue and teal, which frame a central valley. In the distance, layers of mountains fade into a light blue and white mist, creating a strong sense of atmospheric perspective and depth. A calm, turquoise river flows through the center of the composition, with a small, traditional Chinese boat, possibly a sampan, navigating its waters. The boat has a bright yellow canopy and a red hull, and it leaves a gentle wake behind it. It carries several indistinct figures of people. Sparse vegetation, including green trees and some bare-branched trees, clings to the rocky ledges and peaks. The overall lighting is soft and diffused, casting a tranquil glow over the entire scene. Centered in the image is overlaid text. At the top of the text block is a small, red, circular seal-like logo containing stylized characters. Below it, in a smaller, black, sans-serif font, are the words 'Zao-Xiang * East Beauty & West Fashion * Z-Image'. Directly beneath this, in a larger, elegant black serif font, is the word 'SHOW & SHARE CREATIVITY WITH THE WORLD'. Among them, there are "SHOW & SHARE", "CREATIVITY", and "WITH THE WORLD"'''
83
  ],
84
  [
85
- """ไธ€ๅผ ่™šๆž„็š„่‹ฑ่ฏญ็”ตๅฝฑใ€Šๅ›žๅฟ†ไน‹ๅ‘ณใ€‹๏ผˆThe Taste of Memory๏ผ‰็š„็”ตๅฝฑๆตทๆŠฅใ€‚ๅœบๆ™ฏ่ฎพ็ฝฎๅœจไธ€ไธช่ดจๆœด็š„19ไธ–็บช้ฃŽๆ ผๅŽจๆˆฟ้‡Œใ€‚็”ป้ขไธญๅคฎ๏ผŒไธ€ไฝ็บขๆฃ•่‰ฒๅคดๅ‘ใ€็•™็€ๅฐ่ƒกๅญ็š„ไธญๅนด็”ทๅญ๏ผˆๆผ”ๅ‘˜้˜ฟ็‘Ÿยทๅฝญๅ“ˆๅˆฉๆ น้ฅฐ๏ผ‰็ซ™ๅœจไธ€ๅผ ๆœจๆกŒๅŽ๏ผŒไป–่บซ็ฉฟ็™ฝ่‰ฒ่กฌ่กซใ€้ป‘่‰ฒ้ฉฌ็”ฒๅ’Œ็ฑณ่‰ฒๅ›ด่ฃ™๏ผŒๆญฃ็œ‹็€ไธ€ไฝๅฅณๅฃซ๏ผŒๆ‰‹ไธญๆ‹ฟ็€ไธ€ๅคงๅ—็”Ÿ็บข่‚‰๏ผŒไธ‹ๆ–นๆ˜ฏไธ€ไธชๆœจๅˆถๅˆ‡่œๆฟใ€‚ๅœจไป–็š„ๅณ่พน๏ผŒไธ€ไฝๆขณ็€้ซ˜้ซป็š„้ป‘ๅ‘ๅฅณๅญ๏ผˆๆผ”ๅ‘˜ๅŸƒ่މ่ฏบยทไธ‡ๆ–ฏ้ฅฐ๏ผ‰ๅ€š้ ๅœจๆกŒๅญไธŠ๏ผŒๆธฉๆŸ”ๅœฐๅฏนไป–ๅพฎ็ฌ‘ใ€‚ๅฅน็ฉฟ็€ๆต…่‰ฒ่กฌ่กซๅ’Œไธ€ๆกไธŠ็™ฝไธ‹่“็š„้•ฟ่ฃ™ใ€‚ๆกŒไธŠ้™คไบ†ๆ”พๆœ‰ๅˆ‡็ขŽ็š„่‘ฑๅ’Œๅทๅฟƒ่œไธ็š„ๅˆ‡่œๆฟๅค–๏ผŒ่ฟ˜ๆœ‰ไธ€ไธช็™ฝ่‰ฒ้™ถ็“ท็›˜ใ€ๆ–ฐ้ฒœ้ฆ™่‰๏ผŒๅทฆไพงไธ€ไธชๆœจ็ฎฑไธŠๆ”พ็€ไธ€ไธฒๆทฑ่‰ฒ่‘ก่„ใ€‚่ƒŒๆ™ฏๆ˜ฏไธ€้ข็ฒ—็ณ™็š„็ฐ็™ฝ่‰ฒๆŠน็ฐๅข™๏ผŒๅข™ไธŠๆŒ‚็€ไธ€ๅน…้ฃŽๆ™ฏ็”ปใ€‚ๆœ€ๅณ่พน็š„ไธ€ไธชๅฐ้ขไธŠๆ”พ็€ไธ€็›ๅคๅคๆฒน็ฏใ€‚ๆตทๆŠฅไธŠๆœ‰ๅคง้‡็š„ๆ–‡ๅญ—ไฟกๆฏใ€‚ๅทฆไธŠ่ง’ๆ˜ฏ็™ฝ่‰ฒ็š„ๆ— ่กฌ็บฟๅญ—ไฝ“"ARTISAN FILMS PRESENTS"๏ผŒๅ…ถไธ‹ๆ–นๆ˜ฏ"ELEANOR VANCE"ๅ’Œ"ACADEMY AWARDยฎ WINNER"ใ€‚ๅณไธŠ่ง’ๅ†™็€"ARTHUR PENHALIGON"ๅ’Œ"GOLDEN GLOBEยฎ AWARD WINNER"ใ€‚้กถ้ƒจไธญๅคฎๆ˜ฏๅœฃไธนๆ–ฏ็”ตๅฝฑ่Š‚็š„ๆก‚ๅ† ๆ ‡ๅฟ—๏ผŒไธ‹ๆ–นๅ†™็€"SUNDANCE FILM FESTIVAL GRAND JURY PRIZE 2024"ใ€‚ไธปๆ ‡้ข˜"THE TASTE OF MEMORY"ไปฅ็™ฝ่‰ฒ็š„ๅคงๅท่กฌ็บฟๅญ—ไฝ“้†’็›ฎๅœฐๆ˜พ็คบๅœจไธ‹ๅŠ้ƒจๅˆ†ใ€‚ๆ ‡้ข˜ไธ‹ๆ–นๆณจๆ˜Žไบ†"A FILM BY Tongyi Interaction Lab"ใ€‚ๅบ•้ƒจๅŒบๅŸŸ็”จ็™ฝ่‰ฒๅฐๅญ—ๅˆ—ๅ‡บไบ†ๅฎŒๆ•ด็š„ๆผ”่Œๅ‘˜ๅๅ•๏ผŒๅŒ…ๆ‹ฌ"SCREENPLAY BY ANNA REID"ใ€"CULINARY DIRECTION BY JAMES CARTER"ไปฅๅŠArtisan Filmsใ€Riverstone Picturesๅ’ŒHeritage Media็ญ‰ไผ—ๅคšๅ‡บๅ“ๅ…ฌๅธๆ ‡ๅฟ—ใ€‚ๆ•ดไฝ“้ฃŽๆ ผๆ˜ฏๅ†™ๅฎžไธปไน‰๏ผŒ้‡‡็”จๆธฉๆš–ๆŸ”ๅ’Œ็š„็ฏๅ…‰ๆ–นๆกˆ๏ผŒ่ฅ้€ ๅ‡บไธ€็งไบฒๅฏ†็š„ๆฐ›ๅ›ดใ€‚่‰ฒ่ฐƒไปฅๆฃ•่‰ฒใ€็ฑณ่‰ฒๅ’ŒๆŸ”ๅ’Œ็š„็ปฟ่‰ฒ็ญ‰ๅคงๅœฐ่‰ฒ็ณปไธบไธปใ€‚ไธคไฝๆผ”ๅ‘˜็š„่บซไฝ“้ƒฝๅœจ่…ฐ้ƒจ่ขซๆˆชๆ–ญใ€‚"""
86
  ],
87
  [
88
- """ไธ€ๅผ ๆ–นๅฝขๆž„ๅ›พ็š„็‰นๅ†™็…ง็‰‡๏ผŒไธปไฝ“ๆ˜ฏไธ€็‰‡ๅทจๅคง็š„ใ€้ฒœ็ปฟ่‰ฒ็š„ๆค็‰ฉๅถ็‰‡๏ผŒๅนถๅ ๅŠ ไบ†ๆ–‡ๅญ—๏ผŒไฝฟๅ…ถๅ…ทๆœ‰ๆตทๆŠฅๆˆ–ๆ‚ๅฟ—ๅฐ้ข็š„ๅค–่ง‚ใ€‚ไธป่ฆๆ‹ๆ‘„ๅฏน่ฑกๆ˜ฏไธ€็‰‡ๅŽšๅฎžใ€ๆœ‰่œก่ดจๆ„Ÿ็š„ๅถๅญ๏ผŒไปŽๅทฆไธ‹่ง’ๅˆฐๅณไธŠ่ง’ๅ‘ˆๅฏน่ง’็บฟๅผฏๆ›ฒ็ฉฟ่ฟ‡็”ป้ขใ€‚ๅ…ถ่กจ้ขๅๅ…‰ๆ€งๅพˆๅผบ๏ผŒๆ•ๆ‰ๅˆฐไธ€ไธชๆ˜Žไบฎ็š„็›ดๅฐ„ๅ…‰ๆบ๏ผŒๅฝขๆˆไบ†ไธ€้“็ชๅ‡บ็š„้ซ˜ๅ…‰๏ผŒไบฎ้ขไธ‹ๆ˜พ้œฒๅ‡บๅนณ่กŒ็š„็ฒพ็ป†ๅถ่„‰ใ€‚่ƒŒๆ™ฏ็”ฑๅ…ถไป–ๆทฑ็ปฟ่‰ฒ็š„ๅถๅญ็ป„ๆˆ๏ผŒ่ฟ™ไบ›ๅถๅญ่ฝปๅพฎๅคฑ็„ฆ๏ผŒ่ฅ้€ ๅ‡บๆต…ๆ™ฏๆทฑๆ•ˆๆžœ๏ผŒ็ชๅ‡บไบ†ๅ‰ๆ™ฏ็š„ไธปๅถ็‰‡ใ€‚ๆ•ดไฝ“้ฃŽๆ ผๆ˜ฏๅ†™ๅฎžๆ‘„ๅฝฑ๏ผŒๆ˜Žไบฎ็š„ๅถ็‰‡ไธŽ้ป‘ๆš—็š„้˜ดๅฝฑ่ƒŒๆ™ฏไน‹้—ดๅฝขๆˆ้ซ˜ๅฏนๆฏ”ๅบฆใ€‚ๅ›พๅƒไธŠๆœ‰ๅคšๅค„ๆธฒๆŸ“ๆ–‡ๅญ—ใ€‚ๅทฆไธŠ่ง’ๆ˜ฏ็™ฝ่‰ฒ็š„่กฌ็บฟๅญ—ไฝ“ๆ–‡ๅญ—"PIXEL-PEEPERS GUILD Presents"ใ€‚ๅณไธŠ่ง’ๅŒๆ ทๆ˜ฏ็™ฝ่‰ฒ่กฌ็บฟๅญ—ไฝ“็š„ๆ–‡ๅญ—"[Instant Noodle] ๆณก้ข่ฐƒๆ–™ๅŒ…"ใ€‚ๅทฆไพงๅž‚็›ดๆŽ’ๅˆ—็€ๆ ‡้ข˜"Render Distance: Max"๏ผŒไธบ็™ฝ่‰ฒ่กฌ็บฟๅญ—ไฝ“ใ€‚ๅทฆไธ‹่ง’ๆ˜ฏไบ”ไธช็ก•ๅคง็š„็™ฝ่‰ฒๅฎ‹ไฝ“ๆฑ‰ๅญ—"ๆ˜พๅกๅœจ...็‡ƒ็ƒง"ใ€‚ๅณไธ‹่ง’ๆ˜ฏ่พƒๅฐ็š„็™ฝ่‰ฒ่กฌ็บฟๅญ—ไฝ“ๆ–‡ๅญ—"Leica Glowโ„ข Unobtanium X-1"๏ผŒๅ…ถๆญฃไธŠๆ–นๆ˜ฏ็”จ็™ฝ่‰ฒๅฎ‹ไฝ“ๅญ—ไนฆๅ†™็š„ๅๅญ—"่”กๅ‡ "ใ€‚่ฏ†ๅˆซๅ‡บ็š„ๆ ธๅฟƒๅฎžไฝ“ๅŒ…ๆ‹ฌๅ“็‰Œๅƒ็ด ๅท็ชฅ่€…ๅไผšใ€ๅ…ถไบงๅ“็บฟๆณก้ข่ฐƒๆ–™ๅŒ…ใ€็›ธๆœบๅž‹ๅทไนฐไธๅˆฐโ„ข X-1ไปฅๅŠๆ‘„ๅฝฑๅธˆๅๅญ—้€ ็›ธใ€‚"""
89
  ],
90
  ]
91
 
@@ -348,19 +348,19 @@ def init_app():
348
 
349
  def prompt_enhance(prompt, enable_enhance):
350
  if not enable_enhance or not prompt_expander:
351
- return prompt, "Enhancement disabled or not available."
352
 
353
  if not prompt.strip():
354
- return "", "Please enter a prompt."
355
 
356
  try:
357
  result = prompt_expander(prompt)
358
  if result.status:
359
  return result.prompt, result.message
360
  else:
361
- return prompt, f"Enhancement failed: {result.message}"
362
  except Exception as e:
363
- return prompt, f"Error: {str(e)}"
364
 
365
 
366
  @spaces.GPU
@@ -416,7 +416,7 @@ def generate(
416
  - seed_int: Integer representation of the seed used for generation
417
  """
418
  if pipe is None:
419
- raise gr.Error("Model not loaded.")
420
 
421
  final_prompt = prompt
422
 
@@ -458,53 +458,53 @@ init_app()
458
  pipe.transformer.layers._repeated_blocks = ["ZImageTransformerBlock"]
459
  spaces.aoti_blocks_load(pipe.transformer.layers, "zerogpu-aoti/Z-Image", variant="fa3")
460
 
461
- with gr.Blocks(title="Z-Image Demo") as demo:
462
  gr.Markdown(
463
  """<div align="center">
464
-
465
- # Z-Image Generation Demo
466
 
467
  [![GitHub](https://img.shields.io/badge/GitHub-Z--Image-181717?logo=github&logoColor=white)](https://github.com/Tongyi-MAI/Z-Image)
468
 
469
- *An Efficient Image Generation Foundation Model with Single-Stream Diffusion Transformer*
470
 
471
  </div>"""
472
  )
473
 
474
  with gr.Row():
475
  with gr.Column(scale=1):
476
- prompt_input = gr.Textbox(label="Prompt", lines=3, placeholder="Enter your prompt here...")
477
  # PE components (Temporarily disabled)
478
  # with gr.Row():
479
- # enable_enhance = gr.Checkbox(label="Enhance Prompt (DashScope)", value=False)
480
- # enhance_btn = gr.Button("Enhance Only")
481
 
482
  with gr.Row():
483
  choices = [int(k) for k in RES_CHOICES.keys()]
484
- res_cat = gr.Dropdown(value=1024, choices=choices, label="Resolution Category")
485
 
486
  initial_res_choices = RES_CHOICES["1024"]
487
- resolution = gr.Dropdown(value=initial_res_choices[0], choices=RESOLUTION_SET, label="Width x Height (Ratio)")
488
 
489
  with gr.Row():
490
- seed = gr.Number(label="Seed", value=42, precision=0)
491
- random_seed = gr.Checkbox(label="Random Seed", value=True)
492
 
493
  with gr.Row():
494
- steps = gr.Slider(label="Steps", minimum=1, maximum=100, value=8, step=1, interactive=False)
495
- shift = gr.Slider(label="Time Shift", minimum=1.0, maximum=10.0, value=3.0, step=0.1)
496
 
497
- generate_btn = gr.Button("Generate", variant="primary")
498
 
499
  # Example prompts
500
- gr.Markdown("### ๐Ÿ“ Example Prompts")
501
  gr.Examples(examples=EXAMPLE_PROMPTS, inputs=prompt_input, label=None)
502
 
503
  with gr.Column(scale=1):
504
  output_gallery = gr.Gallery(
505
- label="Generated Images", columns=2, rows=2, height=600, object_fit="contain", format="png", interactive=False
506
  )
507
- used_seed = gr.Textbox(label="Seed Used", interactive=False)
508
 
509
  def update_res_choices(_res_cat):
510
  if str(_res_cat) in RES_CHOICES:
 
68
  RESOLUTION_SET.extend(resolutions)
69
 
70
  EXAMPLE_PROMPTS = [
71
+ ["ํ•œ ๋‚จ์„ฑ๊ณผ ๊ทธ์˜ ํ‘ธ๋“ค์ด ์–ด์šธ๋ฆฌ๋Š” ์˜์ƒ์„ ์ž…๊ณ  ์‹ค๋‚ด ์กฐ๋ช… ์•„๋ž˜ ๊ด€๊ฐ๋“ค์ด ์žˆ๋Š” ๋ฐฐ๊ฒฝ์—์„œ ๊ฐœ ์‡ผ์— ์ฐธ๊ฐ€ํ•˜๊ณ  ์žˆ๋Š” ๋ชจ์Šต."],
72
  [
73
+ "๋ถ„์œ„๊ธฐ ์žˆ๋Š” ์–ด๋‘์šด ํ†ค์˜ ์ธ๋ฌผ ์‚ฌ์ง„, ์šฐ์•„ํ•œ ์ค‘๊ตญ ์—ฌ์„ฑ์ด ์–ด๋‘์šด ๋ฐฉ์— ์žˆ๋‹ค. ๊ฐ•ํ•œ ๋น›์ด ์…”ํ„ฐ๋ฅผ ํ†ต๊ณผํ•ด ๊ทธ๋…€์˜ ์–ผ๊ต—์— ๋ฒˆ๊ฐœ ๋ชจ์–‘์˜ ์„ ๋ช…ํ•œ ๋น›๊ณผ ๊ทธ๋ฆผ์ž๋ฅผ ํˆฌ์‚ฌํ•˜๋ฉฐ ํ•œ์ชฝ ๋ˆˆ๋งŒ์„ ์ •ํ™•ํžˆ ๋น„์ถ˜๋‹ค. ๋†’์€ ๋Œ€๋น„, ๋ช…์•” ๊ฒฝ๊ณ„๊ฐ€ ์„ ๋ช…ํ•˜๋ฉฐ, ์‹ ๋น„๋กœ์šด ๋А๋‚Œ, ๋ผ์ด์นด ์นด๋ฉ”๋ผ ์ƒ‰์กฐ."
74
  ],
75
  [
76
+ "๋ฐ๊ฒŒ ์กฐ๋ช…๋œ ์—˜๋ฆฌ๋ฒ ์ดํ„ฐ ์•ˆ์—์„œ ๊ธด ๊ฒ€์€ ๋จธ๋ฆฌ๋ฅผ ํ•œ ์ Š์€ ๋™์•„์‹œ์•„ ์—ฌ์„ฑ์ด ๊ฑฐ์šธ์„ ํ–ฅํ•ด ์…€์นด๋ฅผ ์ฐ๋Š” ์ค‘๊ฐ„ ๊ฑฐ๋ฆฌ ์Šค๋งˆํŠธํฐ ์…€์นด ์‚ฌ์ง„. ๊ทธ๋…€๋Š” ํฐ์ƒ‰ ๊ฝƒ๋ฌด๋Šฌ๊ฐ€ ์žˆ๋Š” ๊ฒ€์€์ƒ‰ ์˜คํ”„์ˆ„๋” ํฌ๋กญํƒ‘๊ณผ ์–ด๋‘์šด ์ฒญ๋ฐ”์ง€๋ฅผ ์ž…๊ณ  ์žˆ๋‹ค. ๋จธ๋ฆฌ๋ฅผ ์•ฝ๊ฐ„ ๊ธฐ์šธ์ด๊ณ  ์ž…์ˆ ์„ ๋พฐ์กฑํ•˜๊ฒŒ ๋‚ด๋ฐ€์–ด ํ‚ค์Šคํ•˜๋Š” ๋“ฏํ•œ ํฌ์ฆˆ๋กœ ๋งค์šฐ ๊ท€์—ฝ๊ณ  ์žฅ๋‚œ์Šค๋Ÿฌ์šด ๋ชจ์Šต์ด๋‹ค. ์˜ค๋ฅธ์†์— ์ง™์€ ํšŒ์ƒ‰ ์Šค๋งˆํŠธํฐ์„ ๋“ค๊ณ  ์–ผ๊ตด ์ผ๋ถ€๋ฅผ ๊ฐ€๋ฆฌ๊ณ  ์žˆ์œผ๋ฉฐ, ํ›„๋ฉด ์นด๋ฉ”๋ผ ๋ Œ์ฆˆ๊ฐ€ ๊ฑฐ์šธ์„ ํ–ฅํ•˜๊ณ  ์žˆ๋‹ค."
77
  ],
78
  [
79
+ "๋นจ๊ฐ„ ํ•œํ‘ธ๋ฅผ ์ž…์€ ์ Š์€ ์ค‘๊ตญ ์—ฌ์„ฑ, ์ •๊ตํ•œ ์ž์ˆ˜. ์™„๋ฒฝํ•œ ๋ฉ”์ดํฌ์—…, ๋ถ‰์€ ๊ฝƒ๋ฌด๋Šฌ ์ด๋งˆ ์žฅ์‹. ์ •๊ตํ•œ ๋†’์€ ์ชฝ์ง„ ๋จธ๋ฆฌ, ๊ธˆ๋น› ๋ด‰ํ™ฉ ๋จธ๋ฆฌ ์žฅ์‹, ๋ถ‰์€ ๊ฝƒ, ๊ตฌ์Šฌ. ์—ฌ์ธ๊ณผ ๋‚˜๋ฌด, ์ƒˆ๊ฐ€ ๊ทธ๋ ค์ง„ ๋‘ฅ๊ทผ ์ ‘์ด์‹ ๋ถ€์ฑ„๋ฅผ ๋“ค๊ณ  ์žˆ๋‹ค. ๋„ค์˜จ ๋ฒˆ๊ฐœ ๋ชจ์–‘ ๋žจํ”„ (โšก๏ธ), ๋ฐ์€ ๋…ธ๋ž€์ƒ‰ ๋น›, ํŽผ์นœ ์™ผ์ชฝ ์†๋ฐ”๋‹ฅ ์œ„์—. ๋ถ€๋“œ๋Ÿฝ๊ฒŒ ์กฐ๋ช…๋œ ์•ผ์™ธ ๋ฐค ๋ฐฐ๊ฒฝ, ์‹ค๋ฃจ์—ฃ์˜ ๋‹ค์ธต ํƒ‘(์„œ์•ˆ ๋Œ€์•ˆํƒ‘), ํ๋ฆฟํ•œ ์ปฌ๋Ÿฌ ๋จผ ๋ถˆ๋น›๋“ค."
80
  ],
81
  [
82
+ '''๊ณ ์š”ํ•˜๊ณ  ์žฅ์—„ํ•œ ์ค‘๊ตญ ํ’๊ฒฝ์„ ๋ฌ˜์‚ฌํ•œ ์„ธ๋กœ ํ˜•์‹์˜ ๋””์ง€ํ„ธ ์ผ๋Ÿฌ์ŠคํŠธ๋ ˆ์ด์…˜์œผ๋กœ, ์ „ํ†ต์ ์ธ ์‚ฐ์ˆ˜ํ™” ์Šคํƒ€์ผ์„ ํ˜„๋Œ€์ ์ด๊ณ  ๊น”๋”ํ•œ ๋ฏธํ•™์œผ๋กœ ์žฌํ•ด์„ํ–ˆ๋‹ค. ์žฅ๋ฉด์€ ์ค‘์•™ ๊ณ„๊ณก์„ ๋‘˜๋Ÿฌ์‹ผ ๋‹ค์–‘ํ•œ ํŒŒ๋ž€์ƒ‰๊ณผ ์ฒญ๋ก์ƒ‰ ์Œ์˜์˜ ์šฐ๋š ์†Ÿ์€ ๊ฐ€ํŒŒ๋ฅธ ์ ˆ๋ฒฝ์ด ์ง€๋ฐฐํ•œ๋‹ค. ๋ฉ€๋ฆฌ ์‚ฐ๋“ค์ด ์ธต์ธต์ด ์—ฐํ•œ ํŒŒ๋ž€์ƒ‰๊ณผ ํฐ์ƒ‰ ์•ˆ๊ฐœ ์†์œผ๋กœ ์‚ฌ๋ผ์ง€๋ฉฐ ๊ฐ•ํ•œ ๋Œ€๊ธฐ ์›๊ทผ๊ฐ๊ณผ ๊นŠ์ด๋ฅผ ๋งŒ๋“ค์–ด๋‚ธ๋‹ค. ๊ณ ์š”ํ•œ ์ฒญ๋ก์ƒ‰ ๊ฐ•์ด ๊ตฌ์„ฑ์˜ ์ค‘์•™์„ ๊ฐ€๋กœ์งˆ๋Ÿฌ ํ๋ฅด๋ฉฐ, ์ž‘์€ ์ „ํ†ต ์ค‘๊ตญ ๋ฐฐ, ์•„๋งˆ๋„ ์‚ผํŒ์ด ๋ฌผ ์œ„๋ฅผ ํ•ญํ•ดํ•˜๊ณ  ์žˆ๋‹ค. ๋ฐฐ๋Š” ๋ฐ์€ ๋…ธ๋ž€์ƒ‰ ์ฒœ๋ง‰๊ณผ ๋ถ‰์€ ์„ ์ฒด๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ์œผ๋ฉฐ ๋’ค์— ๋ถ€๋“œ๋Ÿฌ์šด ๋ฌผ๊ฒฐ์„ ๋‚จ๊ธด๋‹ค. ์—ฌ๋Ÿฌ ๋ช…์˜ ํฌ๋ฏธํ•œ ์ธ๋ฌผ๋“ค์„ ํƒœ์šฐ๊ณ  ์žˆ๋‹ค. ๋…น์ƒ‰ ๋‚˜๋ฌด์™€ ์ผ๋ถ€ ๋งจ๊ฐ€์ง€ ๋‚˜๋ฌด๋ฅผ ํฌํ•จํ•œ ๋“œ๋ฌธ๋“œ๋ฌธํ•œ ์‹์ƒ์ด ๋ฐ”์œ„ ์„ ๋ฐ˜๊ณผ ๋ด‰์šฐ๋ฆฌ์— ๋ถ™์–ด ์žˆ๋‹ค. ์ „์ฒด ์กฐ๋ช…์€ ๋ถ€๋“œ๋Ÿฝ๊ณ  ํ™•์‚ฐ๋˜์–ด ์ „์ฒด ์žฅ๋ฉด์— ํ‰์˜จํ•œ ๋น›์„ ๋“œ๋ฆฌ์šด๋‹ค. ์ด๋ฏธ์ง€ ์ค‘์•™์— ํ…์ŠคํŠธ๊ฐ€ ๊ฒน์ณ์ ธ ์žˆ๋‹ค. ํ…์ŠคํŠธ ๋ธ”๋ก ์ƒ๋‹จ์—๋Š” ์–‘์‹ํ™”๋œ ๋ฌธ์ž๊ฐ€ ํฌํ•จ๋œ ์ž‘๊ณ  ๋นจ๊ฐ„์ƒ‰์˜ ์›ํ˜• ๋„์žฅ ๊ฐ™์€ ๋กœ๊ณ ๊ฐ€ ์žˆ๋‹ค. ๊ทธ ์•„๋ž˜ ์ž‘์€ ๊ฒ€์€์ƒ‰ ์‚ฐ์„ธ๋ฆฌํ”„ ๊ธ€๊ผด๋กœ 'Zao-Xiang * East Beauty & West Fashion * Z-Image'๋ผ๋Š” ๋‹จ์–ด๊ฐ€ ์žˆ๋‹ค. ๊ทธ ๋ฐ”๋กœ ์•„๋ž˜ ๋” ํฐ ์šฐ์•„ํ•œ ๊ฒ€์€์ƒ‰ ์„ธ๋ฆฌํ”„ ๊ธ€๊ผด๋กœ 'SHOW & SHARE CREATIVITY WITH THE WORLD'๋ผ๋Š” ๋‹จ์–ด๊ฐ€ ์žˆ๋‹ค. ๊ทธ ์ค‘์—๋Š” "SHOW & SHARE", "CREATIVITY", "WITH THE WORLD"๊ฐ€ ์žˆ๋‹ค.'''
83
  ],
84
  [
85
+ """๊ฐ€์ƒ์˜ ์˜ํ™” ใ€ŠํšŒ์ƒ์˜ ๋ง›ใ€‹(The Taste of Memory)์˜ ์˜ํ™” ํฌ์Šคํ„ฐ. ์žฅ๋ฉด์€ ์†Œ๋ฐ•ํ•œ 19์„ธ๊ธฐ ์Šคํƒ€์ผ ์ฃผ๋ฐฉ์— ์„ค์ •๋˜์–ด ์žˆ๋‹ค. ํ™”๋ฉด ์ค‘์•™์— ์ ๊ฐˆ์ƒ‰ ๋จธ๋ฆฌ์™€ ์ž‘์€ ์ฝง์ˆ˜์—ผ์„ ๊ฐ€์ง„ ์ค‘๋…„ ๋‚จ์„ฑ(๋ฐฐ์šฐ ์•„์„œ ํŽœํ• ๋ฆฌ๊ฑด ์—ฐ๊ธฐ)์ด ๋‚˜๋ฌด ํ…Œ์ด๋ธ” ๋’ค์— ์„œ ์žˆ์œผ๋ฉฐ, ํฐ์ƒ‰ ์…”์ธ , ๊ฒ€์€์ƒ‰ ์กฐ๋ผ, ๋ฒ ์ด์ง€์ƒ‰ ์•ž์น˜๋งˆ๋ฅผ ์ž…๊ณ  ์žˆ๊ณ  ํ•œ ์—ฌ์„ฑ์„ ๋ฐ”๋ผ๋ณด๋ฉฐ ์†์— ํฐ ๋ฉ์–ด๋ฆฌ์˜ ์ƒ๊ณ ๊ธฐ๋ฅผ ๋“ค๊ณ  ์žˆ์œผ๋ฉฐ ์•„๋ž˜์—๋Š” ๋‚˜๋ฌด ๋„๋งˆ๊ฐ€ ์žˆ๋‹ค. ๊ทธ์˜ ์˜ค๋ฅธ์ชฝ์—๋Š” ๋†’์€ ์ชฝ์ง„ ๋จธ๋ฆฌ๋ฅผ ํ•œ ๊ฒ€์€ ๋จธ๋ฆฌ ์—ฌ์„ฑ(๋ฐฐ์šฐ ์—˜๋ฆฌ๋„ˆ ๋ฐด์Šค ์—ฐ๊ธฐ)์ด ํ…Œ์ด๋ธ”์— ๊ธฐ๋Œ€์–ด ๊ทธ์—๊ฒŒ ๋ถ€๋“œ๋Ÿฝ๊ฒŒ ๋ฏธ์†Œ์ง“๊ณ  ์žˆ๋‹ค. ๊ทธ๋…€๋Š” ์—ฐํ•œ ์ƒ‰ ์…”์ธ ์™€ ์ƒ๋‹จ์€ ํฐ์ƒ‰, ํ•˜๋‹จ์€ ํŒŒ๋ž€์ƒ‰์ธ ๊ธด ์น˜๋งˆ๋ฅผ ์ž…๊ณ  ์žˆ๋‹ค. ํ…Œ์ด๋ธ” ์œ„์—๋Š” ๋‹ค์ง„ ํŒŒ์™€ ์–‘๋ฐฐ์ถ” ์ฑ„๊ฐ€ ์žˆ๋Š” ๋„๋งˆ ์™ธ์—๋„ ํฐ์ƒ‰ ๋„์ž๊ธฐ ์ ‘์‹œ, ์‹ ์„ ํ•œ ํ—ˆ๋ธŒ๊ฐ€ ์žˆ๊ณ , ์™ผ์ชฝ ๋‚˜๋ฌด ์ƒ์ž ์œ„์—๋Š” ์ง™์€ ์ƒ‰ ํฌ๋„ ํ•œ ์†ก์ด๊ฐ€ ๋†“์—ฌ ์žˆ๋‹ค. ๋ฐฐ๊ฒฝ์€ ๊ฑฐ์น ๊ฒŒ ํšŒ๋ฐฑ์ƒ‰์œผ๋กœ ๋ฏธ์žฅ๋œ ๋ฒฝ์ด๋ฉฐ ํ’๊ฒฝํ™” ํ•œ ์ ์ด ๊ฑธ๋ ค ์žˆ๋‹ค. ๊ฐ€์žฅ ์˜ค๋ฅธ์ชฝ ์ž‘์—…๋Œ€ ์œ„์—๋Š” ๋ณต๊ณ ํ’ ์˜ค์ผ ๋žจํ”„๊ฐ€ ๋†“์—ฌ ์žˆ๋‹ค. ํฌ์Šคํ„ฐ์—๋Š” ๋งŽ์€ ํ…์ŠคํŠธ ์ •๋ณด๊ฐ€ ์žˆ๋‹ค. ์™ผ์ชฝ ์ƒ๋‹จ์—๋Š” ํฐ์ƒ‰ ์‚ฐ์„ธ๋ฆฌํ”„ ๊ธ€๊ผด๋กœ "ARTISAN FILMS PRESENTS"๊ฐ€ ์žˆ๊ณ  ๊ทธ ์•„๋ž˜์— "ELEANOR VANCE"์™€ "ACADEMY AWARDยฎ WINNER"๊ฐ€ ์žˆ๋‹ค. ์˜ค๋ฅธ์ชฝ ์ƒ๋‹จ์—๋Š” "ARTHUR PENHALIGON"๊ณผ "GOLDEN GLOBEยฎ AWARD WINNER"๊ฐ€ ์“ฐ์—ฌ ์žˆ๋‹ค. ์ƒ๋‹จ ์ค‘์•™์—๋Š” ์„ ๋Œ„์Šค ์˜ํ™”์ œ ์›”๊ณ„๊ด€ ๋กœ๊ณ ๊ฐ€ ์žˆ๊ณ  ์•„๋ž˜์— "SUNDANCE FILM FESTIVAL GRAND JURY PRIZE 2024"๊ฐ€ ์“ฐ์—ฌ ์žˆ๋‹ค. ์ฃผ์š” ์ œ๋ชฉ "THE TASTE OF MEMORY"๋Š” ํฐ์ƒ‰์˜ ํฐ ์„ธ๋ฆฌํ”„ ๊ธ€๊ผด๋กœ ํ•˜๋‹จ์— ๋ˆˆ์— ๋„๊ฒŒ ํ‘œ์‹œ๋˜์–ด ์žˆ๋‹ค. ์ œ๋ชฉ ์•„๋ž˜์—๋Š” "A FILM BY Tongyi Interaction Lab"์ด ๋ช…์‹œ๋˜์–ด ์žˆ๋‹ค. ํ•˜๋‹จ ์˜์—ญ์—๋Š” ํฐ์ƒ‰ ์ž‘์€ ๊ธ€์”จ๋กœ "SCREENPLAY BY ANNA REID", "CULINARY DIRECTION BY JAMES CARTER" ๋ฐ Artisan Films, Riverstone Pictures, Heritage Media ๋“ฑ ์ˆ˜๋งŽ์€ ์ œ์ž‘์‚ฌ ๋กœ๊ณ ๋ฅผ ํฌํ•จํ•œ ์ „์ฒด ์ถœ์—ฐ์ง„ ๋ฐ ์ œ์ž‘์ง„ ๋ช…๋‹จ์ด ๋‚˜์—ด๋˜์–ด ์žˆ๋‹ค. ์ „์ฒด์ ์ธ ์Šคํƒ€์ผ์€ ์‚ฌ์‹ค์ฃผ์˜๋กœ ๋”ฐ๋œปํ•˜๊ณ  ๋ถ€๋“œ๋Ÿฌ์šด ์กฐ๋ช… ๋ฐฉ์‹์„ ์ฑ„ํƒํ•˜์—ฌ ์นœ๋ฐ€ํ•œ ๋ถ„์œ„๊ธฐ๋ฅผ ์กฐ์„ฑํ•œ๋‹ค. ์ƒ‰์กฐ๋Š” ๊ฐˆ์ƒ‰, ๋ฒ ์ด์ง€, ๋ถ€๋“œ๋Ÿฌ์šด ๋…น์ƒ‰ ๋“ฑ ๋Œ€์ง€์ƒ‰ ํ†ค์ด ์ฃผ๋ฅผ ์ด๋ฃฌ๋‹ค. ๋‘ ๋ฐฐ์šฐ์˜ ๋ชธ์€ ๋ชจ๋‘ ํ—ˆ๋ฆฌ์—์„œ ์ž˜๋ ค ์žˆ๋‹ค."""
86
  ],
87
  [
88
+ """์ •์‚ฌ๊ฐํ˜• ๊ตฌ๋„์˜ ํด๋กœ์ฆˆ์—… ์‚ฌ์ง„์œผ๋กœ, ๊ฑฐ๋Œ€ํ•˜๊ณ  ์„ ๋ช…ํ•œ ๋…น์ƒ‰ ์‹๋ฌผ ์žŽ์ด ์ฃผ์ œ์ด๋ฉฐ ํ…์ŠคํŠธ๊ฐ€ ๊ฒน์ณ์ ธ ํฌ์Šคํ„ฐ๋‚˜ ์žก์ง€ ํ‘œ์ง€ ๊ฐ™์€ ์™ธ๊ด€์„ ๊ฐ–์ถ”๊ณ  ์žˆ๋‹ค. ์ฃผ์š” ํ”ผ์‚ฌ์ฒด๋Š” ์™ผ์ชฝ ํ•˜๋‹จ์—์„œ ์˜ค๋ฅธ์ชฝ ์ƒ๋‹จ์œผ๋กœ ๋Œ€๊ฐ์„ ์œผ๋กœ ๊ตฌ๋ถ€๋Ÿฌ์ ธ ํ”„๋ ˆ์ž„์„ ๊ฐ€๋กœ์ง€๋ฅด๋Š” ๋‘๊ป๊ณ  ์™์Šค ๊ฐ™์€ ์งˆ๊ฐ์˜ ์žŽ์ด๋‹ค. ํ‘œ๋ฉด์ด ๋งค์šฐ ๋ฐ˜์‚ฌ์ ์ด์–ด์„œ ๋ฐ์€ ์ง์‚ฌ๊ด‘์›์„ ํฌ์ฐฉํ•˜์—ฌ ๋‘๋“œ๋Ÿฌ์ง„ ํ•˜์ด๋ผ์ดํŠธ๋ฅผ ํ˜•์„ฑํ•˜๊ณ  ๋ฐ์€ ๋ฉด ์•„๋ž˜ ํ‰ํ–‰ํ•œ ๋ฏธ์„ธ ์žŽ๋งฅ์ด ๋“œ๋Ÿฌ๋‚œ๋‹ค. ๋ฐฐ๊ฒฝ์€ ๋‹ค๋ฅธ ์ง™์€ ๋…น์ƒ‰ ์žŽ๋“ค๋กœ ๊ตฌ์„ฑ๋˜์–ด ์žˆ์œผ๋ฉฐ ์•ฝ๊ฐ„ ์ดˆ์ ์ด ํ๋ ค์ ธ ์–•์€ ํ”ผ์‚ฌ๊ณ„ ์‹ฌ๋„ ํšจ๊ณผ๋ฅผ ๋งŒ๋“ค์–ด ์ „๊ฒฝ์˜ ์ฃผ์š” ์žŽ์„ ๊ฐ•์กฐํ•œ๋‹ค. ์ „์ฒด์ ์ธ ์Šคํƒ€์ผ์€ ์‚ฌ์‹ค์ ์ธ ์‚ฌ์ง„์œผ๋กœ ๋ฐ์€ ์žŽ๊ณผ ์–ด๋‘์šด ๊ทธ๋ฆผ์ž ๋ฐฐ๊ฒฝ ์‚ฌ์ด์— ๋†’์€ ๋Œ€๋น„๋ฅผ ํ˜•์„ฑํ•œ๋‹ค. ์ด๋ฏธ์ง€์—๋Š” ์—ฌ๋Ÿฌ ๋ Œ๋”๋ง๋œ ํ…์ŠคํŠธ๊ฐ€ ์žˆ๋‹ค. ์™ผ์ชฝ ์ƒ๋‹จ์—๋Š” ํฐ์ƒ‰ ์„ธ๋ฆฌํ”„ ๊ธ€๊ผด๋กœ "PIXEL-PEEPERS GUILD Presents"๋ผ๋Š” ํ…์ŠคํŠธ๊ฐ€ ์žˆ๋‹ค. ์˜ค๋ฅธ์ชฝ ์ƒ๋‹จ์—๋„ ํฐ์ƒ‰ ์„ธ๋ฆฌํ”„ ๊ธ€๊ผด๋กœ "[Instant Noodle] ๆณก้ข่ฐƒๆ–™ๅŒ…"๋ผ๋Š” ํ…์ŠคํŠธ๊ฐ€ ์žˆ๋‹ค. ์™ผ์ชฝ์—๋Š” ์ˆ˜์ง์œผ๋กœ ๋ฐฐ์—ด๋œ ์ œ๋ชฉ "Render Distance: Max"๊ฐ€ ํฐ์ƒ‰ ์„ธ๋ฆฌํ”„ ๊ธ€๊ผด๋กœ ๋˜์–ด ์žˆ๋‹ค. ์™ผ์ชฝ ํ•˜๋‹จ์—๋Š” ๋‹ค์„ฏ ๊ฐœ์˜ ๊ฑฐ๋Œ€ํ•œ ํฐ์ƒ‰ ์†ก์ฒด ํ•œ์ž "ๆ˜พๅกๅœจ...็‡ƒ็ƒง"๊ฐ€ ์žˆ๋‹ค. ์˜ค๋ฅธ์ชฝ ํ•˜๋‹จ์—๋Š” ์ž‘์€ ํฐ์ƒ‰ ์„ธ๋ฆฌํ”„ ๊ธ€๊ผด๋กœ "Leica Glowโ„ข Unobtanium X-1"์ด ์žˆ๊ณ , ๊ทธ ๋ฐ”๋กœ ์œ„์—๋Š” ํฐ์ƒ‰ ์†ก์ฒด๋กœ ์“ฐ์ธ ์ด๋ฆ„ "่”กๅ‡ "๊ฐ€ ์žˆ๋‹ค. ์‹๋ณ„๋œ ํ•ต์‹ฌ ๊ฐœ์ฒด์—๋Š” ๋ธŒ๋žœ๋“œ ํ”ฝ์…€ ํ”ผํผ์Šค ๊ธธ๋“œ, ์ œํ’ˆ ๋ผ์ธ ์ธ์Šคํ„ดํŠธ ๋ˆ„๋“ค ์กฐ๋ฏธ๋ฃŒ ํŒจํ‚ค์ง€, ์นด๋ฉ”๋ผ ๋ชจ๋ธ Unobtaniumโ„ข X-1 ๋ฐ ์‚ฌ์ง„๊ฐ€ ์ด๋ฆ„ Zao-Xiang์ด ํฌํ•จ๋œ๋‹ค."""
89
  ],
90
  ]
91
 
 
348
 
349
  def prompt_enhance(prompt, enable_enhance):
350
  if not enable_enhance or not prompt_expander:
351
+ return prompt, "ํ”„๋กฌํ”„ํŠธ ํ–ฅ์ƒ์ด ๋น„ํ™œ์„ฑํ™”๋˜์—ˆ๊ฑฐ๋‚˜ ์‚ฌ์šฉํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค."
352
 
353
  if not prompt.strip():
354
+ return "", "ํ”„๋กฌํ”„ํŠธ๋ฅผ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”."
355
 
356
  try:
357
  result = prompt_expander(prompt)
358
  if result.status:
359
  return result.prompt, result.message
360
  else:
361
+ return prompt, f"ํ–ฅ์ƒ ์‹คํŒจ: {result.message}"
362
  except Exception as e:
363
+ return prompt, f"์˜ค๋ฅ˜: {str(e)}"
364
 
365
 
366
  @spaces.GPU
 
416
  - seed_int: Integer representation of the seed used for generation
417
  """
418
  if pipe is None:
419
+ raise gr.Error("๋ชจ๋ธ์ด ๋กœ๋“œ๋˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค.")
420
 
421
  final_prompt = prompt
422
 
 
458
  pipe.transformer.layers._repeated_blocks = ["ZImageTransformerBlock"]
459
  spaces.aoti_blocks_load(pipe.transformer.layers, "zerogpu-aoti/Z-Image", variant="fa3")
460
 
461
+ with gr.Blocks(title="Z-Image ๋ฐ๋ชจ") as demo:
462
  gr.Markdown(
463
  """<div align="center">
464
+
465
+ # Z-Image ์ด๋ฏธ์ง€ ์ƒ์„ฑ ๋ฐ๋ชจ
466
 
467
  [![GitHub](https://img.shields.io/badge/GitHub-Z--Image-181717?logo=github&logoColor=white)](https://github.com/Tongyi-MAI/Z-Image)
468
 
469
+ *๋‹จ์ผ ์ŠคํŠธ๋ฆผ ๋””ํ“จ์ „ ํŠธ๋žœ์Šคํฌ๋จธ๋ฅผ ์‚ฌ์šฉํ•œ ํšจ์œจ์ ์ธ ์ด๋ฏธ์ง€ ์ƒ์„ฑ ๊ธฐ๋ฐ˜ ๋ชจ๋ธ*
470
 
471
  </div>"""
472
  )
473
 
474
  with gr.Row():
475
  with gr.Column(scale=1):
476
+ prompt_input = gr.Textbox(label="ํ”„๋กฌํ”„ํŠธ", lines=3, placeholder="ํ”„๋กฌํ”„ํŠธ๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š”...")
477
  # PE components (Temporarily disabled)
478
  # with gr.Row():
479
+ # enable_enhance = gr.Checkbox(label="ํ”„๋กฌํ”„ํŠธ ํ–ฅ์ƒ (DashScope)", value=False)
480
+ # enhance_btn = gr.Button("ํ–ฅ์ƒ๋งŒ ์‹คํ–‰")
481
 
482
  with gr.Row():
483
  choices = [int(k) for k in RES_CHOICES.keys()]
484
+ res_cat = gr.Dropdown(value=1024, choices=choices, label="ํ•ด์ƒ๋„ ์นดํ…Œ๊ณ ๋ฆฌ")
485
 
486
  initial_res_choices = RES_CHOICES["1024"]
487
+ resolution = gr.Dropdown(value=initial_res_choices[0], choices=RESOLUTION_SET, label="๋„ˆ๋น„ x ๋†’์ด (๋น„์œจ)")
488
 
489
  with gr.Row():
490
+ seed = gr.Number(label="์‹œ๋“œ", value=42, precision=0)
491
+ random_seed = gr.Checkbox(label="๋žœ๋ค ์‹œ๋“œ", value=True)
492
 
493
  with gr.Row():
494
+ steps = gr.Slider(label="์Šคํ… ์ˆ˜", minimum=1, maximum=100, value=8, step=1, interactive=False)
495
+ shift = gr.Slider(label="์‹œ๊ฐ„ ์ด๋™", minimum=1.0, maximum=10.0, value=3.0, step=0.1)
496
 
497
+ generate_btn = gr.Button("์ƒ์„ฑ", variant="primary")
498
 
499
  # Example prompts
500
+ gr.Markdown("### ๐Ÿ“ ์˜ˆ์ œ ํ”„๋กฌํ”„ํŠธ")
501
  gr.Examples(examples=EXAMPLE_PROMPTS, inputs=prompt_input, label=None)
502
 
503
  with gr.Column(scale=1):
504
  output_gallery = gr.Gallery(
505
+ label="์ƒ์„ฑ๋œ ์ด๋ฏธ์ง€", columns=2, rows=2, height=600, object_fit="contain", format="png", interactive=False
506
  )
507
+ used_seed = gr.Textbox(label="์‚ฌ์šฉ๋œ ์‹œ๋“œ", interactive=False)
508
 
509
  def update_res_choices(_res_cat):
510
  if str(_res_cat) in RES_CHOICES: