Thanks to visit codestin.com
Credit goes to github.com

Skip to content

supermarsx/sora-json-prompt-crafter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sora JSON Prompt Crafter

Banner displaying an infernal scenario and a prompt running away from ghosts

License Commits Stars Forks Watchers

Build Coverage Issues

If you have some spare time please contribute to complete or add translations for your local language please, just submit a PR, raise an issue with it, or some other adequate communication platform.

Sora JSON Prompt Crafter is a web interface for building specially crafted prompts for Sora's generative models. Adjust sliders and dropdowns to fine‑tune parameters like style preset, aspect ratio, video duration and more. The app generates a JSON snippet you can copy and use directly with Sora. The app has a privacy-first approach where everything is kept on your browser, no prompt data is shared or tracked. Dark mode is used as default for those of us that go "my eyes!" when there's bright white lights.

Demo at Lovable

Latest commit at Lovable

Features

  • Always on-screen live JSON generation with diff highlighting
  • Edit prompts and negative prompts
  • Privacy-first local storage only data
  • Dark mode first for eye confort
  • 100% locally generated JSON
  • Optional JSON composition based on option sections
  • JSON generation lifecycle functions
  • Current generated JSON persists through page reloads
  • Stores up to 100 copied JSON prompts in a dedicated history panel
  • Import and Export functions for copied JSON entries
  • Dedicated Settings panel for import, reset and customization options
  • Extensive quality, ambient and setting presets
  • Lots of pop culture presets
  • Specific framing, dimension and base presets
  • Presets and options for video like camera and motion
  • Advanced specialized prompting options
  • Artifact and defect correction presets
  • No-fuss tracking toggle
  • Shared links append ?ref=share for referral tracking
  • Internationalization support for English, Spanish and other 2 dozens of locales
  • Works offline thanks to service worker caching of assets
  • Automatically checks for service worker updates on load and when opening the Settings panel
  • Inject custom CSS and JavaScript from the Settings panel

Keyboard Shortcuts

Shortcut Action
Cmd/Ctrl + C Copy generated JSON
Cmd/Ctrl + Z Undo last change
Cmd/Ctrl + Shift + Z or Cmd/Ctrl + Y Redo last change

Keyboard shortcuts are enabled by default. You can toggle them in the Settings panel if they interfere with other tools.

Example JSON output:

{
  "prompt": "A breathtaking cinematic scene ...",
  "negative_prompt": "blurry, low-res, ...",
  "seed": 1337,
  "aspect_ratio": "16:9",
  "duration_seconds": 5
}

Quick Start

Requires Node.js 22 or higher. Run nvm use to match the version in .nvmrc.

To start using the prompt crafter locally clone and run using the following commands:

git clone https://github.com/supermarsx/sora-json-prompt-crafter
cd sora-json-prompt-crafter
npm install
npm run dev

Copy .env.example to .env and adjust the variables. VITE_MEASUREMENT_ID holds your Google Analytics ID and VITE_DISABLE_ANALYTICS disables tracking. VITE_DISABLE_STATS disables the GitHub stats fetch. VITE_DISCLAIMER_URL can point to a custom path and should include a {locale} placeholder. Set VITE_GTAG_DEBUG to true to enable GA debug mode. Then open http://localhost:8080 in your browser.

CLI

Generate prompt JSON directly from the command line:

npx ts-node cli/index.ts --prompt "A castle at dawn" --width 800

Load options from a JSON file instead:

npx ts-node cli/index.ts --file options.json

Write the output to a file with --output:

npx ts-node cli/index.ts --prompt "A castle at dawn" --output out.json

Generate compact JSON with --minify:

npx ts-node cli/index.ts --prompt "A castle at dawn" --minify

When installed from npm, the CLI is exposed as sora-crafter:

sora-crafter --prompt "A castle at dawn"

Docker

Build and run a containerized version of the app:

docker build -t sora-json-prompt-crafter .
docker run -p 8080:8080 sora-json-prompt-crafter

