How to add real images to a v0 or Bolt generated UI component
AI-generated UIs look stunning with placeholders, but integrating real images often breaks the layout. Discover how Shufaf bridges the gap, allowing you to preview, optimize, and export production-ready assets that fit perfectly into your v0 or Bolt components, every time.

Try it directly in Shufaf
No signup required to preview
Let's be honest: AI-powered UI generators like v0.dev, Bolt, Lovable, and Cursor are incredible. They whip up beautiful, functional components in seconds, complete with sleek layouts and modern aesthetics. You paste the code, and boom – a perfect card, a user profile, a product listing.
But then comes the moment of truth.
You swap out the generic grey box or the lorem-picsum URL for your actual product image, your client's logo, or a real user avatar. And just like that, the magic dissipates. The layout breaks. Images are stretched, squashed, or overflow their containers. Margins go wild. What looked perfect with a placeholder now looks… well, wrong.
This isn't a flaw in the AI; it's a fundamental mismatch. AI tools don't know the specific aspect ratio, dominant subject, or background context of your actual assets. They generate a design with generic image placeholders. Your real images, however, come with their own unique properties.
There is a better way.
The Placeholder Problem: Why AI-Generated UIs Fall Apart with Real Assets
The core issue boils down to a few key factors:
- Arbitrary Dimensions and Aspect Ratios: AI-generated components often assume a specific, often square or common rectangular, aspect ratio for their image placeholders. Your real images rarely conform perfectly. A vertical product shot in a horizontal slot, or a wide banner in a square avatar frame, is a recipe for disaster.
- Lack of Contextual Cropping: Placeholders are just boxes. Your real images have subjects. If an image is simply scaled to fit, important parts might be cut off, or the subject might be too small or too large.
- Background Clutter: Many AI tools generate clean, often white or transparent, backgrounds around their image placeholders. If your real image has a busy background, it can clash with the clean UI, making the component look unprofessional or visually noisy.
- Performance Overhead: Dropping a massive, unoptimized image into a component designed for a small placeholder can severely impact page load times, especially on mobile.
Manually fixing this involves a tedious dance between a photo editor, a browser, and your code editor. You'd crop, resize, export, refresh, and repeat until it "looks right." This is slow, frustrating, and prone to inconsistencies.
Bridging the Gap: The Shufaf Workflow for Production-Ready Assets
This is precisely the problem Shufaf was built to solve. Shufaf (shufaf.com) isn't just another image optimizer; it's an asset preview, background removal, and optimization platform designed to integrate seamlessly into your developer and designer workflow.
With Shufaf, you can:
- Preview Images in Context: See exactly how your real asset will look before you even touch your code, ensuring it fits the component's dimensions and aspect ratio.
- Effortlessly Remove Backgrounds: Instantly isolate subjects for a clean, professional look that matches your AI-generated UI's aesthetic.
- Optimize for Performance: Get perfectly sized and compressed images, ensuring your UI remains fast and responsive.
- Maintain Layout Integrity: Export assets that are tailor-made for your component's requirements, preventing layout shifts and broken designs.
Step-by-Step: Integrating Real Images into Your AI-Generated UI with Shufaf
Let's walk through the process using a common scenario: a user profile card generated by v0.dev.
Step 1: Identify the Placeholder in Your AI-Generated Code
First, paste your AI-generated component code into your project. Then, locate the image placeholder. It might look something like this in a React/Next.js component:
// components/user-card.tsx
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"
export function UserCard() {
return (
<div className="flex items-center space-x-4 p-4 border rounded-lg shadow-sm">
<Avatar className="h-12 w-12">
<AvatarImage src="/placeholder-user.jpg" alt="User Avatar" />
<AvatarFallback>JD</AvatarFallback>
</Avatar>
<div>
<h3 className="text-lg font-semibold">Jane Doe</h3>
<p className="text-gray-500 text-sm">Software Engineer</p>
</div>
</div>
)
}Notice the src="/placeholder-user.jpg" in AvatarImage. The Avatar component also has h-12 w-12 (which translates to 48px by 48px) defining its size. This tells us our target image should be square and ideally 48x48 pixels, or at least have a 1:1 aspect ratio.
Step 2: Upload Your Real Asset to Shufaf
- Open your browser and navigate to → Try Shufaf Studio.
- Drag and drop your real user avatar image (e.g.,
my-real-avatar.jpg) directly onto the Shufaf canvas.
Step 3: Preview and Adjust Dimensions/Aspect Ratio
Now, the magic happens.
- Once uploaded, your image appears in the Shufaf preview area.
- In the right-hand panel, under "Dimensions," you'll see options to adjust
Width,Height, andAspect Ratio. - Since our v0 component uses
h-12 w-12(48x48px), set bothWidthandHeightto48. - Observe the preview. Shufaf will intelligently crop or scale your image to fit these dimensions while maintaining the subject's focus as much as possible. You can fine-tune the crop area if needed.
Step 4: Optimize and Remove Background (If Needed)
For a clean, professional look that blends seamlessly with your AI-generated UI:
- In the Shufaf panel, locate the "Background" section.
- Click the "Remove Background" button. Shufaf's advanced AI will instantly isolate the subject, giving you a transparent background. This is crucial for avatars or product images that need to sit cleanly on any UI background.
- Under "Optimization," choose your desired compression level. For a small avatar, a higher compression (smaller file size) is usually ideal.
Step 5: Download and Implement
- Once you're happy with the preview, click the "Download" button. Shufaf will export your perfectly sized, optimized, and background-removed image.
- Save the image to your project's
publicfolder (e.g.,public/avatars/jane-doe.webp). - Update your component code:
// components/user-card.tsx
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"
export function UserCard() {
return (
<div className="flex items-center space-x-4 p-4 border rounded-lg shadow-sm">
<Avatar className="h-12 w-12">
{/* Updated src with the Shufaf-processed image */}
<AvatarImage src="/avatars/jane-doe.webp" alt="Jane Doe Avatar" />
<AvatarFallback>JD</AvatarFallback>
</Avatar>
<div>
<h3 className="text-lg font-semibold">Jane Doe</h3>
<p className="text-gray-500 text-sm">Software Engineer</p>
</div>
</div>
)
}Now, refresh your UI, and behold! Your real image fits perfectly, the layout is intact, and your component looks production-ready.
Visualizing the Transformation: From Placeholder to Perfection
+-----------------------------------------------------------------------+
| |
| RAW ASSET AI-GENERATED UI CODE |
| (e.g., high-res JPG, busy background) (e.g., v0.dev output) |
| |
| +---------------------+ +-------------------+ |
| | | | <img src="/ph.jpg" | |
| | My Product Image | | width="200" | |
| | (2000x1500px) | | height="150" | |
| | | | /> | |
| +---------------------+ +-------------------+ |
| |
+-----------------------------------------------------------------------+
|
| Upload to Shufaf Studio
V
+-----------------------------------------------------------------------+
| |
| SHUFAF PROCESSING & PREVIEW |
| (shufaf.com/#studio) |
| |
| +-----------------------------------------------------------------+ |
| | [Preview Canvas] | |
| | | |
| | +-----------------------------------------------------------+ | |
| | | Original Image | | |
| | | +-----------------------------------------------------+ | | |
| | | | | | | |
| | | | | | | |
| | | | [Subject Highlighted] | | | |
| | | | | | | |
| | | | | | | |
| | | +-----------------------------------------------------+ | | |
| | +-----------------------------------------------------------+ | |
| | | |
| | [Controls] | |
| | - Target Width: [ 200 ] px | |
| | - Target Height: [ 150 ] px | |
| | - Aspect Ratio: [ Auto / 4:3 ] | |
| | - Background: [ Remove Background ] | |
| | - Optimization: [ High / Medium / Low ] | |
| +-----------------------------------------------------------------+ |
| |
+-----------------------------------------------------------------------+
|
| Download Optimized Asset
V
+-----------------------------------------------------------------------+
| |
| PRODUCTION-READY ASSET UPDATED UI CODE|
| (e.g., optimized WEBP, transparent background) (e.g., React/Next.js)|
| |
| +---------------------+ +-------------------+ |
| | | | <img src="/prod.webp"| |
| | Optimized Image | | width="200" | |
| | (200x150px) | | height="150" | |
| | | | /> | |
| +---------------------+ +-------------------+ |
| |
+-----------------------------------------------------------------------+
Shufaf vs. The Old Way: A Comparison
Let's put Shufaf's approach side-by-side with traditional methods:
| Feature | Manual Edits (Photoshop/Figma) | Generic Online Tools (e.g., basic resizers) | Shufaf |
|---|---|---|---|
| Speed | Slow, iterative. Requires opening software, manual cropping, resizing, saving, re-uploading. | Moderate. Faster for simple tasks, but often lacks precision and features. | Fast, intuitive. Drag, set dimensions, remove background, download. |
| Layout Quality | Requires expertise to match exact component needs. Prone to human error. | Often results in stretched/squashed images or incorrect aspect ratios, breaking layout. | Preserves layout. Assets are precisely tailored to component dimensions and aspect ratios. |
| Cost | Software subscriptions (e.g., Adobe Creative Cloud), significant time investment. | Mostly free (with ads or limitations), but time spent on rework adds up. | Free tier available, paid plans for advanced features/higher usage. Saves significant developer/designer time. |
| Contextual Preview | No. You edit in isolation, then test in browser. | No. Edits are generic, not tied to your specific UI component. | Yes. See exactly how your image will appear at target dimensions before downloading. |
| Background Removal | Manual selection, masking, or specialized plugins. Time-consuming. | Basic, often imprecise, or requires manual touch-ups. | Advanced, one-click AI background removal. Clean and precise. |
| Optimization | Manual export settings, often requires trial-and-error for best balance. | Limited options, sometimes sacrifices quality for size. | Intelligent compression for optimal file size without compromising visual quality. |
| Workflow Friction | High. Constant context switching between tools. | Moderate to High. Jumping between multiple single-purpose tools. | Low. Streamlined process within a single, purpose-built platform. |
Beyond Placeholders: The Power of Contextual Asset Management
The "placeholder problem" is just one symptom of a larger challenge in modern web development: managing visual assets effectively within a rapidly evolving design and development landscape. As AI tools become more prevalent, the need for intelligent asset pipelines that understand context and optimize for performance will only grow.
Shufaf empowers developers and designers to focus on building great experiences, not wrestling with image dimensions or background removal. It's about ensuring visual consistency, maintaining performance, and accelerating your workflow, especially when integrating with the exciting new wave of AI-generated UI components.