Runway Gen 4 Image
Runway's Gen-4 Image API enables precise, multimodal image generation for innovative creative and technical applications.
API
If you're looking for an API, you can choose from your desired programming language.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import requests
import base64
# Use this function to convert an image file from the filesystem to base64
def image_file_to_base64(image_path):
with open(image_path, 'rb') as f:
image_data = f.read()
return base64.b64encode(image_data).decode('utf-8')
# Use this function to fetch an image from a URL and convert it to base64
def image_url_to_base64(image_url):
response = requests.get(image_url)
image_data = response.content
return base64.b64encode(image_data).decode('utf-8')
# Use this function to convert a list of image URLs to base64
def image_urls_to_base64(image_urls):
return [image_url_to_base64(url) for url in image_urls]
api_key = "YOUR_API_KEY"
url = "https://api.segmind.com/v1/runway-gen4-image"
# Request payload
data = {
"promptText": "photo of a model wearing a cloth and standing in a garden.",
"referenceImages": [
{
"uri": "https://segmind-inference-inputs.s3.amazonaws.com/c226e2cf-49ea-4b8d-a630-9847c0efbbce-Beach-walk.png",
"tag": "model"
},
{
"uri": "https://segmind-resources.s3.amazonaws.com/output/cfda480d-86f3-4230-aed3-fcfae874df3b-saree.webp",
"tag": "cloth"
}
],
"ratio": "1280:720"
}
headers = {'x-api-key': api_key}
response = requests.post(url, json=data, headers=headers)
print(response.content) # The response is the generated image
Attributes
Describes the desired animation. Use 'rainforest waterfall' for nature or 'cyberpunk alley' for futurism.
A list of images.
Sets output aspect ratio. Choose 1280:720 for YouTube or 1920:1080 for HD movies.
Allowed values:
To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.
Resources to get you started
Everything you need to know to get the most out of Runway Gen 4 Image
Guide to Using Runway’s Gen-4 References Model Effectively
Runway’s Gen-4 Image API with the Gen-4 References model enables powerful multimodal image synthesis. By combining concise text prompts, high-quality reference images, and the right aspect ratio, you can tailor outputs for a variety of creative and technical applications. Below is a 300–400-word guide to help you get the most out of this model.
1. Crafting Precise Text Prompts
- •Be specific: Instead of “forest,” use “rainforest waterfall with mist and vibrant ferns.”
- •Use style keywords: Add “watercolor style,” “cyberpunk neon,” or “photorealistic render.”
- •Include action or mood: Words like “glowing,” “dynamic,” or “serene” refine ambiance.
2. Selecting Reference Images
- •High-resolution: Use detailed art or high-quality photos for intricate styles.
- •Consistent lighting: Keep shadows and highlights uniform across references.
- •Multiple angles: Provide front, side, and close-up views when modeling 3D assets or clothing.
- •Example:
"referenceImages": [ "https://example.com/rainforest1.png", "https://example.com/falls_sideview.jpg" ]
3. Tuning Aspect Ratio
Choose aspect ratio based on output medium:
- •1920:1080 (HD movies, streaming)
- •1280:720 (YouTube standard)
- •1080:1920 (Instagram Stories, TikTok)
- •960:960 (Square social posts)
4. Parameter Recommendations by Use Case
Use Case | Prompt Example | Reference Tips | Aspect Ratio |
---|---|---|---|
Virtual Try-On | “futuristic sneaker on rotating platform” | Clean white background; 360° shoe shots | 1280:720 |
Gaming Asset Creation | “medieval sword with glowing runes” | Close-up handle and blade details | 1920:1080 |
Interior Design | “modern living room with floor-to-ceiling glass” | Wide-angle room shots; lighting fixtures | 1584:672 |
Social Media Promo Graphics | “neon cyberpunk cityscape at dusk” | Skyline panoramas; bright neon accents | 1080:1920 |
5. Advanced Tips
- •Bounding Boxes: Pinpoint and alter specific sections (e.g., walls, clothing) for localized edits.
- •Iterate Quickly: Tweak prompt adjectives (“soft” vs. “sharp”) to refine style.
- •Pipeline Integration: Embed API calls into your design or game engine for on-demand generation.
Conclusion
By combining descriptive prompts, curated reference images, and the optimal aspect ratio, Runway’s Gen-4 References model can accelerate prototyping, enhance creative workflows, and produce stunning, context-aware imagery for virtually any application. Experiment with small parameter tweaks to discover new visual possibilities.
Other Popular Models
Discover other models you might be interested in.
idm-vton
Best-in-class clothing virtual try on in the wild

face-to-many
Turn a face into 3D, emoji, pixel art, video game, claymation or toy

faceswap-v2
Take a picture/gif and replace the face in it with a face of your choice. You only need one image of the desired face. No dataset, no training

codeformer
CodeFormer is a robust face restoration algorithm for old photos or AI-generated faces.
