<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Jujaar Singh on Medium]]></title>
        <description><![CDATA[Stories by Jujaar Singh on Medium]]></description>
        <link>https://medium.com/@jujaarsingh?source=rss-c39d42a68841------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*KG_w8_5x1TfBSRpnpZlmxg.png</url>
            <title>Stories by Jujaar Singh on Medium</title>
            <link>https://medium.com/@jujaarsingh?source=rss-c39d42a68841------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 04:58:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jujaarsingh/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Exploring Generative AI for Animation]]></title>
            <link>https://medium.com/@jujaarsingh/exploring-generative-ai-for-animation-7e3691f68654?source=rss-c39d42a68841------2</link>
            <guid isPermaLink="false">https://medium.com/p/7e3691f68654</guid>
            <category><![CDATA[ai-animation]]></category>
            <category><![CDATA[ai-video]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Jujaar Singh]]></dc:creator>
            <pubDate>Wed, 30 Aug 2023 18:15:31 GMT</pubDate>
            <atom:updated>2023-08-30T18:15:31.660Z</atom:updated>
            <content:encoded><![CDATA[<iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FslsVI5Iyqlg&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DslsVI5Iyqlg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/72b0d735f53d094ccb5b310db2e4891a/href">https://medium.com/media/72b0d735f53d094ccb5b310db2e4891a/href</a></iframe><p>Three months ago, I began a deep dive into the world of AI generated video. AI image generators had taken the internet by storm and were starting to get used as an assistive tool by graphic designers, artists, and so on. It seemed like the next logical advancement would be generative AI for video. Unfortunately, after spending a considerable amount of time learning how both image and video based AI models currently work, it became clear that it would be much more difficult to get generative AI for video to go from being a niche visual effect to a mainstream tool. For instance, most of the videos that were being created with generative AI had extreme discontinuity between frames, with constant flickering and non-coherent shapeshifting. Solving these issues would require some additional tools or techniques that extended the out-of-the-box AI models that were available, and there did not seem to be any clear roadmap on how to do that.</p><p>Enter Corridor Crew, a production company in LA. Their remarkable anime short, <a href="https://www.youtube.com/watch?v=GVT3WUa-48Y"><em>Rock, Paper, Scissors</em></a>, broke new ground for AI video generation, and solved many of the discontinuity issues along the way. After seeing their work, I embarked on a mission to see if I could replicate their process, and perhaps even take it further. To put my own personal spin on it, I wanted to attempt to produce an AI anime with a Sikh character, one who has the distinctive Sikh turban and beard. These were features that, in my early experience, image generation models struggled with. Additionally, I decided to attempt this experiment with an anime style that was different from the one used by Corridor Crew — I ended up choosing <em>Vinland Saga</em>.</p><p><strong><em>An AI image generation primer</em></strong></p><p>There are a number of image generators available today, DALL-E, Midjourney, and Stable Diffusion among them. Stable Diffusion is the most popular for experimental work since it is open source and it is possible to create personal models with it. <em>Text to image </em>generators, a basic form of AI image generation, allow you to write a prompt such as “<em>Portrait of a warrior in uniform, with strong, directional lighting</em>”, and the model generates a random image based on that text. Learning how to craft good prompts to obtain satisfactory images has become a new art form.</p><p>For video generation, where we need more precise control over characters, motion, and scenes, a better starting point is <em>image to image</em> generation. Here, you supply both an image and a text description of what you want, and the model creates a new image using a combination of the two. To create videos, the idea is to repeat this image to image generation process for every frame, using a source video and a personalized Stable Diffusion model that is trained to generate your target character with the art style of your choosing.</p><p><em>If you want to try building your own models, you need a computer with a suitably powerful GPU. The experiments I discuss here were done using an RTX 4090.</em></p><p><strong><em>The Process</em></strong></p><p>I began by following the same process as Corridor Crew, using another open source tool called Dreambooth to fine-tune (i.e., <em>personalize</em>) a general Stable Diffusion model. Model fine-tuning involves taking a pre-trained general model and further training it with images you select in order to steer it towards consistently producing the character and style that you want in your video. Some of the training data that I used in my experimental video can be seen below. It consists of images of my brother in front of a green screen, along with selected images from Vinland Saga that show the model what that art style looks like.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/0*fHm3VteiCVPPrBuz" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/986/0*c-p9DI6LOBvQw2cN" /><figcaption>A snippet of datasets used to personalize the Stable Diffusion model</figcaption></figure><p>Vinland Saga was especially useful as an art style because, unlike many anime, the characters have the facial hair that I wanted in the character I was generating. As for the results of this personalized model, you can see the first attempts below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cLPjS4pJZZGJxZUk" /><figcaption>The results of the first model</figcaption></figure><p>The produced images are shaky; you can see that the generated character does not always resemble the source image, and the quality of the art is poor. It turned out that I had under-esimated the amount of data necessary for the training process, so I went back and doubled the number of images for each dataset. Additionally, to reinforce the look that I wanted for the Sikh subject, I added some of these somewhat shaky images that this first model had generated to my training dataset and retrained the model. This further baked the particular Sikh look I was after into the training of the art style. After this second round of training, this new model was now producing much better and more consistent images as seen below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KoZtJ_gVPNtqBIyh" /><figcaption>The 2nd model produced much more consistent and higher quality images that resemble the subject</figcaption></figure><p>The images of the second model were substantially better. With reasonable quality now achieved, it was time to retrain the model once again, with the addition of this latest batch of images. Training the model with these higher quality images instead of the earlier shaky ones refined it even further, so that it was now consistently producing a similar look and quality each time.</p><p>Once this 3rd model was trained, it was time to start using the <em>image to image</em> generation tool to try to produce a video. In this case, I took a real photo of my brother in front of a green screen, and generated an image with the trained model. For video, the idea is to reproduce this image to image generation on every frame of the source video.</p><p>To produce a coherent video, it is important to keep the general properties of the original image frame (in this case the shape of the body and position) while converting it into the target style. Initially, my results were deformed and looked nothing like the anime I had trained the model on. After some trial and error, it turned out that increasing the pixel resolution of the output images produced better results. I found that the sweet spot was a resolution of 1280x1280 pixels to produce the desired image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NIqkAYN89wz9LhPw" /><figcaption>Original image, the generated image, and the generated image with the greenscreen removed and background manually added</figcaption></figure><p>At this point, I was finally ready to attempt to create a video, as the single frame images seemed to be suitable in quality and accuracy. It’s worth noting that the subject is shot in front of a green screen so that the model does not have to deal with backgrounds — it’s just one less variable to deal with. Generating a separate background using the same image to image generation tools is relatively easy, especially for the kind of static backgrounds that are typically used in anime. Replacing the green screen with that background is also an easy task with conventional video editing software.</p><p>By cutting a video into its individual frames, we can put each frame through the personalized Stable Diffusion model and reassemble these output images to create the “animated” video. After putting my frames through the model, I produced my first AI generated video.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*te2X1E6_L35aNKg9" /><figcaption>1st animation attempt</figcaption></figure><p>The result is a coherent looking video where the subject is mostly in the proper position in every frame! While the results were exciting, the level of flickering was a bit too distracting to use for an actual film. But it was a decent start. The most promising aspect of this video was that the face of the subject and the turban stayed somewhat consistent.</p><p>I thought it would be worthwhile to experiment with other techniques to reduce the flicker. The one that I had seen commonly being used online was the <em>TemporalKit</em> tool, an open source extension that is available for Stable Diffusion. It was advertised as being able to reduce flickering, but the process also created an undesirable CGI/real life look and had some other distortions also. The results of this test can be seen below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*3zXbyxWDIte9_zQv" /><figcaption>TemporalKit tests with various ControlNet settings</figcaption></figure><p>What was most interesting about TemporalKit was an intermediate step that it used called <em>ControlNet</em>, another family of AI models that can be used within Stable Diffusion. Essentially, ControlNet creates a separate intermediate image that represents certain features from the source image. These features are then used during image generation to influence the output image. I used an intermediate representation model called <em>canny edge detection </em>that creates an edge map of the original image. This is basically a black and white image outlining the subject in the original image. Using the ControlNet canny extension, the Stable Diffusion model then operates within these lines to generate its image. An example is shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VCnykIV2CIFZKfLi" /><figcaption>Image to image generation with the ControlNet (canny) intermediate step</figcaption></figure><p>I realized that I could avoid some of the unattractive qualities of TemporalKit by just using ControlNet alongside my simpler original method. The ControlNet process was a good way to reduce unintended randomness between the frames of the video, and it also gave me a higher quality image. After redoing the original Corridor Crew process with ControlNet, the subject really looked like my brother in anime form.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*3Or12powjRFB5E9M" /><figcaption>Animation with ControlNet</figcaption></figure><p>The major flickering that existed now was in the form of shadows on the body itself. This flickering can be further reduced by applying a de-flickering tool in a video editing application called DaVinci Resolve (as also described by Corridor Crew). The flickering doesn’t go away completely, but it’s better.</p><p>Once these new animated videos are generated, the process of creating a background for these is very simple. I wanted my subject to be in a forest, so I searched on Google images for about 5 minutes and found an ideal image of a forest with a clearing. I then put this background image through Stable Diffusion, prompting it to convert it to the anime style, and just like that the background was created. Placing the character over the background image requires some knowledge of how camera perspectives should look and whether the background needs to be moving (zooming/panning) with the subject. After editing the generated clips, adding some background music, sound effects, and a nice title, the trailer to “SOORMA” was done.</p><p>The final video is not flawless — there is still a decent amount of flicker — but overall I was excited with the results. Getting to this point took a very long time (~3 months). Most of that time was spent in discovering or understanding the necessary process and the tools that were needed for AI video generation, as well as in experimentation. Once the process was established, it was insanely easy to shoot the video and turn it into an animated one. Just for fun, I added another clip to the video recently. It only took an hour out my time. After filming my sequence on a green screen, I let the model run over night and added the generated output clip to the trailer in the morning.</p><p><strong><em>Looking Ahead</em></strong></p><p>So where do we stand now? Anyone with the necessary computing power can shoot videos with their phone camera and replicate this process. It simply requires a little bit of creativity and a good deal of problem solving. From there, the focus is entirely on telling a good story.</p><p>Looking ahead, the next major technical breakthrough will be to solve the remaining flickering. There are some solutions being proposed already. In Corridor Crew’s newest video, they switched to using an application called Stable WarpFusion. Although Stable WarpFusion does reduce flickering, it also creates somewhat unappealing character movements, in my opinion. An additional model that is able to analyze previous frames and correct for inconsistency could be useful within the Stable Diffusion process — there is already some published research on this and I’m looking forward to trying that out also. Regardless of how flickering is solved, whoever makes this breakthrough will usher in a new era of AI animation using video to video generation. Eventually this will make its way to real (not animated) video as well.</p><p>These tools, and probably this post, will inevitably provoke a negative reaction from the anti-AI crowd, especially those concerned that this process uses other artists’ work to train models. The experimental video I made here obviously wasn’t possible without the prior work of the talented artists that created Vinland Saga. However, in the future, for commercial productions, it will become common (and necessary) to hire artists to create original style datasets to train models for new video productions.</p><p>I don’t believe there is much that can be done to stop the forward march of these innovative new AI tools. The consequence is that soon many more people will start using these powerful tools. The ones that are able to tell a compelling story will stand out. It is also likely that with the increased ease and reduced cost of producing high quality animations, niche stories aimed at smaller audiences (such as those with Sikh characters) will become more common. For me, that will be a more interesting and creative world.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e3691f68654" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Khalsa’s Omens & Bitcoin Inscriptions]]></title>
            <link>https://medium.com/@jujaarsingh/khalsas-omens-bitcoin-inscriptions-ee53da252ee4?source=rss-c39d42a68841------2</link>
            <guid isPermaLink="false">https://medium.com/p/ee53da252ee4</guid>
            <category><![CDATA[sikhi]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[inscription]]></category>
            <category><![CDATA[sikh]]></category>
            <dc:creator><![CDATA[Jujaar Singh]]></dc:creator>
            <pubDate>Sun, 12 Feb 2023 10:48:19 GMT</pubDate>
            <atom:updated>2023-09-19T21:44:06.811Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8gxdxJytPILu3MkN54zbuw.png" /></figure><p><em>91024738b743b8812c5c7a72ff359abd8455adc7b9ddd0724e462a87c2cade94i0</em></p><p><a href="https://ordinals.com/inscription/91024738b743b8812c5c7a72ff359abd8455adc7b9ddd0724e462a87c2cade94i0"><em>https://ordinals.com/inscription/91024738b743b8812c5c7a72ff359abd8455adc7b9ddd0724e462a87c2cade94i0</em></a></p><p>In block height <a href="https://ordinals.com/block/775854"><em>775854</em></a>, this prayer, call, and omen of the Khalsa’s victory, ascribed to Guru Gobind Singh (<em>Sarbloh Granth</em>), will forever live on as a part of bitcoin’s blockchain. <em>See the link above or use the inscription id</em></p><p><strong>ਨੳ ਲਖ ਐਰਾਟੀ ਮਿਲੈ, ਮਿਲੈ ਸਰਾਯਚੈ ਲਾਖ ॥ ਸ੍ਵਾ ਲਾਖ ਹਾਥੀ ਮਿਲੈ, ਦੇਹੁ ਯਹੈ ਅਭਿਲਾਖ ॥</strong></p><p>May we receive 900,000 Airati [war] horses, and 100,000 war drums. This prayer from your devotee is to receive 125,000 war elephants.</p><p><strong>ਖਾਸ ਸ੍ਵਾਰੀ ਮੁਹਿ ਚਲੈ, ਨੇਜਹ ਲਖ ਨਿਸਾਨ ॥ ਵਾਹਿਗੁਰੂ ਕਾ ਖਾਲਸਾ, ਜੀਤਹਿ ਸਤ੍ਰ ਚੌਗਾਨ ॥</strong></p><p>May You ride ahead with us, amongst our spears and standards. The Khalsa is Vahiguru’s, [it shall] defeat all the enemies to the sound of their war drums.</p><p><strong>ਯਹਿ ਲਾਲਚ ਗੁਣ ਤ੍ਵ ਕਹਯੋ ਦਾਸ ਗੋਬਿੰਦ ਸਮਾਜ ॥ ਫਤਿਹ ਹੋਵੈ ਸਤਿਗੁਰੂ ਕੀ, ਉਦਯ ਅਸਤ ਲੌ ਰਾਜ ॥</strong></p><p>Says Gobind, reciting your virtues, this is my desire for my brotherhood. The victory is the True Guru’s, [who’s] Kingdom extends from the sun rise to sun set.</p><p><em>(Translation taken from </em><a href="https://www.manglacharan.com/post/may-you-ride-ahead-with-us-guru-gobind-singh"><em>Jvala Singh</em></a><em>)</em></p><p>A few weeks ago, I started following the development of Inscriptions on bitcoin introduced by Casey Rodarmor. This new discovery allows for satoshis (the units that comprise a bitcoin) to be transformed into non-financial data and sent / stored on the bitcoin network in a fairly efficient manner. A broader explanation or comparison is the equivalent of gold jewelry. For thousands of years, people have taken gold, which holds value as money, and have transformed it into artwork or jewelry. In this case, one is able to take bitcoin units and construct it into digital art, text, or whatever else one can think of.</p><p>As someone who is inspired by Guru Gobind Singh’s writing and poetry, the first idea that came to mind was to inscribe something onto bitcoin’s blockchain as text, and the lines above are what I chose.</p><p>There is a reason why I find this fascinating and more than a neat trick. If I, as an unknown individual, were to write or copy something down and ensure that it lives on as long as possible (and outlive me) without it ever being destroyed or lost, I would store it on bitcoin’s blockchain in this way. Every bitcoin node keeps a full history of all bitcoin transactions that have ever occurred, including these inscriptions now. Each bitcoin node starts by verifying and downloading the first block from 2009 and keeps downloading all the way to the latest block. There are thousands of nodes around the globe. Essentially, this inscription of Guru Gobind Singh’s writing lives simultaneously on all of the nodes that keep the full history. I also run a full node myself and consider this use case of inscriptions to serve as an immutable time capsule.</p><p>Choosing to place this specific writing as a time capsule on bitcoin’s blockchain is especially cool to me. One, as alluded to in this three century old writing, I hope that the Khalsa tastes victory and establishes a Raj once again. Additionally, I have a sliver of hope that this prayer and omen will be randomly discovered many, many years from now by people searching through bitcoin’s early block history and early cases of inscriptions.</p><p><a href="https://ordinals.com/inscription/91024738b743b8812c5c7a72ff359abd8455adc7b9ddd0724e462a87c2cade94i0">You can click here to view it on the blockchain</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ee53da252ee4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>