Skip to content

Instantly share code, notes, and snippets.

@RageshAntonyHM
RageshAntonyHM / mutli-gen.py
Last active December 23, 2024 18:44
Multi-Model implementation of ImageGen via single prompt using Multi GPUs
import torch
from diffusers import SanaPipeline,StableDiffusion3Pipeline, FluxPipeline,Transformer2DModel, PixArtSigmaPipeline, AuraFlowPipeline, Kandinsky3Pipeline, LuminaText2ImgPipeline, HunyuanDiTPipeline, LuminaText2ImgPipeline
from app.sana_pipeline import SanaPipeline
from torchvision.utils import save_image
from models import SwittiPipeline
from onediffusion.diffusion.pipelines.onediffusion import OneDiffusionPipeline
# FLUX, SD, Aura, Hunay, Sana, Pix Sigma,
master_prompt = "A serene and emotive scene depicting a college girl weeping under a large, lush tree, with her loyal dog sitting close by, offering comfort. In the background, a small camp is situated , illuminated by the gentle glow of a campfire around which several people are gathered, sitting on benches and engaging in quiet conversation. The setting is in a forest clearing, during twilight, with the sky painted in soft shades of pink and blue, creating a tranquil yet poignant atmosphere,"
@angel1254mc
angel1254mc / main.py
Created March 8, 2024 04:47
Transcribe Video and Generate Captions with Whisper-Timestamped + MoviePy 😎
from moviepy.editor import VideoFileClip, TextClip, CompositeVideoClip
import whisper_timestamped as whisper
filename = "example.mp4"
screen_width = 1080
screen_height = 1920
def get_transcribed_text(filename):
audio = whisper.load_audio(filename)
@lMortimerl
lMortimerl / main.py
Created February 27, 2024 11:27
Python Image to Text
# Dependencies: pip install opencv-python-headless pytesseract numpy
import cv2
import pytesseract
import matplotlib.pyplot as plt
# Path to Tesseract executable (change this according to your installation)
pytesseract.pytesseract.tesseract_cmd = r'C:\Program Files (x86)\Tesseract-OCR\tesseract.exe'
def capture_and_parse_text():
@denji
denji / nvenc-install.sh
Last active December 3, 2024 14:36 — forked from lucaspar/nvenc-install.sh
Installation script of CUDA-accelerated `ffmpeg` with NVIDIA Encoder ( docker NVIDIA Encoder https://github.com/markus-perl/ffmpeg-build-script )
#!/bin/bash
# =========================================================================
# Source: https://gist.github.com/lucaspar/27f5e108b80524b315be10b2a9049817
# =========================================================================
# This script will compile and install a static FFmpeg build with
# support for NVENC in Ubuntu. Developed in Ubuntu 23.10,
# with NVIDIA Drivers v535.129.03 and CUDA v12.2 with a GPU
# with CUDA capability 8.6 (RTX 3080) (see ccap below).
# It assumes NVIDA drivers are installed and that you have a
# CUDA-compatible GPU. You can check installed drivers with:
@TameemS
TameemS / debloatLDPlayer.md
Last active April 25, 2025 17:12
Debloating LDPlayer

Inspired by this

More of my guides: Debloating MEMu - Debloating Nox (Updated)

This mainly applies to LDPlayer9. They will probably work on the low end options (like LDPlayer5) but not guaranteed.

Debloating LDPlayer

This emulator seems to have less stability issues than MEMu. I think we get the shtick that these emulators do spooky stuff.

  1. Download LDPlayer, preferably an offline version from the version history
@MrAch26
MrAch26 / captcha_solver.py
Created December 4, 2022 08:36
Captcha Solver with python
from PIL import Image
from scipy.ndimage import gaussian_filter
import numpy
import pytesseract
from PIL import ImageFilter
def solve_captcha(filename):
# thresold1 on the first stage
th1 = 140
th2 = 140 # threshold after blurring
@Axel-Erfurt
Axel-Erfurt / PyQt6_PDFViewer.py
Created March 26, 2022 20:33
Show PDF with PyQt6 QWebengineView
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from PyQt6.QtCore import QUrl
from PyQt6.QtWidgets import QApplication, QMainWindow, QWidget
from PyQt6.QtWebEngineWidgets import QWebEngineView #, QWebEngineSettings
from os import path
class MainWindow(QMainWindow):
def __init__(self):
@ahbanavi
ahbanavi / encryption.php
Last active May 1, 2024 23:18
Encrypt / Decrypt JSON data between Python and PHP using AES 256 GCM
<?php
const PASSPHRASE = ''; // use 'openssl rand -hex 32' to generate key, same with python
function encrypt(array $data): string
{
$data_json_64 = base64_encode(json_encode($data));
$secret_key = hex2bin(PASSPHRASE);
$iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length('aes-256-gcm'));
$tag = '';
$encrypted_64 = openssl_encrypt($data_json_64, 'aes-256-gcm', $secret_key, 0, $iv, $tag);
@pvanfas
pvanfas / Awesome Python.md
Last active April 15, 2025 12:14
A curated list of awesome Python frameworks, libraries, software and resources.