Time-Stream / README.md
ginipick's picture
Update README.md
ee19fd5 verified

A newer version of the Gradio SDK is available: 5.38.2

Upgrade
metadata
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

  1. 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
  2. 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
  3. 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
  4. 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)" ํšจ๊ณผ๋ฅผ ๋งŒ๋“ญ๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด, "์‹ ์„ ํ•œ" ํ† ๋งˆํ† ์—์„œ "์ฉ์€" ํ† ๋งˆํ† ๋กœ์˜ ๋ณ€ํ™” ๊ณผ์ •์„ ๋ณด์—ฌ์ฃผ๋Š” ์‹œ๊ฐ„ ๊ฒฝ๊ณผ ์‹œ๊ฐํ™”๋ฅผ ์ƒ์„ฑํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์ฃผ์š” ๊ธฐ๋Šฅ

  1. CLIP ๊ฐ€์ด๋“œ ์ด๋ฏธ์ง€ ์ƒ์„ฑ

    • CLIP ๊ฐ€์ด๋˜์Šค์™€ ํ•จ๊ป˜ FLUX.1-schnell ๋ชจ๋ธ ์‚ฌ์šฉ
    • CLIP ์ž„๋ฒ ๋”ฉ์„ ์‚ฌ์šฉํ•˜์—ฌ ๋‘ ๊ฐœ๋… ์‚ฌ์ด์˜ ์ž ์žฌ ๋ฐฉํ–ฅ ์ฐพ๊ธฐ
    • ์ด ๋ฐฉํ–ฅ์„ ๋”ฐ๋ผ ์ค‘๊ฐ„ ์ด๋ฏธ์ง€๋“ค์„ ์ƒ์„ฑ
  2. ์ฃผ์š” ๊ตฌ์„ฑ ์š”์†Œ

    • ํ”„๋กฌํ”„ํŠธ: ์ƒ์„ฑํ•  ๋Œ€์ƒ์˜ ๊ธฐ๋ณธ ์„ค๋ช…
    • 1์ฐจ/2์ฐจ ๋ฐฉํ–ฅ: ๋ณด๊ฐ„ํ•  ๋‘ ๊ฐ€์ง€ ์ƒํƒœ (์˜ˆ: "์‹ ์„ ํ•œ" โ†’ "์ฉ์€")
    • ๊ฐ•๋„: ๋ณ€ํ™˜์˜ ๊ทน๋‹จ์„ฑ์„ ์ œ์–ด
    • ์ถœ๋ ฅ: ์ด๋ฏธ์ง€ ์ŠคํŠธ๋ฆฝ๊ณผ ๋ฃจํ•‘ ๋น„๋””์˜ค ๋ชจ๋‘ ์ƒ์„ฑ
  3. ๊ณ ๊ธ‰ ์˜ต์…˜

    • ์ค‘๊ฐ„ ์ด๋ฏธ์ง€ ์ˆ˜ (3-65๊ฐœ)
    • CLIP ๋ฐฉํ–ฅ ๋ฐ˜๋ณต ํšŸ์ˆ˜ (0-400ํšŒ)
    • ์ถ”๋ก  ๋‹จ๊ณ„ (1-4๋‹จ๊ณ„)
    • ๊ฐ€์ด๋˜์Šค ์Šค์ผ€์ผ (0.1-10.0)
    • ์žฌํ˜„์„ฑ์„ ์œ„ํ•œ ์‹œ๋“œ ์ œ์–ด
  4. ์ถœ๋ ฅ ํ˜•์‹

    • ๊ฐœ๋ณ„ ์ƒ์„ฑ ์ด๋ฏธ์ง€
    • ๋ชจ๋“  ์ „ํ™˜์„ ๋ณด์—ฌ์ฃผ๋Š” ์ด๋ฏธ์ง€ ์ŠคํŠธ๋ฆฝ
    • ๋ณ€ํ™˜ ๊ณผ์ •์˜ ๋ฃจํ•‘ ๋น„๋””์˜ค
    • ํŠน์ • ํ”„๋ ˆ์ž„์„ ๋ณผ ์ˆ˜ ์žˆ๋Š” ์ธํ„ฐ๋ž™ํ‹ฐ๋ธŒ ์Šฌ๋ผ์ด๋”

๊ธฐ์ˆ ์  ๊ตฌํ˜„

  • GPU ๊ฐ€์†์„ ์œ„ํ•œ spaces.GPU ๋ฐ์ฝ”๋ ˆ์ดํ„ฐ ์‚ฌ์šฉ
  • ๋น ๋ฅธ ์ฒ˜๋ฆฌ๋ฅผ ์œ„ํ•œ AutoencoderTiny ๊ตฌํ˜„
  • ํ•œ๊ธ€ ํ…์ŠคํŠธ ๊ฐ์ง€ ์ฒ˜๋ฆฌ (๋ฒˆ์—ญ ์—†์ด ์ง์ ‘ ์‚ฌ์šฉ๋œ๋‹ค๋Š” ๊ฒฝ๊ณ  ํ‘œ์‹œ)
  • ๊ณ ์œ ํ•œ UUID ํŒŒ์ผ๋ช…์œผ๋กœ ์ด๋ฏธ์ง€ ์ €์žฅ

์‚ฌ์šฉ ์˜ˆ์‹œ

  • ๋ถ€ํŒจ/๋…ธํ™” ๊ณผ์ • ํ‘œํ˜„
  • ๊ณ„์ ˆ ๋ณ€ํ™”
  • ๋‚ ์”จ ์ „ํ™˜
  • ๋„์‹œ ๊ฐœ๋ฐœ/์‡ ํ‡ด
  • ๋ชจ๋“  ์‹œ๊ฐ„์  ๋ณ€ํ™˜

์ฐธ๊ณ ์‚ฌํ•ญ

  • ํ•œ๊ธ€ ์ž…๋ ฅ์€ ์ง€์›๋˜์ง€๋งŒ ๋ชจ๋ธ์ด ์˜์–ด์— ์ตœ์ ํ™”๋˜์–ด ์žˆ์–ด ๊ฒฐ๊ณผ๊ฐ€ ์ œํ•œ์ ์ผ ์ˆ˜ ์žˆ์Œ
  • ๊ฐ•๋„(Strength) ๊ฐ’์ด 2.5 ์ด์ƒ์ผ ๊ฒฝ์šฐ ๋ถˆ์•ˆ์ •ํ•  ์ˆ˜ ์žˆ์Œ
  • ์ค‘๊ฐ„ ์ด๋ฏธ์ง€ ์ˆ˜๊ฐ€ ๋งŽ์„์ˆ˜๋ก ๋” ๋ถ€๋“œ๋Ÿฌ์šด ์ „ํ™˜ ํšจ๊ณผ๋ฅผ ์–ป์„ ์ˆ˜ ์žˆ์Œ