Skip to content

Instantly share code, notes, and snippets.

View hathibelagal-dev's full-sized avatar
🎯
Focusing

Ashraff Hathibelagal hathibelagal-dev

🎯
Focusing
View GitHub Profile
@hathibelagal-dev
hathibelagal-dev / DiffusersTest.mr
Last active April 3, 2026 04:37
Testing diffusers with makrell-py
{import torch}
{import diffusers@[StableDiffusionPipeline]}
# segmind/tiny-sd is a very small distilled model (~600MB)
model_id = "segmind/tiny-sd"
{print "Loading Tiny-SD pipeline..."}
pipe = {StableDiffusionPipeline.from_pretrained
model_id
@hathibelagal-dev
hathibelagal-dev / comfyui_headless.py
Created September 23, 2025 05:07
A minimal script to get started with using ComfyUI as a library
import sys, os
comfy_path = "/content/ComfyUI"
sys.path.insert(0, comfy_path)
import importlib.util
utils_path = os.path.join(comfy_path, "utils")
spec = importlib.util.spec_from_file_location("utils", os.path.join(utils_path, "__init__.py") if os.path.exists(os.path.join(utils_path, "__init__.py")) else os.devnull)
utils = importlib.util.module_from_spec(spec)
@hathibelagal-dev
hathibelagal-dev / shaker.sh
Created December 30, 2025 04:01
Camera shake using FFMPEG
ffmpeg -i input.mp4 -vf "
crop=iw-24:ih-24:
12+12*(random(1)-0.5):
12+12*(random(2)-0.5),
scale=iw:ih" output.mp4
@hathibelagal-dev
hathibelagal-dev / timedtext_parser.py
Last active December 12, 2025 01:15
Parses timedtext files
import json
import sys
if len(sys.argv) != 2:
print("ERROR: Provide input file")
try:
with open(sys.argv[1]) as f:
data = f.read()
except:
@hathibelagal-dev
hathibelagal-dev / 8queens_gibbs.py
Last active November 10, 2025 16:22
This code solves the eight queens puzzle using Gibbs sampling
import random
import math
from typing import List, Optional
def total_conflicts(state: List[int]) -> int:
"""Count total number of attacking pairs (each pair counted once)."""
n = len(state)
conflicts = 0
for i in range(n):
for j in range(i + 1, n):
@hathibelagal-dev
hathibelagal-dev / nqueens_thrml.py
Created November 10, 2025 16:19
Using Extropic's THRML to solve the n-queens puzzle
import jax
import jax.numpy as jnp
import random
import sys
import numpy as np
from thrml.block_management import Block
from thrml.block_sampling import BlockGibbsSpec, sample_states, SamplingSchedule
from thrml.pgm import CategoricalNode
from thrml.factor import AbstractFactor, FactorSamplingProgram
from thrml.interaction import InteractionGroup
@hathibelagal-dev
hathibelagal-dev / deepseekocr.ipynb
Last active October 27, 2025 09:44
deepseekocr.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hathibelagal-dev
hathibelagal-dev / lipsync.ipynb
Last active September 9, 2025 14:30
LipsyncUpdated.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hathibelagal-dev
hathibelagal-dev / chatterbox.ipynb
Last active May 29, 2025 11:43
ChatterBox.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.