referenceImageUrl field to guide AI image generation with a reference image. By providing a reference, you can influence the style, composition, and visual tone of the generated image while still using a text prompt for the subject matter.
What You Will Learn
Style Guidance
Use a reference image to guide the visual style of AI-generated images
Brand Consistency
Maintain a consistent look across scenes using brand reference images
Composition Control
Influence the layout and composition of generated images
Validation Rules
Understand when and how to use reference images correctly
Before You Begin
Make sure you have:- A Pictory API key (get one here)
- Node.js or Python installed on your machine
- Sufficient AI credits in your account
- A publicly accessible image URL to use as a reference
- Familiarity with AI-generated background images
How It Works
When you providereferenceImageUrl in the aiVisual object:
- The AI model analyzes the reference image for style, color palette, composition, and visual tone
- Your text prompt describes the subject matter and content to generate
- The model combines the style influence from the reference image with the content from your prompt
- The result is an image that matches your prompt’s subject matter while adopting visual characteristics from the reference
referenceImageUrl is only available when background.type is "image". For video generation, use firstFrameImageUrl or referenceImageUrls instead.Configuration
AddreferenceImageUrl to the aiVisual object with a valid image URL:
Examples
Example 1: Single Story Without Prompt
One scene with a story paragraph and a reference image to guide style. The system splits the story into multiple scenes and auto-generates prompts. The reference image influences the visual style of all generated images.Example 2: Single Story with Creative Direction
Same as Example 1, but with aprompt that acts as creative direction for the entire video. Since the story is split into multiple scenes, the prompt guides the overall visual tone rather than describing a specific scene. A good creative direction prompt follows this structure: [Action/Movement] + [Scene/Environment] + [Camera Technique] + [Visual Style].
Example 3: Multiple Scenes with Prompts
Three separate scenes, each with a one-sentence story, a scene-specific prompt, and a reference image to guide the visual style.Example 4: Multiple Scenes Without Prompts
Three separate scenes, each with a one-sentence story and a reference image. No prompts are provided, so the system auto-generates a visual prompt from each scene’s story text.Tracking AI Credits Used
When your video includes AI-generated visuals, the job response includes anaiCreditsUsed field that reports the total AI credits consumed across all scenes. This field is present only when at least one scene used aiVisual configuration.
Best Practices
Choose Effective Reference Images
Choose Effective Reference Images
- Use images with clear style characteristics (color palette, lighting, mood)
- Avoid overly busy or cluttered reference images
- The reference image does not need to match the subject of your prompt; it guides style, not content
- High-quality reference images produce better style transfer results
Combine with Media Styles
Combine with Media Styles
You can use
referenceImageUrl alongside mediaStyle for layered control:mediaStylesets the broad visual category (photorealistic, artistic, cartoon, etc.)referenceImageUrlprovides specific style nuances within that category
Ensure Image Accessibility
Ensure Image Accessibility
- The image URL must be publicly accessible (no authentication required)
- Use direct image URLs (not page URLs that contain images)
- Supported formats include JPEG, PNG, and WebP
Troubleshooting
Error: referenceImageUrl Is Only Allowed When Type Is Image
Error: referenceImageUrl Is Only Allowed When Type Is Image
Cause:
referenceImageUrl is used with type: "video".Resolution:- Change
typeto"image"if you want to generate AI images - For video generation, use
firstFrameImageUrlorreferenceImageUrlsinstead
Generated Image Does Not Reflect the Reference Style
Generated Image Does Not Reflect the Reference Style
Cause: The AI model may weigh the text prompt more heavily than the reference image, or the reference image style characteristics may be subtle.Resolution:
- Use a reference image with strong, distinctive style characteristics
- Try a higher-quality model like
nanobananaornanobanana-profor better style adherence - Simplify your text prompt to give the reference image more influence
Next Steps
Visual Continuity
Create seamless transitions between consecutive scenes
First Frame Image
Control the starting frame of AI-generated video clips
Reference Images for Videos
Guide AI video generation with reference images
AI-Generated Background Images
Learn the basics of AI image generation
API Reference
Render Storyboard Video
Direct video rendering with AI visuals
Create Storyboard Preview
Create preview before rendering
