Skip to main content

Command Palette

Search for a command to run...

ScriptGenie: ai-powered scriptwriting for short videos

Save time and effort by generating engaging scripts for Instagram, TikTok, YouTube Shorts, and beyond.

Updated
11 min read
ScriptGenie: ai-powered scriptwriting for short videos
E

Quick learner. Self-taught. Non-traditional professor. Former physics professor now into tech. 11+ years teaching experience. Web dev, blockchain and AI. Cryptocurrency investor.

Introduction

It's possible to use AI for good-quality short-form content creation only when it is used well.

You need to understand your process for content creation to get great results leveraging AI. Sometimes it takes some research, ideation, writing, recording, editing, and so on. But most of the time the hard part is getting clear what's in your content piece. The script.

Script Genie allows you to save part of that time on content creation by writing your script draft.

Background

I've been part of S5 on Nights & Weekend by Buildspace. And I came up with this idea: a beginner's guide to AI in 12 bite-sized videos.

But to be honest, I had no idea how to start creating these videos in batches for this series. So I got struggled.

A great hint on how to start creating content is to have references. And I have some to share:

(you must check their videos, these are sick!)

So I started studying their content.

The pacing, the script, the structure, the visuals, and so on.

And came up with the idea to replicate some of their process.

And that's where this assistant comes to solve the 'texts' parts of the content creation process.

The problem

Content creation tends to be complicated sometimes. Especially when you are starting.

AI has been used for content creation since it boomed, but no AI solves the content creation in video format at a high-quality level with just one click. Right?

Only if you put together your storytelling, scriptwriting, voice-over, and video editing skills, it could be a little bit easier. But it takes time and practice. And, of course, it's a must to have the skills.

But generative AI, especially LLMs, work with texts. So, setting apart most of these skills needed, we are going to focus on just one: script writing.

The solution

Getting references are the starting point for most of the stuff.

If you can get some reference in the type of content you would like to create, the process becomes easier.

But, where does AI come for this solution?

Here is how.

I've created a well-structured prompt that allows you to create scripts for your short content videos based on a set of definitions, steps to follow, and examples.

The examples are the core part. It's needed to set the inputs and outputs examples with descriptions and explanations on why these are good examples and why they are not.

Tech stack

Here is the tech stack that brings this assistant to life:

  • React as a framework.

  • NextJS for front-end and back-end using server actions.

  • TailwindCSS for layout and styles.

  • Vercel for deployment.

  • AI SDK (Vercel)

  • Groq for LLM service provider.

  • WhisperAI for gathering scripts from short-form videos.

  • KeywordsAI for app performance tracking.

Apart from the tech stack, the core part for this assistant is hard prompt writing skills. ;)

