<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mia Tanaka</title>
    <description>The latest articles on DEV Community by Mia Tanaka (@miatanaka).</description>
    <link>https://dev.to/miatanaka</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4046021%2F2d8a5e77-dfef-4027-84d4-f340b5ea9e22.jpg</url>
      <title>DEV Community: Mia Tanaka</title>
      <link>https://dev.to/miatanaka</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/miatanaka"/>
    <language>en</language>
    <item>
      <title>Identity Consistency Is the Hard Part of Two-Person Image Generation</title>
      <dc:creator>Mia Tanaka</dc:creator>
      <pubDate>Fri, 24 Jul 2026 19:04:10 +0000</pubDate>
      <link>https://dev.to/miatanaka/identity-consistency-is-the-hard-part-of-two-person-image-generation-4b51</link>
      <guid>https://dev.to/miatanaka/identity-consistency-is-the-hard-part-of-two-person-image-generation-4b51</guid>
      <description>&lt;p&gt;Generating one convincing person from a reference photo is close to solved. Generating &lt;em&gt;two specific people&lt;/em&gt; in the same frame, both still recognisable, is a different problem — and it fails in ways single-subject generation does not.&lt;/p&gt;

&lt;h2&gt;
  
  
  Identity bleed
&lt;/h2&gt;

&lt;p&gt;Put two reference identities into one generation and they contaminate each other. You get a face that is an average of both, or person A wearing person B's jawline. The model has no inherent notion that these are two distinct people who must stay distinct.&lt;/p&gt;

&lt;p&gt;This gets worse the more similar the references are — same age range, same hair colour, similar bone structure. Exactly the case that matters most, since people generating a two-person photo are often family or partners.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why naive approaches fail
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Generating separately and compositing&lt;/strong&gt; keeps identity intact and produces obviously fake results. Lighting direction, colour temperature, film grain, and perspective never match. The human eye is extremely good at detecting this — it reads as a cut-out immediately.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One pass with both references&lt;/strong&gt; is where bleed happens.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Inpainting the second person&lt;/strong&gt; into a single-subject generation preserves the first identity well and tends to produce anatomically odd contact points — the classic four-arm hug, or hands that merge.&lt;/p&gt;

&lt;h2&gt;
  
  
  What helps
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Spatial conditioning up front.&lt;/strong&gt; Deciding &lt;em&gt;where&lt;/em&gt; each person goes before generation — via masks or layout conditioning — gives the model a structural reason to keep them separate. Identity constraints work far better when tied to a region than applied globally.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Per-region identity embeddings.&lt;/strong&gt; Scope each reference to its region rather than injecting both into global conditioning. This is the single biggest lever on bleed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Explicit contact handling.&lt;/strong&gt; Poses where subjects touch — arms around shoulders, holding hands — are where anatomy breaks. Worth treating contact-heavy poses as a distinct category with tighter constraints, not as ordinary generations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lighting coherence is the tell
&lt;/h2&gt;

&lt;p&gt;Even with identity solved, mismatched lighting kills realism. Both subjects need a shared light model: same key direction, same colour temperature, consistent shadow falloff.&lt;/p&gt;

&lt;p&gt;This argues for single-pass generation over compositing — the model gets lighting coherence for free when it renders both subjects together, and getting it right post-hoc is much harder than it sounds.&lt;/p&gt;

&lt;h2&gt;
  
  
  Evaluation is genuinely awkward
&lt;/h2&gt;

&lt;p&gt;There is no clean automatic metric. Face embedding similarity to each reference is necessary but not sufficient — you can score well on both and still produce an image that looks wrong, because "looks like a real photo of these two people" includes scene plausibility that embeddings do not capture.&lt;/p&gt;

&lt;p&gt;Practical compromise: embedding similarity as a gate, human review for the rest.&lt;/p&gt;

&lt;p&gt;I work on this at &lt;a href="https://duoportrait.com" rel="noopener noreferrer"&gt;DuoPortrait&lt;/a&gt; — two references in, one plausible shared photo out.&lt;/p&gt;

&lt;h2&gt;
  
  
  Caveat
&lt;/h2&gt;

&lt;p&gt;Everything above is empirical. The field moves fast enough that specific techniques age quickly; the failure modes have been more durable than the fixes.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>machinelearning</category>
      <category>python</category>
      <category>computervision</category>
    </item>
  </channel>
</rss>
