Spaces:
Sleeping
Sleeping
File size: 2,849 Bytes
d425f95 854ba03 d425f95 854ba03 d425f95 6d01f39 d425f95 6d01f39 d425f95 6d01f39 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
---
title: SoraWithAzure
emoji: π
colorFrom: red
colorTo: red
sdk: docker
app_port: 8501
tags:
- streamlit
pinned: false
short_description: Streamlit template space
---
# SoraWithAzure: Streamlit Video Generation App
This app lets you generate videos using the Azure Sora API via a simple Streamlit interface. Users can enter a text prompt, select video settings, and generate videos that are stored and viewable by anyone using the app.
## Key Components
- **SoraClient**: Handles all communication with the Azure Sora API (job creation, polling, download).
- **VideoJob**: Represents a video generation job, encapsulating prompt, parameters, and result.
- **VideoStorage**: Handles saving and listing generated videos in a persistent directory.
- **Streamlit App**: Provides the user interface for input, video generation, and video display.
## How it Works
1. User enters their Azure API key, endpoint, and a text prompt.
2. User selects video resolution, length, and number of variants.
3. The app creates a video generation job via the Sora API.
4. The app polls for job completion.
5. When ready, the app downloads the generated video(s) and stores them.
6. All generated videos are listed and playable in the app.
## Sequence Diagram (ASCII)
```
User StreamlitApp SoraClient AzureSoraAPI VideoStorage
| | | | |
|---input-------->| | | |
| |---start_job--->| | |
| | |---POST-------->| |
| | |<--job_id-------| |
| |<--job_id-------| | |
| |---wait-------->| | |
| | |---poll-------->| |
| | |<--status-------| |
| |<--result-------| | |
| |---download---->| | |
| | |---GET video--->| |
| | |<--video--------| |
| | |---save-------->| |
| | |<--file_path----| |
|<---display------| | | |
```
## Code Structure
- `src/sora_video_downloader.py`: Core logic for Sora API interaction and video job management.
- `src/streamlit_app.py`: Streamlit UI and app logic.
## Notes
- Only text-to-video is supported (no image+prompt).
- All generated videos are visible to all users.
---
For more, see the code comments and docstrings in each file.
|