Skip to content

Instantly share code, notes, and snippets.

@arcanite24
arcanite24 / 1-1-euler1.js
Created July 3, 2017 01:20
Post 1 - Solución 1 - Project Euler #1
function sumaMultiplos3y5() {
var suma = 0;
for (var i = 0; i < 1000; i++) {
if (i % 3 == 0 && i % 5 == 0) {
suma += i;
}
}
return suma;
}
@arcanite24
arcanite24 / 1-1-euler1.js
Created July 3, 2017 01:43
Post 1 - Solución 1 - Project Euler #1
function sumaMultiplos3y5() {
var suma = 0;
for (var i = 0; i < 1000; i++) {
if (i % 3 == 0 || i % 5 == 0) {
suma += i;
}
}
return suma;
}
@arcanite24
arcanite24 / gist:fa69b647552fe6f067c888dfc31737a8
Created July 21, 2023 15:11
SDXL Pixel Art ComfyUI Workflow
{
"last_node_id": 47,
"last_link_id": 63,
"nodes": [
{
"id": 7,
"type": "CLIPTextEncode",
"pos": [
317,
352
@arcanite24
arcanite24 / convert_dataset.py
Created November 8, 2023 01:18
Convert Kohya dataset to HF
import json
import os
# Replace 'your_folder_path' with the path to the directory containing your .png and .txt files
folder_path = 'datasets/pixel-art-xl-lite-v1'
output_jsonl_filename = 'datasets/pixel-art-xl-lite-v1/metadata.jsonl'
# List all files in the directory
files = os.listdir(folder_path)
@arcanite24
arcanite24 / conver_to_1111.py
Created November 8, 2023 01:19
Convert Diffusers Safetensors to 1111
import argparse
from pathlib import Path
from diffusers import DiffusionPipeline
import torch
from safetensors.torch import save_file
# First, set up the argument parser
parser = argparse.ArgumentParser(description="Process some integers.")
parser.add_argument("input_file", type=str, help="The input safe-tensors file")
parser.add_argument("output_file", type=str, help="The output safe-tensors file")
@arcanite24
arcanite24 / train_lora.py
Created November 8, 2023 17:20
Train Lora SSD-1b
#!/usr/bin/env python
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#