Skip to content

Instantly share code, notes, and snippets.

View thedarkzeno's full-sized avatar

Adalberto thedarkzeno

View GitHub Profile
@madebyollin
madebyollin / Mamba_Diffusion_IADB_Colab.ipynb
Created December 6, 2023 04:47
Mamba Diffusion (IADB)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@trygvebw
trygvebw / find_noise.py
Last active March 31, 2025 01:40
A "reverse" version of the k_euler sampler for Stable Diffusion, which finds the noise that will reconstruct the supplied image
import torch
import numpy as np
import k_diffusion as K
from PIL import Image
from torch import autocast
from einops import rearrange, repeat
def pil_img_to_torch(pil_img, half=False):
image = np.array(pil_img).astype(np.float32) / 255.0
@yagoernandes
yagoernandes / README-TEMPLATE.md
Last active January 13, 2021 19:30 — forked from reginadiana/README-TEMPLATE.md
Template sugestivo para documentação de projetos

Titulo ou Arte do Projeto

@alexbruno
alexbruno / valid.cnpj.ts
Last active December 27, 2024 03:26
Validação de CNPJ
// Regex para validação de string no formato CNPJ
export const regexCNPJ = /^\d{2}.\d{3}.\d{3}\/\d{4}-\d{2}$/
// Método de validação
// Referência: https://pt.wikipedia.org/wiki/Cadastro_Nacional_da_Pessoa_Jur%C3%ADdica
export function validCNPJ(value: string | number | number[] = '') {
if (!value) return false
// Aceita receber o valor como string, número ou array com todos os dígitos
const isString = typeof value === 'string'