Skip to content

Instantly share code, notes, and snippets.

View AltoRetrato's full-sized avatar

Ricardo Mendonça Ferreira AltoRetrato

  • São Carlos, SP - Brazil
View GitHub Profile
@AltoRetrato
AltoRetrato / crypt32_test.py
Last active May 24, 2024 13:45
This Python script tests the CryptProtectData() Windows function. It might help test and solve issues that can affect many Windows programs.
# crypt32_test.py
#
# 2024-05-24 - 1st version published as a gist at
# https://gist.github.com/AltoRetrato/05f6957756931b12dc7ff8a87c2fe835
# TL;DR: This script helps you test the CryptProtectData() Windows function
# to possibly find and solve issues that can affect many programs.
# ----------------------------------------------------------------------------
# Is Google Chrome pausing sync each time you (re)start the browser?
@AltoRetrato
AltoRetrato / optimized_txt2img.py
Last active September 13, 2022 18:55
Automatically add IPTC metadata (prompt and more) to JPG images generated by stable-diffusion
# optimized_txt2img.py patched to include IPTC metadata to JPEG images
# Requires iptcinfo3: after "conda activate ldm", install latest version from GitHub with
# pip install git+https://github.com/james-see/iptcinfo3#egg=iptcinfo3
import argparse, os, re, sys
import torch
import numpy as np
from random import randint
from omegaconf import OmegaConf
from PIL import Image
from tqdm import tqdm, trange