The application will then be available at http://localhost:8080.

Running Tests

npm test

You can also run npm run typecheck to verify TypeScript types.

Formatting Code

npm run format

Runs Prettier with the project's configuration to automatically format all files.

Screenshots

Base Screenshot

Technology

This project is built with:

  • Vite
  • TypeScript
  • React
  • shadcn-ui
  • Tailwind CSS

Deployment

You can deploy the built application to any static hosting service. Below is a typical workflow using Vercel as an example. If you prefer, you can simply open Lovable and click Share → Publish.

Deploy on Lovable

Go to Lovable and remix the project.

Deploy to Vercel

Clone, install dependencies and build:

git clone <YOUR_GIT_URL>
cd sora-json-prompt-crafter
npm install
npm run build

The build generates a dist directory containing the production build.

First install the Vercel CLI if you haven't already:

npm install -g vercel

Run the deploy command and follow the prompts:

vercel --prod

After completing the prompts, Vercel will upload the dist folder and provide a URL where your application is hosted. You can use any other hosting provider in a similar fashion by pointing it to the dist folder.

Environment Variables

Copy .env.example to .env and adjust values as needed.

  • VITE_MEASUREMENT_ID (optional) – Google Analytics measurement ID. Defaults to G-RVR9TSBQL7 if not set. See .env.example for the placeholder.
  • VITE_DISABLE_ANALYTICS (optional) – Set to true to disable all analytics tracking. Example provided in .env.example.
  • VITE_DISABLE_STATS (optional) – Set to true to disable fetching GitHub stats. Example provided in .env.example.
  • VITE_DISCLAIMER_URL (optional) – Path pattern for the disclaimer text. Include {locale} to load the correct language. Defaults to /disclaimers/disclaimer.{locale}.txt.
  • VITE_GTAG_DEBUG (optional) – Set to true to enable Google Analytics debug mode.

Custom Presets

Preset lists live under src/data/. You can add your own files there or merge presets at runtime. Use importCustomPresets from src/lib/presetLoader to load a JSON object (or URL via loadCustomPresetsFromUrl). The JSON can include stylePresets, cameraPresets, locationPresets and dndPresets keys matching the built‑in structures. Imported values are merged with existing presets so they become available in the UI.

Custom CSS/JS

Use the Settings panel to add custom CSS or JavaScript snippets that will be injected on startup. These values are stored locally and included in config exports and imports.

Contributing

Pull requests are welcome. Please open an issue first to discuss major changes.

Disclaimer

The full legal disclaimers are located under public/disclaimers/. They are copied to the dist directory during the build so they can be accessed from /disclaimers/. You can change the location by setting VITE_DISCLAIMER_URL to your own path pattern.

Supported Languages

  • English (US)
  • Spanish (Spain)
  • Portuguese (Portugal)
  • Russian
  • Portuguese (Brazil)
  • French
  • German (Germany)
  • Chinese (Simplified)
  • Italian
  • Spanish (Mexico)
  • English (UK)
  • Bengali
  • Japanese
  • English (Pirate)
  • Korean
  • Romanian
  • Swedish
  • Ukrainian
  • Nepali
  • Danish
  • Estonian
  • Finnish
  • Greek
  • Thai
  • German (Austria)
  • French (Belgium)
  • Spanish (Argentina)

To add a new language:

  1. Create src/locales/<locale>.json with the same keys as en-US.json.
  2. Add a matching disclaimer.<locale>.txt in public/disclaimers/.
  3. Import the locale in src/i18n.ts and include its flag under public/flags/.
  4. (Optional) run scripts/fill_translations.py to pre-fill untranslated keys.

Tracking/Analytics

Theres only anonymous usage that tracks actions but not data from the users that you can enable or disable from the Settings panel. Be aware that disabling tracking disables user side action log too. We ask kindly for you to still allow tracking for statistical and improvement purposes. No prompt data or inputs are ever tracked.

License

This project is licensed under the MIT License. Check license.md for more information.