DEV Community

Jakub
Jakub

Posted on

Building with AI Pet Portrait APIs: What I Learned About Image-to-Image Generation

A developer's perspective on the emerging pet portrait AI space — what works, what doesn't, and what the best tools are doing right.


I've been exploring AI image generation APIs for the past few months, and one category that's surprised me with its quality improvement is pet portrait generation.

What started as a party trick ("turn your cat into a painting!") has become a genuinely interesting engineering problem — and some tools are solving it really well.

The Technical Problem

The core challenge in pet portrait generation is identity-preserving style transfer.

Here's why it's hard:

Input:  [photo of specific dog] + [style: "oil painting"]
Output: [oil painting of THAT specific dog, not just any dog]
Enter fullscreen mode Exit fullscreen mode

The naive approach — using a base text-to-image model with a style prompt — gives you "a dog in oil painting style." Generic. Not your dog.

The good solutions use a combination of:

  • Image conditioning (ControlNet, IP-Adapter, or similar) to anchor generation to the input image's structure
  • Fine-tuned identity encoding to capture individual-level features beyond just breed/species
  • Inpainting/outpainting for background handling
  • ESRGAN or similar for upscaling to print-quality resolution

What I Found When Testing

I tested Pet Imagination and several other tools from a developer's lens — looking at output quality, latency, and how well they preserved identity.

Pet Imagination stood out on the identity preservation front. Looking at the outputs:

  • Breed-specific features preserved ✅
  • Individual markings (spots, patches, specific coloring) preserved ✅
  • Facial expression/personality carries through ✅
  • Style adherence (actually looks like the target art style) ✅
  • Latency: ~45-60 seconds (reasonable for diffusion pipeline) ✅

The architecture assumptions I made from output analysis:

They're almost certainly using some variant of Stable Diffusion (SDXL or SD 1.5/2.x) with an IP-Adapter or similar image-conditioning approach. The way background handling works suggests either a segmentation step (separate pet from background) or masked inpainting.

The style variety they offer — Renaissance, watercolor, oil painting, fantasy, cosmic — suggests they have multiple fine-tuned LoRA weights or style-specific checkpoints rather than just prompt-engineering their way to different styles.

Why This Use Case Is Interesting for Developers

Pet portrait generation is a useful benchmark for image-to-image identity preservation in general. If you're building any product that needs to:

  • Transfer a user's face/identity into a different visual context
  • Apply artistic styles while preserving specific features
  • Handle the "it should look like my thing" problem

...then the techniques being used in good pet portrait generators are directly applicable to your problem.

Practical Takeaway

If you want to see what state-of-the-art identity-preserving style transfer looks like for consumer applications, Pet Imagination is worth a look — both as an end user product and as a reference for what quality level is achievable.

For builders: the approach combines strong image conditioning with style-specific fine-tuning. The hard part isn't the style transfer — it's retaining the specific individual's features through the diffusion process.


What are you building with image-to-image generation? I'm particularly interested in non-face use cases — drop a comment.

Top comments (0)