Spaces:
Running
on
Zero
A newer version of the Gradio SDK is available:
5.38.2
title: Time Stream
emoji: ๐ช
colorFrom: pink
colorTo: blue
sdk: gradio
sdk_version: 5.35.0
app_file: app.py
pinned: false
license: mit
short_description: input text, a video from the past to the future
Looking at this code, it's a Gradio-based application that generates interpolated images between two concepts using CLIP-guided diffusion with the FLUX model. Let me explain the key components and functionality:
English Explanation
Overview
This application creates a "Time Stream" effect by generating a series of images that smoothly transition between two different states or concepts. For example, it can show the progression from a "fresh" tomato to a "rotten" one, creating a time-lapse-like visualization.
Key Features
CLIP-Guided Image Generation
- Uses FLUX.1-schnell model with CLIP guidance
- Finds latent directions between two concepts using CLIP embeddings
- Generates intermediate images along this direction
Main Components
- Prompt: The base description of what to generate
- 1st/2nd Direction: Two states to interpolate between (e.g., "Fresh" โ "Rotten")
- Strength: Controls how extreme the transformation is
- Output: Creates both an image strip and a looping video
Advanced Options
- Number of intermediate images (3-65)
- CLIP direction iterations (0-400)
- Inference steps (1-4)
- Guidance scale (0.1-10.0)
- Seed control for reproducibility
Output Formats
- Individual generated images
- Image strip showing all transitions
- Looping video of the transformation
- Interactive slider to view specific frames
Technical Implementation
- Uses
spaces.GPU
decorator for GPU acceleration - Implements AutoencoderTiny for faster processing
- Handles Korean text detection (though warns it's used directly without translation)
- Saves images with unique UUID filenames
Example Use Cases
- Showing decay/aging processes
- Seasonal changes
- Weather transitions
- Urban development/deterioration
- Any temporal transformation
ํ๊ธ ์ค๋ช
๊ฐ์
์ด ์ ํ๋ฆฌ์ผ์ด์ ์ ๋ ๊ฐ์ง ๋ค๋ฅธ ์ํ๋ ๊ฐ๋ ์ฌ์ด๋ฅผ ๋ถ๋๋ฝ๊ฒ ์ ํํ๋ ์ผ๋ จ์ ์ด๋ฏธ์ง๋ฅผ ์์ฑํ์ฌ "์๊ฐ์ ํ๋ฆ(Time Stream)" ํจ๊ณผ๋ฅผ ๋ง๋ญ๋๋ค. ์๋ฅผ ๋ค์ด, "์ ์ ํ" ํ ๋งํ ์์ "์ฉ์" ํ ๋งํ ๋ก์ ๋ณํ ๊ณผ์ ์ ๋ณด์ฌ์ฃผ๋ ์๊ฐ ๊ฒฝ๊ณผ ์๊ฐํ๋ฅผ ์์ฑํ ์ ์์ต๋๋ค.
์ฃผ์ ๊ธฐ๋ฅ
CLIP ๊ฐ์ด๋ ์ด๋ฏธ์ง ์์ฑ
- CLIP ๊ฐ์ด๋์ค์ ํจ๊ป FLUX.1-schnell ๋ชจ๋ธ ์ฌ์ฉ
- CLIP ์๋ฒ ๋ฉ์ ์ฌ์ฉํ์ฌ ๋ ๊ฐ๋ ์ฌ์ด์ ์ ์ฌ ๋ฐฉํฅ ์ฐพ๊ธฐ
- ์ด ๋ฐฉํฅ์ ๋ฐ๋ผ ์ค๊ฐ ์ด๋ฏธ์ง๋ค์ ์์ฑ
์ฃผ์ ๊ตฌ์ฑ ์์
- ํ๋กฌํํธ: ์์ฑํ ๋์์ ๊ธฐ๋ณธ ์ค๋ช
- 1์ฐจ/2์ฐจ ๋ฐฉํฅ: ๋ณด๊ฐํ ๋ ๊ฐ์ง ์ํ (์: "์ ์ ํ" โ "์ฉ์")
- ๊ฐ๋: ๋ณํ์ ๊ทน๋จ์ฑ์ ์ ์ด
- ์ถ๋ ฅ: ์ด๋ฏธ์ง ์คํธ๋ฆฝ๊ณผ ๋ฃจํ ๋น๋์ค ๋ชจ๋ ์์ฑ
๊ณ ๊ธ ์ต์
- ์ค๊ฐ ์ด๋ฏธ์ง ์ (3-65๊ฐ)
- CLIP ๋ฐฉํฅ ๋ฐ๋ณต ํ์ (0-400ํ)
- ์ถ๋ก ๋จ๊ณ (1-4๋จ๊ณ)
- ๊ฐ์ด๋์ค ์ค์ผ์ผ (0.1-10.0)
- ์ฌํ์ฑ์ ์ํ ์๋ ์ ์ด
์ถ๋ ฅ ํ์
- ๊ฐ๋ณ ์์ฑ ์ด๋ฏธ์ง
- ๋ชจ๋ ์ ํ์ ๋ณด์ฌ์ฃผ๋ ์ด๋ฏธ์ง ์คํธ๋ฆฝ
- ๋ณํ ๊ณผ์ ์ ๋ฃจํ ๋น๋์ค
- ํน์ ํ๋ ์์ ๋ณผ ์ ์๋ ์ธํฐ๋ํฐ๋ธ ์ฌ๋ผ์ด๋
๊ธฐ์ ์ ๊ตฌํ
- GPU ๊ฐ์์ ์ํ
spaces.GPU
๋ฐ์ฝ๋ ์ดํฐ ์ฌ์ฉ - ๋น ๋ฅธ ์ฒ๋ฆฌ๋ฅผ ์ํ AutoencoderTiny ๊ตฌํ
- ํ๊ธ ํ ์คํธ ๊ฐ์ง ์ฒ๋ฆฌ (๋ฒ์ญ ์์ด ์ง์ ์ฌ์ฉ๋๋ค๋ ๊ฒฝ๊ณ ํ์)
- ๊ณ ์ ํ UUID ํ์ผ๋ช ์ผ๋ก ์ด๋ฏธ์ง ์ ์ฅ
์ฌ์ฉ ์์
- ๋ถํจ/๋ ธํ ๊ณผ์ ํํ
- ๊ณ์ ๋ณํ
- ๋ ์จ ์ ํ
- ๋์ ๊ฐ๋ฐ/์ ํด
- ๋ชจ๋ ์๊ฐ์ ๋ณํ
์ฐธ๊ณ ์ฌํญ
- ํ๊ธ ์ ๋ ฅ์ ์ง์๋์ง๋ง ๋ชจ๋ธ์ด ์์ด์ ์ต์ ํ๋์ด ์์ด ๊ฒฐ๊ณผ๊ฐ ์ ํ์ ์ผ ์ ์์
- ๊ฐ๋(Strength) ๊ฐ์ด 2.5 ์ด์์ผ ๊ฒฝ์ฐ ๋ถ์์ ํ ์ ์์
- ์ค๊ฐ ์ด๋ฏธ์ง ์๊ฐ ๋ง์์๋ก ๋ ๋ถ๋๋ฌ์ด ์ ํ ํจ๊ณผ๋ฅผ ์ป์ ์ ์์