GitHub Copilot + Inliner.ai Integration

Set up GitHub Copilot to automatically generate Inliner.ai image URLs in your code. Transform your development workflow with AI-powered image generation directly in your IDE.

Satisfied developer working efficiently at desk with VS Code open

This is what you'll accomplish - seamless development with automatic image generation

This tutorial will show you how to configure GitHub Copilot to automatically generate Inliner.ai image URLs when you request code that includes images. By adding specific instructions to your project's README.md or using comments in your code, you'll enable seamless image generation without leaving your development environment.

Prerequisites

Important: Replace inliner-demo with your actual project namespace from Inliner.ai. Each project has a unique namespace that appears in your image URLs.

How to Set Up GitHub Copilot with Inliner.ai

To get started, you'll need GitHub Copilot enabled in your IDE. Go to GitHub Copilot →

Step 1: Get Your Inliner.ai Project Instructions

First, you need to get the specific instructions for your Inliner.ai project. Here's how:

  1. Log into your Inliner.ai account
  2. Go to the Projects section
  3. Find your project and click the LLM Instructions button
  4. In the modal that opens, click the Copy button next to "GitHub Copilot"
Pro Tip: If you haven't created a project yet, create one first in Inliner.ai. The project name will be used in all your image URLs.

Step 2: Add Instructions to Your Project

Now you'll add the instructions to your project. You have two main options:

Option A: Add to README.md

  1. Open your project in VS Code
  2. Create or edit the README.md file
  3. Paste the instructions you copied from Inliner.ai
  4. Save the file

Option B: Use Comments in Code

  1. Open any file where you want to generate images
  2. Add a comment block with the Inliner.ai instructions
  3. Copilot will use these instructions for that file

File Structure

your-project/
├── README.md              # GitHub Copilot instructions
├── src/
│   ├── components/
│   │   └── Hero.jsx       # Can include inline comments
│   └── pages/
├── public/
├── package.json
└── .gitignore

Step 3: Test the Integration

Now you can test the integration by asking Copilot to generate code with images:

Example Prompts to Test

  • Type a comment: // Create a hero section with background image
  • Start typing: <img src= and let Copilot suggest the URL
  • Ask in comments: // Generate product showcase with images
  • Describe the component: // Landing page with hero, features, testimonials

How It Works

When you ask Copilot to generate code that includes images, it will now automatically:

Example Output

Here's what Copilot will generate when you ask for a hero section:

Copilot Response

// Hero Section Component
import React from 'react';

const HeroSection = () => {
  return (
    <section className="hero">
      <div className="hero-content">
        <h1>Welcome to Our Platform</h1>
        <p>Transform your workflow with AI-powered tools</p>
        <button className="cta-button">Get Started</button>
      </div>
      <div className="hero-image">
        <img 
          src="https://img.inliner.ai/inliner-demo/modern-office-team-collaboration_800x600.png"
          alt="Team collaborating in a modern office environment"
          className="hero-bg"
        />
      </div>
    </section>
  );
};

export default HeroSection;

Generated Image Output:

Team collaborating in a modern office environment

The image above was generated using the URL from the code example. Notice how Copilot automatically creates a professional, realistic image that perfectly fits the hero section context.

Common Use Cases & Dimensions

Copilot will automatically use appropriate dimensions based on the context:

Use Case Dimensions Example
Hero images 1200x600, 1920x1080 hero-banner-startup-meeting_1200x600
Product images 800x800, 600x400 product-lifestyle-showcase_600x800
Profile photos 400x400, 300x300 user-avatar-profile-photo_400x400
Thumbnails 200x200, 150x150 feature-icon-graphic_200x200

Advanced Features

Custom Prompts

If you've set up custom prompts in your Inliner.ai project, Copilot will automatically apply them to all generated images, ensuring consistent branding and style.

Reference Images

If your project has reference images uploaded, Copilot can reference them in the generated URLs to maintain visual consistency with your brand assets.

Inline Comments for Specific Instructions

You can add specific instructions directly in your code comments:

Inline Comment Example

// Inliner.ai Image Integration
// Use project: inliner-demo
// Prefer realistic, professional imagery
// Include responsive srcset for hero images

const LandingPage = () => {
  return (
    <div>
      {/* Hero section with background image */}
      <section className="hero">
        <img 
          src="https://img.inliner.ai/inliner-demo/hero-banner-startup-meeting_1200x600.png"
          alt="Startup team in modern office"
          className="hero-bg"
        />
      </section>
    </div>
  );
};

README.md Integration

Add the instructions to your README.md for project-wide Copilot integration:

README.md Example

# My Project

## Development

This project uses GitHub Copilot with Inliner.ai for image generation.

### Image URLs
When generating code that requires images, use Inliner.ai URLs:

Format: https://img.inliner.ai/inliner-demo/description_WIDTHxHEIGHT

Guidelines:
- Use descriptive, professional image names
- Include dimensions for layout requirements
- Generate semantic alt text
- Prefer realistic, professional imagery

Common patterns:
- Hero images: _1200x600, _1920x1080
- Product images: _800x800, _600x400
- Profile photos: _400x400, _300x300
- Thumbnails: _200x200, _150x150

Examples:
- https://img.inliner.ai/inliner-demo/modern-office-team-collaboration_800x600.png
- https://img.inliner.ai/inliner-demo/hero-banner-startup-meeting_1200x600.png
- https://img.inliner.ai/inliner-demo/user-avatar-profile-photo_400x400.png
- https://img.inliner.ai/inliner-demo/product-lifestyle-showcase_600x800.png
- https://img.inliner.ai/inliner-demo/dashboard-charts-analytics_800x400.png
- https://img.inliner.ai/inliner-demo/mobile-app-interface-preview_400x800.png
- https://img.inliner.ai/inliner-demo/customer-testimonial-portrait_300x300.png
- https://img.inliner.ai/inliner-demo/feature-icon-graphic_200x200.png
- https://img.inliner.ai/inliner-demo/blog-header-image_800x400.png
- https://img.inliner.ai/inliner-demo/pricing-background-pattern_600x400.png

Use cases:
- Landing pages: hero images, feature sections
- User interfaces: avatars, icons, thumbnails
- Product pages: showcases, galleries, previews
- Marketing: banners, testimonials, backgrounds
- Documentation: screenshots, diagrams, examples
Pro Tip: You can ask Copilot to generate multiple variations of the same image by requesting different styles or compositions. Each will create a unique URL that you can use for A/B testing.

Troubleshooting

Common Issues

Best Practices

Workflow Tip: Once set up, you can ask Copilot to generate entire image sets for landing pages, portfolios, or marketing materials by describing the component or page you're building. The AI will create all the necessary URLs with appropriate dimensions and descriptions.

Next Steps

Now that you have GitHub Copilot integrated with Inliner.ai, you can:

Ready to transform your development workflow? Start generating images with GitHub Copilot and Inliner.ai today!

Ready to Integrate GitHub Copilot with Inliner.ai?

Create your first project and start generating images automatically