<?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: Motaz Hefny</title>
    <description>The latest articles on DEV Community by Motaz Hefny (@fahhim).</description>
    <link>https://dev.to/fahhim</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%2F4231230%2Fea9ef915-1669-451a-aeba-852b8168abeb.jpg</url>
      <title>DEV Community: Motaz Hefny</title>
      <link>https://dev.to/fahhim</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/fahhim"/>
    <language>en</language>
    <item>
      <title>Why your AI video prompts produce morphing hands and flickering faces (and the syntax that fixes it)</title>
      <dc:creator>Motaz Hefny</dc:creator>
      <pubDate>Sat, 07 Nov 2026 01:29:42 +0000</pubDate>
      <link>https://dev.to/fahhim/why-your-ai-video-prompts-produce-morphing-hands-and-flickering-faces-and-the-syntax-that-fixes-it-2clb</link>
      <guid>https://dev.to/fahhim/why-your-ai-video-prompts-produce-morphing-hands-and-flickering-faces-and-the-syntax-that-fixes-it-2clb</guid>
      <description>&lt;p&gt;Most AI video generators fail for the same three reasons: the camera moves when it should not, hands melt, and faces shift between frames. I have spent the last few months building prompt frameworks for Kling, Runway, Sora, and Luma, and the failures are not random. They follow patterns.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Video prompts are shot briefs, not sentences
&lt;/h2&gt;

&lt;p&gt;Text models read a prompt as one stream. Video models decompose it into shots: camera, subject, motion, lighting, duration. If your prompt reads as a sentence, the model guesses the shot structure. If it reads as a brief, the model executes it.&lt;/p&gt;

&lt;p&gt;Weak:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A man walking in a rainy street at night, cinematic, beautiful.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The camera is undefined, so it drifts. "Beautiful" is undefined, so it samples. Better:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Close-up, locked camera. A man in a dark coat walks toward the lens on a wet asphalt street, neon reflections. Shallow depth of field, 35mm look. Slow push-in only. Rain in focus. 5 seconds.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Every verb is assigned to exactly one layer: camera, subject, environment, optics, duration.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Motion must be budgeted — one primary movement per shot
&lt;/h2&gt;

&lt;p&gt;The number one cause of morphing is competing motion. If the subject walks AND the camera pans AND the background crowds move, the model spends its motion budget on all three and none stays stable.&lt;/p&gt;

&lt;p&gt;The rule I apply in the CINE framework:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;One primary motion&lt;/strong&gt; (subject or camera, never both).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Secondary motion&lt;/strong&gt; limited to environment (rain, steam, hair).&lt;/li&gt;
&lt;li&gt;Everything else frozen.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. Anti-morphing constraints are syntax, not adjectives
&lt;/h2&gt;

&lt;p&gt;"High quality" does nothing. Specific negative constraints do. What actually holds faces and hands together:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Facial integrity&lt;/strong&gt;: "consistent facial features across all frames, no identity drift"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Anatomy guard&lt;/strong&gt;: "stable hand anatomy, five fingers, no merging of limbs"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Temporal smoothing&lt;/strong&gt;: "smooth temporal interpolation, no flicker or frame popping"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Anti-flicker&lt;/strong&gt;: "consistent lighting across frames, no exposure jumps"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On Kling and Runway these go in the negative-prompt field or as explicit constraints in the prompt. On Sora-style single-field models, they must be stated positively: "the face remains identical in every frame."&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Engine-specific tuning
&lt;/h2&gt;

&lt;p&gt;Each engine has quirks worth knowing:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Engine&lt;/th&gt;
&lt;th&gt;Quirk&lt;/th&gt;
&lt;th&gt;Fix&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Kling (v1.5/v2.0)&lt;/td&gt;
&lt;td&gt;Ignores negative prompts partially&lt;/td&gt;
&lt;td&gt;State constraints positively in the main prompt&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Runway Gen-3/4&lt;/td&gt;
&lt;td&gt;Drifts camera if two verbs&lt;/td&gt;
&lt;td&gt;One camera verb max&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Luma&lt;/td&gt;
&lt;td&gt;Temporal flicker in fast motion&lt;/td&gt;
&lt;td&gt;"smooth slow motion" + duration cap&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sora/Veo&lt;/td&gt;
&lt;td&gt;Over-interprets "cinematic"&lt;/td&gt;
&lt;td&gt;Specify lens and lighting explicitly&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  5. The three frameworks
&lt;/h2&gt;