For the prompt:

  • I did some research to know what are the key aspects and components of a short-form content video. (Adding those concepts and ideas about what's short-form content is very important)

  • Then I set the instructions with steps and considerations for the script writing.

  • I added the section for the examples (inputs and outputs).

  • Finally, add a section for user inputs.

Prompt writing could be seen as an easy task, but it takes a lot of time for research when you don't have a clear idea of how content creation works.

And there is a lot of content about 'how to create good short-form content', but the one I found most useful was the information in one Instagram profile: Teezy (https://www.instagram.com/teezytheturtle/reels/) (you should give it a look)

For the examples, I chose some reels from the creators I've mentioned above and got the script using WhisperAI. But the script is not the only thing you need, but the description or explanation of how these scripts are being created.

So I reverse-engineered the scripts to come up with this structure:

  • theme or topic: a brief description of the topic or theme you want the script to be about.

  • main message: a concise statement of the main idea or message you want to convey to your audience.

  • target audience: a description of the target audience for the script, including their interests, needs, and level of understanding.

  • tone and style: an indication of the tone and style you want to convey in the script, such as formal, informal, humorous, or inspirational.

  • key concepts: a list of key concepts or ideas you want to include in the script.

  • desired length: an indication of the desired length of the script, such as 15 seconds, 30 seconds, 1 minute, etc.

  • examples or analogies: any examples, analogies, or metaphors you want to use to illustrate the concept or idea.

  • call to action: a description of the call to action you want to include at the end of the script, such as "learn more," "sign up," or "visit our website."

For the App:

  • Using create-next-app is a good starting point for most of the apps.

  • The app will have one layout.

    • It has a header for the title.

    • Includes one text area for the user's query.

    • And a section where the response is being shown.

    • It includes a button to submit the query.

    • When the app is loaded, you will see two columns. One for the user input and another one that contains hints about how to use the assistant.

    • When you submit the form ('generate script'), you will see a skeleton loader until the first token comes and starts the streaming.

  • It uses Vercel AI SDK to handle the OpenAI API compatibility to use Groq.

  • The app uses Server Actions to handle the interaction with the Groq provider.

  • The app is configured to be used with the Llama-3-70b model.

    • You can change to another model or even a different provider, but the prompt was written and optimized to be used with the model mentioned above.
  • You can find the full prompt template in a separate file: promptTemplate.tsx.

  • For KeywordsAI usage you only need to point to their endpoint and its URL base.

You can see details on how to use KeywordsAI for tracking metrics in the README.md file.

Features

  • You can put a simple and straight 'create a script about {topic}' and it will start creating, but it could be better.

  • You can provide a topic with the key message you want to share in your content piece.

  • You can come up with information (like a summary of a topic) and place it for the assistant to create your script.

  • You can set your target audience.

  • You can set the style and tone for your script

  • You can set additional references (examples) to set a bias for your script.

  • If you are trying to explain something on video, you can provide key concepts to be considered in the script.

  • You can add details about the call-to-action (CTA) for your script.

  • You can set the desired length for your script: words extension or duration.

  • You can set analogies to be used in your script.

  • And you can ask for feedback on your script.

You will find a fully detailed guide on how to use the app in the Hints component or on the main page.

How it works

The better the input, the better the output. This is basically what will give you high-quality scripts.

I will advise you to use most of the elements and their detailed descriptions in your input so you know what to tweak to change the output

Here is an example of how you can use it. It's inspired by the short video of Cleo Abram (watch it out here).

These are the components for your script input:

  • Theme/Topic: Cartography of the ocean floor

  • Main Message: The surface of the ocean reveals valuable information about the shape of the ocean floor due to gravity, and we can use this information to map the ocean floor.

  • Target Audience: People interested in science, technology, and the environment who want to learn something new and fascinating.

  • Tone and Style: Informal, conversational, accessible language with a touch of wonder and curiosity.

  • Key Concepts: Relationship between gravity and the shape of the ocean floor, use of satellites and radar to map the ocean floor.

  • Desired Length: It should be a short and concise script. Less than 300 words.

  • Examples or Analogies: Google Maps analogy, explanation of how satellites and radar work.

  • Call to Action: Invite the audience to learn more about ocean floor cartography and explore new related topics.

And here is how the output will look like:

Here's the script based on the input:

"Have you ever wondered what lies beneath the surface of the ocean? Well, it turns out that the surface itself holds a secret to unveiling the shape of the ocean floor. It's all thanks to gravity.

Think of it like Google Maps, but instead of streets and buildings, we're talking about mountains and valleys underwater. And just like how Google Maps uses satellites to map the Earth's surface, we can use those same satellites to map the ocean floor.

But how does it work?
Well, gravity is the key. You see, the ocean floor is not a flat, uniform surface. It has its own mountains and valleys, and those shape the surface of the ocean above it. By measuring the slight variations in the ocean's surface, we can infer what's going on beneath.

It's like using radar to detect the outline of a hidden object. We can't see it directly, but we can see how it affects the surface. And with advanced satellite technology, we can create detailed maps of the ocean floor.

So, what does this mean? It means we can discover new species, explore shipwrecks, and even learn more about the Earth's climate. The ocean floor is a treasure trove of secrets, and with cartography, we can start to uncover them.

Want to learn more about ocean floor cartography and explore the latest discoveries? Check out our resources and get ready to dive into the unknown!"

Please let me know if this meets your expectations!

If it looks like it's too long, remember you only need to ask for a short version or set it up on the input. Then you will get a short version like this:

Have you ever wondered what lies beneath the ocean's surface?
The truth is, the surface of the ocean is telling us a story.

Gravity is shaping the ocean floor, and we can use this information to map it.
Imagine Google Maps, but instead of roads and buildings, we're talking valleys and mountains... underwater!

Satellites and radar help us detect these changes in gravity, and with this data, we can create detailed maps of the ocean floor.

It's like having a treasure map to the unknown!

So, what do you say?
Are you ready to dive into the world of ocean floor cartography and discover its secrets?

Learn more and explore new topics with us!

About the prompt

The prompt has examples paired with inputs and outputs.

It means that the assistant understands it this way: 'When the user's query looks like this [input example], generate something like this [output example]'.

Here is the importance of it.

When you are starting with scripts for your short content video, you may be using references. But in the long term, you will craft your style on how to write it, how to set your pacing, and how it will sound when you are recording the voice-over.

So in the long term, you must change these input/output examples with your script examples.

You could choose those scripts that work for you and perform pretty well on social media.

How to use it locally

→ You can look at the repo here: https://github.com/Anewryzm/script-genie

1. Clone the repository:

git clone https://github.com/Anewryzm/script-genie.git

2. Install the dependencies:

npm install

3. Define your environment variables:

After cloning the repo, you will need to add this .env.local file at the root of the folder and set the following variables:

GROQ_BASE_URL=https://api.groq.com/openai/v1
GROQ_API_KEY=your_groq_api_key

4. Start the server and run the app:

npm run dev

5. Tracking metrics (optional):

For tracking metrics on this assistant you can use the KeywordsAI endpoint. You will be going to need to create an account first, then use this configuration on your .env.local file:

GROQ_BASE_URL=https://api.keywordsai.co/api/
GROQ_API_KEY=your_keywordsai_api_key

Then you will need to point to the right model name in src/app/actions.tsx. It may look like this:

...

const groq = createOpenAI({
  apiKey: process.env.GROQ_API_KEY,
  baseURL: process.env.GROQ_BASE_URL,
});
// Change the name from 'llama3-70b-8192' to 'groq/llama3-70b-8192'
const model = groq('groq/llama3-70b-8192')

export async function generateScript(query: string) {

...

Benefits

In short, this will save you time for scriptwriting and hours of research. You can even ask for feedback on your script.

You could see the information in this app as a well starting point for content creation.

It has a structure for the script, examples of inputs and outputs, and a lot of ways to configure it. (Take a look at the features sections)

In the long term, you will find your style and voice for short-form content creation. And you could leverage what you built, using what works well for you.

Possible improvements

  • Adding input fields for different parts of the query could be helpful to know what to fill out for the user.

Conclusions

Content creation does not have to be complicated. You only need to start with the first piece.

Scriptwriting is just a part of the process of content creation, but I know you could leverage your skills to enhance it and create high-quality content.

If you do so, leave in the comments what are you creating.

Thanks for reading.

Remember to check the repo here: https://github.com/Anewryzm/script-genie

You can fork it, clone it or just download it.

If you give it a try, let me know your thoughts.

T

AI-powered scriptwriting tools like ScriptGenie can be a game-changer for content creators, helping streamline the scriptwriting process for short videos. However, for those looking to enjoy a smooth creative workflow, having a quality vaping experience can also be a great way to relax and unwind. If you're into vaping, https://vape4usa.com offers an excellent selection of products to enhance your experience.

E
Evelynn1y ago

I recently had a tight deadline and was struggling to complete my assignments, so I turned to this paper writing service . The experience was fantastic! The writers delivered a well-researched, high-quality paper that met all my expectations. The process was easy and straightforward, and the support team was very responsive to my needs. I received my paper on time, and it was exactly what I needed. I highly recommend this service to anyone in a similar situation.

T

ScriptGenie sounds like a fantastic tool to streamline the scriptwriting process for short videos—can't wait to see the creativity it sparks! https://theapkasphalt.com

1
E

Thanks, Toby Bishop!

Let me know if you give it a try or if you need help using it locally.

F

I see myself using ScriptGenie; however, I couldn't set up the Groq model; I keep getting the error saying, "the model does not exist or you do not have access to it."

image.png

If you could clarify how to set it up clearly, it would be a big help. Cool project nonetheless.

1
E

thanks for testing it.

did you add the '.env.local' at the root of the folder?

E

If you have already set up the '.env.local' file you need to add the environment variables in Step 3:

https://cardoza.hashnode.dev/scriptgenie-ai-powered-scriptwriting-for-short-videos#heading-3-define-your-environment-variables

For the Groq API key, you only need to create an account and create a new on.

Let me know if you need some assistant with it.

Favourite Jome

E

in case you are trying to use keywords for tacking your metrics, you will need to go through an account validation process.

but for using it with Groq, make sure your model is configured like this on src/app/actions.tsx:

const model = groq('llama3-70b-8192')

Step 5 is completely optional to run the app on local. Feel free to run it following from step 1 to 4.

https://cardoza.hashnode.dev/scriptgenie-ai-powered-scriptwriting-for-short-videos#heading-how-to-use-it-locally