On This Page8 sections
Key Takeaways
- Trae supports image input as AI context, allowing screenshots, UI mockups, reference designs, diagrams, and other visual material to be combined with text prompts.
- Images can be added through common image-attachment workflows such as drag-and-drop, clipboard paste, project assets, or the image upload control.
- Multimodal input is especially useful for visual debugging, screenshot-to-code workflows, responsive UI fixes, design analysis, and visual regression investigation.
- Image support can depend on the selected AI model. A model must genuinely support visual input to interpret screenshots and other images.
- A screenshot alone is rarely the strongest prompt. Pair it with the relevant code, desired outcome, framework, constraints, and what must remain unchanged.
- For larger UI changes, ask Trae to analyze first and edit second. This reduces incorrect assumptions and unnecessary code changes.
- When several screenshots are involved, clearly explain what each image represents to avoid ambiguity.
Multimodal input changes Trae from a text-only coding assistant into a tool that can reason about what developers can see, not just what exists in source files.
Instead of describing a broken layout in several paragraphs, a developer can attach a screenshot and point Trae toward the relevant component. Instead of manually translating a mockup into CSS, the reference design can be supplied alongside the existing codebase. Instead of explaining a visual regression from memory, before-and-after screenshots can show the difference directly.
The important distinction is that multimodal input is not simply an image-upload feature. In an AI IDE, the strongest workflow combines visual context + repository context + explicit instructions.
What Is Multimodal Input in Trae?
Multimodal input means supplying more than one type of information to the AI in the same interaction.
In Trae, the most useful combination is:
Text instructions
+
Image or screenshot
+
Project files and code contextVisual context can include:
- UI screenshots
- error screens
- product mockups
- design references
- architecture diagrams
- browser DevTools screenshots
- terminal screenshots
- responsive-layout examples
This creates workflows that are difficult to reproduce with text alone.
For example, instead of writing:
The card is slightly too narrow, the image is too tall, the button is lower than in the design, and the spacing between the title and description looks wrong.A stronger request is:
Use the attached screenshot as the visual target.
Compare it with the current ProductCard component. Match the card width, image aspect ratio, typography hierarchy, vertical spacing, border radius, and button placement.
Preserve the existing component API and do not add a new UI library.The image communicates appearance while the prompt defines implementation boundaries.
How to Add an Image in Trae
There are several practical ways to provide visual context to Trae.
Method 1: Drag and Drop an Image
Drag an image from Finder, File Explorer, the desktop, or another supported source into the Trae conversation input.
This is useful for:
- screenshots
- downloaded mockups
- design exports
- browser captures
- diagrams
- reference images
After attaching the image, explain exactly what Trae should inspect.
Method 2: Use an Image from the Project
If the image already exists inside the project, include it from the project context when supported by the current interface.
A project might contain:
src/
├── components/
├── pages/
└── assets/
├── landing-reference.png
├── mobile-layout.png
└── checkout-error.pngThis is useful when visual assets and implementation files belong to the same repository.
Method 3: Paste an Image from the Clipboard
A fast debugging workflow is to capture a screenshot and paste it directly into the conversation.
On macOS:
Take screenshot → copy to clipboard → open Trae → Command + VOn Windows:
Take screenshot → copy to clipboard → open Trae → Ctrl + VThis is especially convenient for browser bugs, responsive issues, and visible runtime errors.
Method 4: Use the Image Upload Control
When an image is stored on disk, use Trae's image attachment or upload control when available in the current interface.
This is useful when drag-and-drop is inconvenient or several reference files need to be added deliberately.
Make Sure the Selected Model Supports Images
Not every model available through an AI IDE necessarily accepts image input.
A text-only model may work perfectly for:
- refactoring
- documentation
- code review
- test generation
- architecture questions
But image-based tasks require a model with visual-understanding capability.
If image attachments are unavailable or the selected model repeatedly fails to interpret them, verify the model's multimodal capabilities before troubleshooting the project itself.
For custom models, the underlying provider and model must genuinely support image input. Configuring a model inside the IDE does not automatically give it vision capabilities.
Best Use Case 1: Debug Errors from Screenshots
Visual debugging is one of the simplest high-value uses of multimodal input.
Suppose a web application displays an unexpected runtime error. Instead of manually transcribing everything visible on the page, attach the screenshot and provide repository context.
A useful prompt is:
Analyze the attached runtime-error screenshot.
The affected page is src/pages/dashboard.tsx.
Trace the likely cause through the relevant components and API calls.
First explain the most likely root cause and which files are involved. Do not edit anything yet.This works better than:
Why is my app broken?The stronger prompt provides four useful signals:
- the visual symptom
- the affected page
- the investigation scope
- permission boundaries
What Screenshots Are Good At Showing
Screenshots can communicate:
- browser error messages
- stack traces
- terminal output
- missing assets
- incorrect alignment
- rendering artifacts
- responsive-layout failures
- clipping and overflow
- typography differences
- unexpected UI states
However, a screenshot usually shows the symptom rather than the root cause. Repository context is still needed to determine why the problem occurs.
Best Use Case 2: Turn a UI Screenshot into Code
Multimodal input is particularly useful for frontend development.
A screenshot can communicate relationships that would otherwise require long descriptions:
- visual hierarchy
- section spacing
- container widths
- card density
- alignment
- border radius
- shadows
- image proportions
- typography scale
- button prominence
For example:
Recreate the attached dashboard design in the existing React project.
Use the current Tailwind setup and existing components where possible.
Do not install another UI framework.
Requirements:
- preserve the current sidebar behavior
- make the layout responsive
- match the screenshot's spacing and information hierarchy
- reuse existing chart components
- keep accessibility semantics intact
Before editing, identify the files that should change and explain the implementation plan.This is substantially stronger than:
Make this screenshot in React.The screenshot defines appearance, while the text defines engineering constraints.
Best Use Case 3: Compare the Current UI with a Target Design
One of the most effective multimodal workflows is visual comparison.
Attach a screenshot of the current application and a target reference, then ask Trae to identify meaningful differences.
A structured prompt can be:
Compare the attached current implementation with the target design.
Focus on:
1. page width
2. section spacing
3. typography scale
4. card dimensions
5. image aspect ratios
6. button placement
7. mobile behavior
Create a prioritized list of differences before making any code changes.The analysis-first approach prevents a common failure mode where an AI immediately changes CSS based on an incomplete interpretation of the design.
After reviewing the plan, continue with:
Implement the first four differences only. Preserve the current color system and component API.Smaller changes are easier to review and reverse.
Best Use Case 4: Reproduce a Bug from a Visual State
A screenshot may reveal an application state that is difficult to explain precisely.
Examples include:
- a dropdown appearing behind a modal
- a tooltip being clipped
- an image overflowing a card
- a mobile navigation menu covering content
- a loading skeleton with incorrect dimensions
- a chart overflowing its container
A strong request looks like:
The attached screenshot shows the bug at approximately 390px viewport width.
Inspect the mobile navigation and page-layout components. Determine why the menu overlaps the content instead of behaving correctly.
Do not rewrite the navigation system. Find the smallest CSS or layout change that fixes the issue without affecting desktop behavior.The prompt includes the viewport and explicitly restricts the scope of the fix.
Best Use Case 5: Analyze a Design Before Implementation
A visual reference is useful even when no code should be generated yet.
Trae can be asked to decompose an interface into implementation concepts:
Analyze this design as a frontend architecture task.
Identify:
- major page sections
- reusable components
- repeated UI patterns
- likely responsive breakpoints
- interactive elements
- data requirements
- components that should remain server-rendered or client-side
Do not generate code yet.This turns the image into an architecture artifact rather than immediately treating it as a code-generation target.
For complex interfaces, this often produces better results because implementation decisions can be reviewed before files are modified.
Best Use Case 6: Use Reference Images for Styling Direction
Not every image needs to be reproduced pixel-for-pixel.
A reference image can instead communicate a general style:
Use this image only as a visual style reference.
Apply its characteristics to the existing landing page:
- dense dark interface
- subtle borders
- strong typography hierarchy
- restrained gradients
- compact cards
Do not copy branding, logos, text, or distinctive artwork from the reference.
Preserve the current product information architecture.This distinction is valuable because visual inspiration and literal reproduction are different tasks.
Best Use Case 7: Explain Diagrams and Architecture Images
Multimodal input is not limited to screenshots of user interfaces.
It can also help with:
- architecture diagrams
- database diagrams
- sequence diagrams
- infrastructure screenshots
- workflow charts
- API diagrams
- whiteboard sketches
For example:
Analyze the attached architecture diagram and compare it with the current repository structure.
Identify which components already exist, which are missing, and where the diagram conflicts with the current implementation.
Do not assume the diagram is authoritative when the code shows otherwise.That final instruction matters because visual documentation can become outdated while the repository may represent the actual system state.
Combine Images with #File, #Folder, or Workspace Context
The strongest multimodal prompts do not rely on the image alone.
A useful mental model is:
Image = what the problem looks like
Code context = how the system currently works
Prompt = what outcome is requiredFor a component-level problem, attach the screenshot and reference the relevant file.
For a feature involving several components, include the relevant folder.
For architecture-level problems, use broader workspace context when necessary.
For example:
Use the attached screenshot together with the checkout-related project files.
Trace the implementation responsible for the order-summary panel and explain why its mobile width differs from the screenshot.This gives the model both visual and structural evidence.
A Better Prompt Formula for Multimodal Tasks
A reliable Trae multimodal prompt usually has five parts:
1. What the image represents
2. What should be analyzed
3. Which project context matters
4. What outcome is expected
5. What must not changeA reusable template is:
The attached image shows [current state / target design / error / reference].
Analyze [specific elements].
Use [files, folder, or project context] to understand the current implementation.
Goal:
[desired result]
Constraints:
- [constraint 1]
- [constraint 2]
- [constraint 3]
First provide a short implementation plan. Do not edit files until the plan is clear.This format significantly reduces ambiguity.
How to Prompt for Accurate Screenshot-to-Code Results
Screenshot-to-code prompts often fail because they describe only the visual goal.
A better prompt provides technical constraints.
Include details such as:
- framework: React, Vue, Svelte, Astro, or another stack
- styling system: Tailwind, CSS Modules, styled-components, or plain CSS
- reusable components that already exist
- responsive requirements
- browser targets
- accessibility requirements
- whether dependencies may be installed
- whether existing APIs must remain unchanged
For example:
Implement the attached design in src/pages/pricing.tsx.
Stack:
- React
- TypeScript
- Tailwind CSS
Constraints:
- reuse the existing Button and Card components
- do not install additional packages
- preserve the current pricing data structure
- support widths from 360px upward
- preserve keyboard accessibility
Match layout proportions and information hierarchy rather than blindly hardcoding pixel values.The last instruction helps avoid fragile layouts based on excessive absolute positioning.
Ask for Visual Reasoning Before Visual Editing
For complicated screenshots, separate analysis from implementation.
Step 1: Analyze
Analyze the screenshot and describe the component hierarchy, spacing system, responsive behavior, and likely reusable patterns. Do not edit files.Step 2: Map to Existing Code
Now inspect the project and map those visual sections to existing components. Identify which components should be reused, modified, or created.Step 3: Implement
Implement the approved structure while preserving existing behavior and APIs.Step 4: Review
Review the resulting implementation against the original screenshot. List the remaining visual differences and fix only high-impact mismatches.This staged workflow is usually safer than asking an autonomous agent to reproduce everything in one pass.
Working with Multiple Images
Multiple screenshots are useful for communicating states such as:
- desktop and mobile
- before and after
- current and desired
- light and dark themes
- collapsed and expanded components
- loading, success, and error states
However, multi-image prompts introduce reference ambiguity.
Instead of:
Make it like these images.Use an explicit mapping:
The first image represents the desktop target.
The second image represents the mobile target.
The third image shows the current implementation.
Use images 1 and 2 as the design requirements and image 3 only to understand the current mismatch.For complex tasks, it can be more reliable to submit images in separate steps rather than attaching a large gallery at once.
Multimodal Input for Responsive Development
A single desktop screenshot does not define a complete responsive interface.
For responsive work, provide multiple viewport examples whenever possible.
A useful set is:
Desktop: 1440px
Tablet: 768px
Mobile: 390pxThen ask Trae to infer layout transitions rather than simply scaling elements.
For example:
The three attached screenshots show the same page at desktop, tablet, and mobile widths.
Identify which layout changes are structural rather than proportional.
Implement responsive behavior using the existing Tailwind breakpoints.
Avoid fixed widths that reproduce only the screenshots themselves.This shifts the task from screenshot imitation to responsive-system implementation.
Multimodal Input for CSS Debugging
Visual input can be effective for CSS issues because screenshots expose relationships that source code alone may not reveal.
Good examples include:
- flexbox alignment
- grid sizing
- overflow
- stacking context
z-index- unexpected whitespace
- container queries
- image cropping
- text wrapping
- fixed and sticky elements
A focused request might be:
The attached screenshot shows the modal appearing behind the navigation header.
Inspect the relevant modal and navigation styles.
Explain the stacking context that causes the problem and apply the smallest fix.
Do not solve this by assigning an arbitrarily huge z-index unless it is structurally justified.That constraint encourages Trae to investigate the actual stacking context instead of applying a superficial patch.
Multimodal Input for Browser Errors
Screenshots of browser developer tools can be useful when they contain:
- console exceptions
- network failures
- CORS errors
- failed asset requests
- hydration warnings
- CSP violations
However, screenshots are less suitable when logs contain hundreds of lines or when exact searchable text matters.
For long logs, supplying the original text is generally better.
A hybrid approach works well:
Attached: screenshot showing the visible browser failure.
Included below: the exact console exception.
Trace the error through the current project and identify the root cause.Use the image for context and the text for precise technical data.
Multimodal Input for Terminal Problems
Terminal screenshots can help when the visible arrangement matters, but raw text remains preferable for exact commands and stack traces.
If only a screenshot is available:
Analyze the attached terminal screenshot.
Focus on the final error and the package names involved.
Ignore unrelated warnings above it.When possible, paste the error text as well.
The combination improves both visual understanding and token-level accuracy.
Multimodal Input for Existing Products and Competitor References
Developers often use screenshots from other products as inspiration.
A better engineering workflow is to describe the design principles to borrow instead of requesting blind duplication.
For example:
Use this screenshot as a UX reference for information density and navigation hierarchy.
Apply similar principles to the existing dashboard, but keep our current branding, copy, icons, data model, and component system.This often produces better product design because Trae must understand the principles behind the interface rather than merely copying surface details.
Common Mistake: Uploading an Image Without a Goal
This is one of the weakest possible prompts:
Fix this.The model must guess:
- what is wrong
- which project file is relevant
- whether the screenshot is current or desired
- which parts may change
- whether functionality or appearance matters
A better prompt is:
This screenshot shows the current mobile checkout page. The order-summary card overflows horizontally.
Find the component responsible for that card and fix the overflow at widths below 420px.
Preserve the desktop layout and do not change the checkout data model.Specificity reduces unnecessary changes.
Common Mistake: Assuming Every Visible Detail Is Intentional
Design screenshots can contain:
- placeholder content
- temporary icons
- accidental clipping
- inconsistent spacing
- browser-specific artifacts
- incomplete states
Do not instruct Trae to blindly reproduce every pixel.
Instead:
Treat the screenshot as the intended visual direction, not an exact specification. Preserve established accessibility and responsive conventions when they conflict with the screenshot.This gives the model room to apply engineering judgment.
Common Mistake: Asking for Pixel-Perfect Results Too Early
Pixel-level refinement should happen after the structure is correct.
A better order is:
- page structure
- component hierarchy
- responsive behavior
- typography
- spacing
- colors and borders
- fine visual polish
Trying to perfect shadows and four-pixel spacing differences while the component architecture is still wrong creates unnecessary rework.
Common Mistake: Giving the AI Too Much Visual Context
More screenshots do not automatically produce better results.
Ten partially related reference images can introduce conflicting styles and ambiguous requirements.
Prefer:
- one primary target
- one or two responsive variations
- one current-state screenshot when comparison is needed
If additional references are necessary, state what each image contributes.
Common Mistake: Forgetting Model Capability
If image attachments are unavailable or a custom model returns an unsupported-content error, verify whether the model actually accepts image input.
A model must have genuine vision capability to interpret an attached image. Configuration alone cannot turn a text-only model into a multimodal model.
Common Mistake: Exposing Sensitive Information in Screenshots
Screenshots can reveal more information than the code snippet being discussed.
Before uploading an image, check for:
- API keys
- access tokens
- passwords
- customer information
- private URLs
- internal hostnames
- account identifiers
- database credentials
- browser session data
Crop or redact sensitive regions when they are not necessary for the task.
This is particularly important for screenshots of terminals, browser developer tools, dashboards, and .env files.
Advanced Workflow: Screenshot to Existing Component
Suppose the project already contains a card component, but the target screenshot uses a different visual treatment.
Start with analysis:
Use the screenshot as the target design.
Inspect the existing ProductCard component and identify which differences can be handled through existing props and which require implementation changes.
Do not create a replacement component if the current abstraction can support the design cleanly.Then constrain implementation:
Update ProductCard to support the target layout while preserving all current usages.
Add a variant only if necessary.
Do not duplicate the component.This is better than generating a replacement from scratch because it respects the project's existing architecture.
Advanced Workflow: Visual Regression Investigation
Multimodal input can also help investigate a regression.
Provide:
- screenshot before the regression
- screenshot after the regression
- relevant Git diff or commit
Then ask:
Compare the before and after screenshots with the recent code changes.
Identify which change most likely caused the visual regression.
Prioritize causal evidence from the diff over speculative CSS edits.This turns visual comparison into a debugging workflow rather than a styling task.
Advanced Workflow: Design-to-Component Decomposition
For a complex page, ask Trae to identify reusable component boundaries before implementation.
Analyze the attached page design.
Propose a component tree that balances reuse and simplicity.
Identify:
- layout components
- reusable cards
- data-driven repeated elements
- interactive client components
- static content sections
Map the proposal onto the current repository structure and avoid creating components that are used only once unless they encapsulate meaningful behavior.This prevents the common AI-generated pattern of splitting every small visual element into a separate component.
Advanced Workflow: Design System Extraction
A collection of screenshots can be used to infer a design system.
Ask Trae to identify repeated tokens:
Analyze these product screenshots and extract the recurring visual system.
Identify likely:
- spacing scale
- typography hierarchy
- border radii
- surface hierarchy
- container widths
- button sizes
- card patterns
Compare the inferred system with the project's existing CSS variables and Tailwind configuration. Recommend the smallest changes needed to align them.This is more valuable than isolated page recreation because it converts visual references into reusable implementation rules.
When to Use Images and When to Use Text
Images are strongest when the problem is inherently visual.
| Task | Best Input |
|---|---|
| Layout mismatch | Image + code context |
| UI recreation | Image + implementation constraints |
| Responsive issue | Multiple screenshots + code |
| Short visible error | Screenshot + relevant file |
| Long stack trace | Raw text + optional screenshot |
| API response | Raw JSON or text |
| Architecture diagram | Image + repository context |
| Exact terminal command | Text |
| Visual regression | Before/after images + Git diff |
| Styling inspiration | Image + explicit design principles |
The best multimodal workflow uses each input type for what it communicates most accurately.
A Practical Multimodal Workflow in Trae
For most visual coding tasks, the following sequence works well.
1. Attach the Image
Add the screenshot, mockup, diagram, or other visual reference to the conversation.
2. Define What the Image Means
State whether it represents:
- current behavior
- desired behavior
- an error
- a design mockup
- a style reference
- a diagram
3. Add Repository Context
Point Trae toward the relevant file, directory, component, or broader project context.
4. State the Goal
Describe the concrete outcome.
5. Add Constraints
Specify what should remain unchanged.
6. Ask for Analysis First
For anything larger than a trivial fix, ask Trae to identify the relevant files and explain the implementation plan before editing.
7. Implement in Small Steps
Apply one coherent visual or functional change at a time.
8. Compare Again
After implementation, compare the result against the original screenshot and fix remaining high-impact differences.
This closed-loop process is more reliable than one-shot screenshot-to-code generation.
Best Prompt Template for Trae Multimodal Input
Use the following reusable structure:
The attached image represents: [current state / target / error / reference].
Task:
[describe exactly what needs to happen]
Relevant project context:
[file, folder, component, or workspace]
Focus on:
- [item 1]
- [item 2]
- [item 3]
Constraints:
- preserve [existing behavior]
- do not modify [protected area]
- reuse [existing component or technology]
- do not add dependencies unless necessary
First analyze the image and current implementation. List the files that need changes and explain the plan before editing.This format combines visual information with the engineering context needed for reliable code changes.
Conclusion
Multimodal input in Trae is most useful when images are treated as another source of engineering context rather than a replacement for precise prompts.
Use screenshots to communicate visual bugs, attach mockups when implementing interfaces, provide before-and-after images for regressions, and use diagrams to explain architecture.
For the strongest results, combine the image with relevant code context, define what the image represents, explain the desired outcome, and specify what must remain unchanged. Also verify that the selected model genuinely supports image input before troubleshooting failed multimodal requests.
The most effective next step is simple: take a real visual problem from the current project, attach the screenshot in Trae, point the AI to the responsible component, and ask for analysis before allowing any edits.
Continue Reading
More articles connected to the same themes, protocols, and tools.
Referenced Tools
Browse entries that are adjacent to the topics covered in this article.