&lt;p&gt;I built this into a small tool — &lt;strong&gt;Fahhim (فهّم)&lt;/strong&gt; — as three separate frameworks because the failure modes differ:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CINE&lt;/strong&gt; — cinematic scenes: camera, lens, lighting, motion budget.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;I2V&lt;/strong&gt; — image-to-video animation: locks the input image's identity, animates only what you specify.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SHOT&lt;/strong&gt; — commercials and social video: hook in frame 1, fast cuts, aspect ratio, on-screen text zones.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The app is free, works offline, and keeps your prompts on the device — which matters if your prompts contain unreleased product footage descriptions or client names.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;App: &lt;a href="https://play.google.com/store/apps/details?id=com.prompti.app" rel="noopener noreferrer"&gt;https://play.google.com/store/apps/details?id=com.prompti.app&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Web version and prompt library: &lt;a href="https://fahhim.moteklab.com" rel="noopener noreferrer"&gt;https://fahhim.moteklab.com&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you are building video prompts today, the single highest-leverage change: write the camera instruction first, then forbid secondary motion. That one move fixes more flicker than any "cinematic" adjective.&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>ai</category>
      <category>productivity</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Arabic breaks most prompt templates — here is the structure that survives</title>
      <dc:creator>Motaz Hefny</dc:creator>
      <pubDate>Fri, 06 Nov 2026 23:56:40 +0000</pubDate>
      <link>https://dev.to/fahhim/arabic-breaks-most-prompt-templates-here-is-the-structure-that-survives-g3o</link>
      <guid>https://dev.to/fahhim/arabic-breaks-most-prompt-templates-here-is-the-structure-that-survives-g3o</guid>
      <description>&lt;p&gt;Most prompt engineering advice assumes English. You copy a six-part template, translate it into Arabic, and the output comes back &lt;em&gt;almost&lt;/em&gt; right. The structure survived. The intent did not.&lt;/p&gt;

&lt;p&gt;I have spent the last year building an Arabic-first prompt tool, and these are the failure patterns that kept repeating — plus a template that holds up in practice.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Arabic tokenizes differently, so "keep it short" means something else
&lt;/h2&gt;

&lt;p&gt;Arabic is morphologically dense: one word can carry person, tense, and object. Tokenizers split Arabic more aggressively than English, so a 40-word Arabic prompt can consume noticeably more context than the same prompt in English.&lt;/p&gt;

&lt;p&gt;The practical consequence: &lt;strong&gt;put the instruction first, the context second.&lt;/strong&gt; If the model has to wade through three sentences of background before learning what you want, output quality drops — especially on smaller models.&lt;/p&gt;

&lt;p&gt;Weak:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;أنا عندي شركة صغيرة وشغال في مجال التسويق وعندي عميل محتاج حاجة...&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The request never arrives. Better:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;اكتب ٣ نسخ من رسالة متابعة لعميل. السياق: شركة تسويق صغيرة في القاهرة، العميل لم يرد منذ أسبوعين.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  2. Diglossia: pick the register before you write
&lt;/h2&gt;

&lt;p&gt;Arabic is not one language in daily use. If you do not specify register, models drift toward Modern Standard Arabic — even when you wrote in Egyptian Arabic. Your brand voice disappears, and the result reads like a government memo.&lt;/p&gt;

&lt;p&gt;One explicit line fixes more than any other instruction:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;اكتب بالفصحى المبسطة.&lt;/li&gt;
&lt;li&gt;اكتب بالعامية المصرية، بنبرة مهنية.&lt;/li&gt;
&lt;li&gt;اكتب بالعامية المصرية، وتجنب الكلمات غير المفهومة في الخليج.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That single constraint is worth more than three paragraphs of style description.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. The six slots that actually matter
&lt;/h2&gt;

