Skip to content

Instantly share code, notes, and snippets.

@fofr
fofr / logs.txt
Created March 4, 2024 12:39
import times
Import times for custom nodes:
0.0 seconds: /src/ComfyUI/custom_nodes/ComfyUI-Logic
0.0 seconds: /src/ComfyUI/custom_nodes/ComfyUI-BRIA_AI-RMBG
0.0 seconds: /src/ComfyUI/custom_nodes/ComfyUI_essentials
0.0 seconds: /src/ComfyUI/custom_nodes/masquerade-nodes-comfyui
0.0 seconds: /src/ComfyUI/custom_nodes/ComfyUI_IPAdapter_plus
0.0 seconds: /src/ComfyUI/custom_nodes/ComfyUI-Custom-Scripts
0.0 seconds: /src/ComfyUI/custom_nodes/Derfuu_ComfyUI_ModdedNodes
0.0 seconds: /src/ComfyUI/custom_nodes/ComfyUI_UltimateSDUpscale
0.0 seconds: /src/ComfyUI/custom_nodes/ComfyUI-PhotoMaker
@fofr
fofr / dalle3.py
Created November 6, 2023 22:57
dalle3 style and quality
from openai import OpenAI
import os
from datetime import datetime
import requests
client = OpenAI()
prompt = "a portrait photo of a woman"
qualities = ["standard", "hd"]
styles = ["natural", "vivid"]
import Replicate from 'replicate'
import * as dotenv from 'dotenv'
dotenv.config()
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
})
async function main() {
const training = await replicate.trainings.create(
@fofr
fofr / select-grid.js
Created May 26, 2023 22:15
Photoshop grid selection
// Get a reference to the active document.
var doc = app.activeDocument;
// Set the height of the selection to the height of the document.
var height = doc.height;
// Set the x and y offset in pixels.
var xOffset = 5;
var yOffset = 5;
@fofr
fofr / lambda-labs-cog.txt
Created May 5, 2023 13:47
lambda-labs-cog.txt
sudo curl -o /usr/bin/cog -L "https://github.com/replicate/cog/releases/latest/download/cog_$(uname -s)_$(uname -m)"
sudo chmod +x /usr/bin/cog
sudo usermod -aG docker $USER
export OPENAI_API_KEY=
pip install autocog
autocog
@fofr
fofr / audio-to-video.sh
Created April 27, 2023 18:19
Create video from text and audio
#!/bin/bash
# Check if the argument is provided
if [ -z "$1" ]; then
echo "Usage: $0 <filename_without_extension>"
exit 1
fi
# Define input files and output file
filename="$1"
@fofr
fofr / prompts.txt
Created April 24, 2023 23:05
Bark – Pass in prompts, save generated audio with prompt text file
Hello you!
---
MAN: Hello
WOMAN: Hi
---
...
@fofr
fofr / split_mjv5_png.sh
Created March 22, 2023 22:16
A bash script to split a Midjourney v5 grid of images using ImageMagick
#!/bin/bash
# Check if 'convert' is available
if ! command -v convert &> /dev/null; then
echo "'convert' command not found. Please install ImageMagick and try again."
exit 1
fi
input_file="$1"
@fofr
fofr / heroku_copy_config.sh
Created April 4, 2018 13:25
Copy Heroku config variables
#!/bin/bash
# Source: http://blog.nonuby.com/blog/2012/07/05/copying-env-vars-from-one-heroku-app-to-another/
set -e
sourceApp="$1"
targetApp="$2"
while read key value; do
@fofr
fofr / random.rb
Created January 19, 2018 15:52
Random example before this week
# document_type can be set, otherwise it defaults to the same value as schema_type
def setup_and_visit_random_content_item(document_type: schema_type)
schema = GovukSchemas::Schema.find(frontend_schema: schema_type)
# The schema and random example is generated from schema_type
random_example = GovukSchemas::RandomExample.new(schema: schema)
# But the correct document type gets merged in
payload = random_example.merge_and_validate(document_type: document_type)
path = payload["base_path"]