AI Film Director's Assistant v11.22-casting-fix

Your complete AI-powered film production studio.

Step 0: Configuration

Please enter your API key to begin.

Step 1: Generate The Script

Bring your story to life. Describe your vision and generate the script.

Error:

Step 2: Location Scouting

Generate visual concepts and approve the setting for each scene.

Step 3: Define The Color Palette

Generate and approve a color palette to define the film's mood.

Step 4: Sound Design

Generate ambient soundscapes, effects, and musical score suggestions.

Step 5: Cast & Voice

Generate visuals, then select and test a voice for each character.

Dialogue Audio Generation

Generate audio for all selected characters and voices. This may take several minutes depending on script length.

0%

Step 6: The First Cut

All your decisions come together. Watch the visualized story.

Step 7: Director's Notes

Provide feedback to generate a revised version of the script.

Step 8: Export Film

Save a project file with all your creative decisions or record the final cut as a video file.

Version History

v11.22-casting-fix (Current)

  • **Fix:** Reverted casting image display logic (`renderCastingSection`, `handleGenerateCastingImages`, `handleUploadActorImage`) to correctly show 4 generated options or 1 uploaded image and handle selection properly.

v11.21-slow-tts

  • **API Rate Limit:** Drastically increased minimum spacing for TTS calls (`fetchAndCacheAudio`, `handleTestVoice`) to 60000ms (60 seconds) via `geminiClient.call` options.
  • **Note:** This will make audio pre-generation very slow (approx 1 line per minute).

v11.20-test-no-schema

  • **Debug:** Commented out `generationConfig` in `handleGenerateScript` to test plain text generation.
  • **Debug:** Added basic text/JSON check after API call in `handleGenerateScript`.
  • **Debug:** Added console logs to `handleGenerateScript` for tracing.
  • **Note:** This version is intended for debugging script generation issues.

v11.19-pregen-gate

  • **Rate Limit Fix:** Disabled "Assemble First Cut" button until audio pre-generation is successfully completed.
  • **State:** Added `audioGenerationStatus` state to track pre-generation progress ('idle', 'generating', 'complete', 'failed').
  • **UI:** `assembleBtn` is enabled only when `audioGenerationStatus` is 'complete'.
  • **UI:** `handleGenerateScript` resets `audioGenerationStatus` and disables `assembleBtn`.
  • **UI:** `pregenerateAllAudio` updates status and enables/disables buttons based on success or failure.
  • **Logic:** Added check in `handleAssembleFirstCut` to prevent starting playback if audio is not ready.

v11.18-pregen

  • **Rate Limit Fix:** Modified `fetchDialogueAudio` to *only* return cached audio during playback, preventing automatic API calls.
  • **Feature:** Added "Generate All Dialogue Audio" button in Step 5.
  • **Feature:** Implemented `pregenerateAllAudio` function to loop through script dialogue and call `fetchAndCacheAudio` (new function containing the TTS API call logic via `geminiClient`) for each line, populating the cache.
  • **UI:** Added progress bar and status text for audio generation.
  • **Stability:** Kept previous fixes including stable TTS model/payload, API client, rate limit settings, and audio context handling.

v11.17-inline-client

  • **Fix:** Resolved module import error by moving `geminiClient.js` code directly into the `index.html` script tag (`type="module"`). Removed `import` and `export` statements.
  • **API:** Retained stable TTS model (`gemini-2.5-flash-preview-tts`) and payload structure.
  • **API Rate Limit:** Kept `minSpacing: 10000` for TTS calls and `minSpacing: 3000` for others.

v11.16-stable-tts

  • **API Fix:** Reverted TTS calls (`fetchDialogueAudio`, `handleTestVoice`) back to use `gemini-2.5-flash-preview-tts` model and correct payload structure (`speechConfig` inside `generationConfig`) while still using the `geminiClient.js` module.
  • **API Rate Limit:** Kept `minSpacing: 10000` for TTS calls and `minSpacing: 3000` for others via `geminiClient.call()`.
  • **Stability:** Added more checks for valid script/dialogue structure in `playTimeline` to prevent errors during playback.
  • **Stability:** Added `.catch()` to audio play promises (`playAudioAndWait`, `handleTestVoice`, `playGeneratedMusic`) for better error handling.
  • **Stability:** Added checks/resume logic for `AudioContext` state before creating/playing sounds in `playGeneratedMusic` and `handleGenerateSound`.

v11.15-client

  • **Refactor:** Extracted API call logic (`enqueueApiCall`, `makeGeminiApiCallWithRetry`) into a separate `geminiClient.js` module.
  • **API:** Updated main script to `import` and use `geminiClient.call()`.
  • **API Rate Limit:** Explicitly setting `minSpacing: 10000` for TTS calls and `minSpacing: 3000` for others when using `geminiClient.call()`.
  • **API Fix:** Ensured API key is correctly appended to `apiUrl` before passing to `geminiClient.call()`.
  • **Cleanup:** Removed old API helper functions and state variables from `index.html`.

v11.14-revert

  • **API Revert:** Replaced `makeApiCallWithRetry` delay back to `Math.pow(2, attempt) * 500`.
  • **API Revert:** Updated `fetchDialogueAudio` and `handleTestVoice` back to use `gemini-2.0-flash-exp` model and adjusted payload structure (`speechConfig` outside `generationConfig`).
  • **API Revert:** Kept the strict serial `enqueueApiCall` implementation introduced in `v11.2-exp-fix-rate-user`.

v11.2-exp-fix-rate-user

  • **API Rate Limit:** Set minimum gap in `enqueueApiCall` to 10000ms (10s) and implemented strict serial queue using `apiQueuePromise`.
  • **API Rate Limit:** Kept initial retry delay in `makeApiCallWithRetry` starting at 2000ms (`Math.pow(2, attempt) * 1000`).

v11.2-exp-fix-rate

  • **API Rate Limit:** Increased minimum gap in `enqueueApiCall` to 3000ms.
  • **API Rate Limit:** Increased initial retry delay in `makeApiCallWithRetry` to start at 2000ms (`Math.pow(2, attempt) * 1000`).

v11.2-exp-fix

  • **API Fix:** Reverted TTS calls (`fetchDialogueAudio`, `handleTestVoice`) back to use `gemini-2.5-flash-preview-tts` model and correct payload structure (`speechConfig` inside `generationConfig`) to resolve 400 errors.
  • **API:** Kept updated `makeApiCallWithRetry` delay (`Math.pow(2, attempt) * 500`).

v11.2-exp

  • **API:** Updated `makeApiCallWithRetry` delay to `Math.pow(2, attempt) * 500`.
  • **API:** Updated `fetchDialogueAudio` and `handleTestVoice` to use `gemini-2.0-flash-exp` model and adjusted payload structure (`speechConfig` outside `generationConfig`).

v11.2

  • Initial stable version provided by user.

Scene 1 of 1

0