Week 2.2: External APIs & Advanced Media Generation
Week 2.2 Resources: External APIs & Advanced Media Generation
Required Accounts & Services
This week introduces external AI generation tools. You will need to set up an account to generate high-quality images.
- Fal.ai: A developer platform for generating media (Images, Video, Audio).
- Sign up for Fal.ai
- Note: This is a pay-as-you-go service. You will need to add credits (approx $10 is sufficient for testing) and generate an API Key.
Class Prompts (Local Media)
Use these prompts to test the local tools created in Week 2.1 before moving to external APIs.
1. Load Context:
read docs/project_overview.md. respond only that you understand2. Generate Shapes & Quotes:
create 5 random shape images in media/for each of the 5 images, write a 3-5 word inspirational quote and overlay it on the image3. Generate Slideshow:
also in media/, create a video slideshow of the images, 5 seconds per image4. Save as a Reusable Command:
create .claude/commands/create_random_shape_slideshow.md
- have it list the steps we just went through
- be brief and minimalClass Prompts (Fal.ai Integration)
These prompts guide the agent to research external documentation and build new tools.
1. Create the Spec File:
create specs/create_ai_image_tools.md2. Content for the Spec File: (Paste this content into the created file inside VS Code)
# AI Image Generation Tools
## WEB RESEARCH
- find the schema
- find python implementation
- URL: https://fal.ai/models/fal-ai/nano-banana
- URL: https://fal.ai/models/fal-ai/nano-banana/edit
## UPDATE tools/ai_image_tools.py
- UPDATE create_ai_image
- ADD output_path parameter
- have it save the result to the output path
- use nano banana
- UPDATE edit_ai_image(input_file, prompt, aspect_ratio="16:9")
- ADD output_path parameter
- have it save the result to the output path
- use nano banana/edit
## VERIFY all commands work
- FAL_API_KEY is defined in .env (you do not need to check)3. Create the Environment File:
Create a file named .env in your root folder and add your key:
FAL_API_KEY=your_key_here4. Implement the Tools:
/run_full_implementation specs/create_ai_image_tools.mdTesting the New AI Tools
Once the implementation is complete, use these prompts to generate high-quality assets.
1. Generate an Image:
generate an image of a cat riding a horse on the moon. save it in media/2. Edit an Image:
edit the image to make it a dogHelpful Links
- Fal.ai Model Explorer: Browse available AI models
- Nano Banana Model: Text-to-Image Model
- Nano Banana Edit: Inpainting/Edit Model
Source Code
The complete source code for Week 2 is available for download.
After downloading, extract the zip file and rename .env.example to .env, then add your API keys.