Skip to content

Commit 70d1b70

Browse files
uzunenescursoragent
andcommitted
feat: Istanbul theme for all examples; video/GIF as istanbul; API.md and README updated
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent b4f6216 commit 70d1b70

10 files changed

Lines changed: 49 additions & 35 deletions

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ result = client.images.generate(
9292
```python
9393
result = client.videos.generate(
9494
model="fal-ai/flux-pro/video",
95-
prompt="waves crashing on a beach",
95+
prompt="Cinematic drone over Istanbul at golden hour, Bosphorus and minarets",
9696
duration_seconds=5.0,
9797
)
98-
print(result.video_url)
98+
print(result.video_url) # Convert to GIF for previews: examples/make_video_and_gif.py --mp4 path
9999
```
100100

101101
### Model Discovery
@@ -223,10 +223,11 @@ VISGATE_API_KEY=vg-... python examples/run_all_capabilities.py
223223
cd examples && python capture_all_outputs.py
224224
```
225225

226-
Sample outputs (images, video, and text proofs) are under [`examples/sample_outputs/`](examples/sample_outputs/). Regenerate images/video:
226+
Sample outputs use an **Istanbul theme** (Bosphorus, minarets, golden hour). They are under [`examples/sample_outputs/`](examples/sample_outputs/) (images, `istanbul.mp4`, `istanbul.gif`, and text proofs). Regenerate:
227227

228228
```bash
229-
cd examples && python fetch_sample_outputs.py
229+
cd examples && python fetch_sample_outputs.py # images + video
230+
cd examples && python make_video_and_gif.py # video + GIF
230231
```
231232

232233
## Contributing

docs/API.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Short reference. Full OpenAPI spec: your API base URL + `/docs`.
44

55
## Testing against the live API
66

7-
Use the **visgate-python** SDK and examples to hit the live API:
7+
Use the **visgate-python** SDK and examples to hit the live API. Sample outputs (images and video) use an **Istanbul theme** for a consistent look.
88

99
```bash
1010
pip install visgate-sdk
@@ -19,10 +19,19 @@ python examples/07_cache_demo.py
1919
# Semantic cache: similar prompts; second may = cache hit (Vertex AI + Firestore)
2020
python examples/08_semantic_cache_demo.py
2121

22-
# Run all capability examples
22+
# Run all capability examples (images, video, usage, providers, etc.)
2323
python examples/run_all_capabilities.py
2424
```
2525

26+
**Regenerate sample outputs (Istanbul-themed images + video + GIF):**
27+
28+
```bash
29+
cd examples
30+
python fetch_sample_outputs.py # images + video (waits for video when async)
31+
python make_video_and_gif.py # video + GIF (or use --mp4 path to convert only)
32+
python create_placeholder_video.py # placeholder istanbul.mp4 + .gif without API
33+
```
34+
2635
Base URL defaults to `https://visgateai.com/api/v1`. Override with `VISGATE_BASE_URL` for staging or local.
2736

2837
## Installation
@@ -224,7 +233,7 @@ result = await client.videos.generate(
224233
- `latency_ms` (int | None): Request latency in milliseconds
225234
- `created_at` (datetime): Creation timestamp
226235

227-
**Note:** Video generation may be asynchronous. Check `video_url` to see if the video is ready.
236+
**Note:** Video generation may be asynchronous. Check `video_url` to see if the video is ready. You can convert the downloaded MP4 to a GIF for previews (e.g. `examples/make_video_and_gif.py` or `--mp4 path/to/video.mp4`).
228237

229238
## Usage Resource
230239

@@ -420,8 +429,12 @@ client.close()
420429

421430
API traffic is over HTTPS. Provider keys (BYOK) are encrypted at rest; account and usage data are stored on Google Cloud with encryption at rest.
422431

432+
## Sample outputs (Istanbul theme)
433+
434+
All example scripts use Istanbul-themed prompts (Bosphorus, minarets, golden hour, Galata Tower, etc.). Generated assets are under `examples/sample_outputs/`: images (e.g. `generate_unified.jpg`, `sunset_istanbul.jpg`, `galata_tower.jpg`, `bosphorus_night.jpg`), cache demos, and video `istanbul.mp4` plus `istanbul.gif` (video converted to GIF for previews).
435+
423436
## Additional Resources
424437

425438
- SDK README: [README.md](../README.md)
426-
- Examples: [examples/](../examples/)
439+
- Examples (step-by-step): [examples/README.md](../examples/README.md)
427440
- API OpenAPI Spec: https://visgateai.com/api/v1/docs

examples/07_cache_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313

1414
def main() -> int:
15-
prompt = "a red apple on a wooden table, studio lighting"
15+
prompt = "Istanbul Bosphorus at golden hour, minarets visible, cinematic"
1616
model = "fal-ai/flux/schnell"
1717
width, height = 1024, 1024
1818

examples/08_semantic_cache_demo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717

1818

1919
def main() -> int:
20-
prompt1 = "a red apple on a wooden table, studio lighting"
21-
prompt2 = "red apple on wooden table with studio lights"
20+
prompt1 = "Istanbul Bosphorus at golden hour, minarets visible, cinematic"
21+
prompt2 = "Bosphorus Istanbul golden hour with minarets, cinematic"
2222
model = "fal-ai/flux/schnell"
2323
width, height = 1024, 1024
2424

examples/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ Requires the SDK to be installed; `VISGATE_API_KEY` is required for auth steps.
9999
- **Purpose:** Video generation; may return async job; optional wait and download.
100100
- **API/SDK:** `POST /videos/generate`.
101101
- **Command:** `python examples/04_videos_all_providers.py`
102-
- **Output:** [out_04_videos_all_providers.txt](sample_outputs/out_04_videos_all_providers.txt) · Video: [beach_waves.mp4](sample_outputs/beach_waves.mp4) · GIF: ![beach_waves](sample_outputs/beach_waves.gif) (generate with `make_video_and_gif.py`)
102+
- **Output:** [out_04_videos_all_providers.txt](sample_outputs/out_04_videos_all_providers.txt) · Video: [istanbul.mp4](sample_outputs/istanbul.mp4) · GIF: ![istanbul](sample_outputs/istanbul.gif) (generate with `make_video_and_gif.py`)
103103

104104
---
105105

@@ -175,8 +175,8 @@ Requires the SDK to be installed; `VISGATE_API_KEY` is required for auth steps.
175175
| 00_auth_identity | [out_00_auth_identity.txt](sample_outputs/out_00_auth_identity.txt) ||
176176
| 01_models_catalog | [out_01_models_catalog.txt](sample_outputs/out_01_models_catalog.txt) ||
177177
| 02 generate_unified | [out_02_generate_unified.txt](sample_outputs/out_02_generate_unified.txt) | ![generate_unified](sample_outputs/generate_unified.jpg) |
178-
| 03 images | [out_03_images_all_providers.txt](sample_outputs/out_03_images_all_providers.txt) | ![sunset](sample_outputs/sunset_istanbul.jpg) ![cat](sample_outputs/cat_astronaut.jpg) ![cappadocia](sample_outputs/cappadocia_balloons.jpg) |
179-
| 04 videos | [out_04_videos_all_providers.txt](sample_outputs/out_04_videos_all_providers.txt) | [beach_waves.mp4](sample_outputs/beach_waves.mp4) · ![beach_waves](sample_outputs/beach_waves.gif) |
178+
| 03 images | [out_03_images_all_providers.txt](sample_outputs/out_03_images_all_providers.txt) | ![sunset](sample_outputs/sunset_istanbul.jpg) ![galata](sample_outputs/galata_tower.jpg) ![bosphorus](sample_outputs/bosphorus_night.jpg) |
179+
| 04 videos | [out_04_videos_all_providers.txt](sample_outputs/out_04_videos_all_providers.txt) | [istanbul.mp4](sample_outputs/istanbul.mp4) · ![istanbul](sample_outputs/istanbul.gif) |
180180
| 05 usage | [out_05_usage_history_verify.txt](sample_outputs/out_05_usage_history_verify.txt) ||
181181
| 06 provider_balances | [out_06_provider_balances.txt](sample_outputs/out_06_provider_balances.txt) ||
182182
| 07 cache_demo | [out_07_cache_demo.txt](sample_outputs/out_07_cache_demo.txt) | ![cache_demo](sample_outputs/cache_demo.jpg) |
@@ -196,7 +196,7 @@ python fetch_sample_outputs.py
196196

197197
Requires `VISGATE_API_KEY`. The script waits for video when the API returns async (no skip).
198198

199-
### Video and GIF (beach_waves)
199+
### Video and GIF (Istanbul)
200200

201201
To generate the sample video and a GIF preview:
202202

@@ -205,7 +205,7 @@ cd examples
205205
VISGATE_API_KEY=vg-... python make_video_and_gif.py
206206
```
207207

208-
This produces `sample_outputs/beach_waves.mp4` and `sample_outputs/beach_waves.gif`. GIF conversion uses `ffmpeg` if available, or `pip install imageio imageio-ffmpeg` as fallback. To convert an existing MP4 only: `python make_video_and_gif.py --mp4 sample_outputs/beach_waves.mp4`.
208+
This produces `sample_outputs/istanbul.mp4` and `sample_outputs/istanbul.gif`. GIF conversion uses `ffmpeg` if available, or `pip install imageio imageio-ffmpeg` as fallback. To convert an existing MP4 only: `python make_video_and_gif.py --mp4 sample_outputs/istanbul.mp4`.
209209
If the API does not return a video URL, you can generate placeholder assets (no API) with: `python create_placeholder_video.py`.
210210

211211
## Cache behavior

examples/create_placeholder_video.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#!/usr/bin/env python3
2-
"""Create a minimal placeholder MP4 (beach-like) and convert to GIF.
3-
No API call. Run when you need sample_outputs/beach_waves.mp4 and .gif without the API.
2+
"""Create a minimal placeholder MP4 (Istanbul-themed) and convert to GIF.
3+
No API call. Run when you need sample_outputs/istanbul.mp4 and .gif without the API.
44
"""
55
from __future__ import annotations
66

77
import sys
88
from pathlib import Path
99

1010
OUTPUT_DIR = Path(__file__).resolve().parent / "sample_outputs"
11-
VIDEO_NAME = "beach_waves"
11+
VIDEO_NAME = "istanbul"
1212
FPS = 8
1313
DURATION_SEC = 4.0
1414
W, H = 320, 180

examples/fetch_sample_outputs.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,22 @@
2121
# 02_generate_unified
2222
GENERATE_PROMPT = "Istanbul skyline at sunset, realistic photo"
2323

24-
# 03_images_all_providers style
24+
# 03_images_all_providers — all Istanbul themed
2525
IMAGE_PROMPTS = [
2626
("sunset_istanbul", "Golden hour sunset over Istanbul Bosphorus, minarets and seagulls, cinematic, 8k"),
27-
("cat_astronaut", "A fluffy orange cat astronaut in space, Earth in background, photorealistic, whimsical"),
28-
("cappadocia_balloons", "Cappadocia hot air balloons at dawn, cinematic drone, soft light"),
27+
("galata_tower", "Galata Tower Istanbul at dusk, city lights and Bosphorus, cinematic, 8k"),
28+
("bosphorus_night", "Bosphorus Strait Istanbul at night, bridges and minarets, cinematic, 8k"),
2929
]
3030

31-
# 07_cache_demo
32-
CACHE_PROMPT = "A red apple on a wooden table, studio lighting"
31+
# 07_cache_demo — Istanbul
32+
CACHE_PROMPT = "Istanbul Bosphorus at golden hour, minarets visible, cinematic"
3333

34-
# 08_semantic_cache_demo
35-
SEMANTIC_PROMPT_1 = "A red apple on a wooden table, studio lighting"
36-
SEMANTIC_PROMPT_2 = "Red apple on wooden table with studio lights"
34+
# 08_semantic_cache_demo — Istanbul (similar phrasing)
35+
SEMANTIC_PROMPT_1 = "Istanbul Bosphorus at golden hour, minarets visible, cinematic"
36+
SEMANTIC_PROMPT_2 = "Bosphorus Istanbul golden hour with minarets, cinematic"
3737

38-
# 04_videos
39-
VIDEO_PROMPT = ("beach_waves", "Waves crashing on a quiet beach at sunset, cinematic, 4k", 4.0)
38+
# 04_videos — Istanbul
39+
VIDEO_PROMPT = ("istanbul", "Cinematic drone over Istanbul at golden hour, Bosphorus and minarets, 4k", 4.0)
4040
VIDEO_POLL_SLEEP = 25
4141
VIDEO_POLL_ATTEMPTS = 6
4242

@@ -143,7 +143,7 @@ def main() -> int:
143143
duration_seconds=vdur,
144144
)
145145
if vresult.video_url:
146-
vpath = OUTPUT_DIR / f"{vname}.mp4"
146+
vpath = OUTPUT_DIR / f"{vname}.mp4" # istanbul.mp4
147147
download_url(vresult.video_url, vpath, timeout=120.0)
148148
print(f" Saved {vpath}")
149149
break

examples/make_video_and_gif.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python3
22
"""
3-
Generate one sample video (beach_waves) and convert it to GIF.
4-
Saves to examples/sample_outputs/beach_waves.mp4 and beach_waves.gif.
3+
Generate one sample video (Istanbul) and convert it to GIF.
4+
Saves to examples/sample_outputs/istanbul.mp4 and istanbul.gif.
55
66
Requires: VISGATE_API_KEY. For GIF: ffmpeg (preferred) or pip install imageio imageio-ffmpeg.
77
@@ -25,8 +25,8 @@
2525
VIDEO_REQUEST_TIMEOUT = 360.0
2626

2727
OUTPUT_DIR = Path(__file__).resolve().parent / "sample_outputs"
28-
VIDEO_NAME = "beach_waves"
29-
VIDEO_PROMPT = "Waves crashing on a quiet beach at sunset, cinematic, 4k"
28+
VIDEO_NAME = "istanbul"
29+
VIDEO_PROMPT = "Cinematic drone over Istanbul at golden hour, Bosphorus and minarets, 4k"
3030
VIDEO_DURATION = 4.0
3131
POLL_SLEEP = 25
3232
POLL_ATTEMPTS = 6
@@ -86,7 +86,7 @@ def convert_imageio(mp4_path: Path, gif_path: Path) -> bool:
8686

8787
def main() -> int:
8888
import argparse
89-
parser = argparse.ArgumentParser(description="Generate beach_waves video + GIF or convert existing MP4 to GIF")
89+
parser = argparse.ArgumentParser(description="Generate Istanbul video + GIF or convert existing MP4 to GIF")
9090
parser.add_argument("--mp4", type=Path, help="Existing MP4 path; if set, only convert to GIF (no API call)")
9191
args = parser.parse_args()
9292

0 commit comments

Comments
 (0)