&lt;p&gt;Whether you call it COSTAR or something else, six things reliably change the result:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Context&lt;/strong&gt; — who you are, where, what already happened.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Objective&lt;/strong&gt; — the verb: write, summarize, compare, rewrite.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Style&lt;/strong&gt; — table, bullets, three paragraphs, JSON.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tone and dialect&lt;/strong&gt; — formal, warm, Egyptian, Gulf-neutral.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Audience&lt;/strong&gt; — a hiring manager, a beginner developer, a customer.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Response contract&lt;/strong&gt; — length, count, format, and what to avoid.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Most weak Arabic prompts contain only #2.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Copy-paste template
&lt;/h2&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[المهمة] اكتب / لخص / حلل ...
[السياق] من أنا، وأين، وما حدث بالفعل
[الجمهور] من سيقرأ الناتج
[الأسلوب] جدول / نقاط / ثلاث فقرات / نص جاهز للإرسال
[النبرة واللهجة] فصحى مبسطة / عامية مصرية مهنية
[المخرجات] العدد، الطول، التنسيق
[القيود] ما يجب تجنبه
~~~

## 5. Before and after

**Job application**

Weak: اكتب لي رسالة تقديم لوظيفة

Better:

&amp;gt; اكتب رسالة تقديم لوظيفة محلل بيانات في شركة اتصالات في القاهرة.
&amp;gt; السياق: عندي ٣ سنوات خبرة في تحليل بيانات العملاء باستخدام SQL وPower BI.
&amp;gt; الجمهور: مدير توظيف غير متخصص تقنيًا.
&amp;gt; الأسلوب: ثلاث فقرات قصيرة، بدون مقدمات طويلة.
&amp;gt; النبرة: مهنية وواثقة، بدون مبالغة.
&amp;gt; المخرجات: نص جاهز للإرسال، أقل من ٢٠٠ كلمة، مع سطر موضوع للإيميل.
&amp;gt; القيود: لا تذكر الراتب، وتجنب العبارات العامة مثل "أنا شخص طموح".

**Product post**

Weak: اكتب بوست عن منتجنا

Better:

&amp;gt; اكتب منشور فيسبوك لمنتج عناية بالبشرة طبيعي.
&amp;gt; السياق: صفحة صغيرة، جمهور مصري، الفئة العمرية ٢٠-٣٥.
&amp;gt; الأسلوب: ثلاث جمل قصيرة وسؤال في النهاية.
&amp;gt; النبرة: عامية مصرية دافئة، بدون مبالغة في الوعود.
&amp;gt; القيود: لا ادعاءات طبية، ولا تستخدم كلمة "علاج".

**Technical explanation**

Weak: اشرح لي الـ API

Better:

&amp;gt; اشرح الفرق بين REST وGraphQL لمطور مبتدئ.
&amp;gt; السياق: يعمل على أول مشروع موبايل له.
&amp;gt; الأسلوب: جدول مقارنة ثم مثالان قصيران.
&amp;gt; النبرة: تعليمية ومباشرة.
&amp;gt; المخرجات: أقل من ٣٠٠ كلمة بالعربية، مع الاحتفاظ بالمصطلحات التقنية بالإنجليزية.

## 6. One more thing: keep prompts on the device

Most prompt tools are cloud forms that store whatever you paste. For work documents, CVs, and client data, that is a real concern — especially for teams handling personal data.

I build **Fahhim (فهّم)**, a free Android app that turns these six slots into a guided form in Arabic and English, with a prompt library that stays on the device. It is not the only way to write a good Arabic prompt — a plain notes app and the template above will get you most of the way.

- App: https://play.google.com/store/apps/details?id=com.prompti.app
- Web version and prompt library: https://fahhim.moteklab.com

If you try the template, I would genuinely like to know which slot made the biggest difference — for me it was the dialect line.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>beginners</category>
      <category>ai</category>
      <category>android</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
