Skip to content

Instantly share code, notes, and snippets.

View enzyme69's full-sized avatar
🎯
Blender and AR~!

Jimmy Gunawan enzyme69

🎯
Blender and AR~!
View GitHub Profile
@adrienbrault
adrienbrault / llama2-mac-gpu.sh
Last active August 15, 2024 07:10
Run Llama-2-13B-chat locally on your M1/M2 Mac with GPU inference. Uses 10GB RAM. UPDATE: see https://twitter.com/simonw/status/1691495807319674880?s=20
# Clone llama.cpp
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
# Build it
make clean
LLAMA_METAL=1 make
# Download model
export MODEL=llama-2-13b-chat.ggmlv3.q4_0.bin
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ynagatomo
ynagatomo / SD2ContentView.swift
Created December 4, 2022 08:56
An iOS app that generates images using Stable-Diffusion-v2 CoreML models.
//
// ContentView.swift
// coremlsd2test
//
// Created by Yasuhito Nagatomo on 2022/12/03.
//
// A sample code using Apple/ml-stable-diffusion library.
// Preparation:
// 1. convert the PyTorch Stable-Diffusion v2 model to coreml models using Apple's tools.
// 2. import the coreml models into the iOS project.
@ProGamerGov
ProGamerGov / replace_vae.py
Last active December 26, 2023 07:15
Replace the VAE in a Stable Diffusion model with a new VAE. Tested on v1.4 & v1.5 SD models
# Script by https://github.com/ProGamerGov
import copy
import torch
# Path to model and VAE files that you want to merge
vae_file_path = "vae-ft-mse-840000-ema-pruned.ckpt"
model_file_path = "v1-5-pruned-emaonly.ckpt"
# Name to use for new model file
@simonbs
simonbs / One More Thing.js
Last active February 17, 2024 11:04
Countdown to Apple's "One More Thing" event on November 10th, 2020
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: deep-purple; icon-glyph: apple-alt;
const TITLE = "One More Thing"
const DATE = "2020-11-10T17:00:00Z"
const IMG_URL = "https://i.ibb.co/f2SN2Wb/bg.png"
let widget = await createWidget()
if (config.runsInWidget) {
Script.setWidget(widget)
@enzyme69
enzyme69 / CapsuleFlower
Created June 17, 2020 00:09
Sverchok.0.6.0.0 (5a04533) | Blender.2.83.0 | CapsuleFlower | 2020.06.17 | 10:08
{
"export_version": "0.079",
"framed_nodes": {},
"groups": {},
"nodes": {
"IcoSphere": {
"bl_idname": "SvIcosphereNode",
"color": [
0.0,
0.5,
@jmpinit
jmpinit / blender_grease_pencil_drawing.py
Created September 22, 2019 21:48
Starting point for using Python to draw with the Grease Pencil in Blender 2.8.
# https://towardsdatascience.com/blender-2-8-grease-pencil-scripting-and-generative-art-cbbfd3967590
import bpy
import math
import numpy as np
def get_grease_pencil(gpencil_obj_name='GPencil') -> bpy.types.GreasePencil:
"""
Return the grease-pencil object with the given name. Initialize one if not already present.
:param gpencil_obj_name: name/key of the grease pencil object in the scene
@p2or
p2or / blender-generate-mix-shader-example.py
Created June 24, 2019 10:37
Example on how to generate gloss diffuse shader via pyhon #Blender #BSE
# for https://blender.stackexchange.com/q/143599/3710
import bpy
mat_name = "Material_Name"
# check whether the material already exists
if bpy.data.materials.get(mat_name):
mat = bpy.data.materials[mat_name]
else:
@batFINGER
batFINGER / uv_mercator_project.py
Created September 6, 2017 21:57
Mercator UV Projection
bl_info = {
"name": "Mercator Project",
"author": "batFINGER",
"version": (1, 0),
"blender": (2, 79, 0),
"location": "View3D > Mesh > UV UnWrap > Mercator Project",
"description": "UV Mercator Projection",
"warning": "",
"wiki_url": "",
"category": "UV",
@kravik
kravik / detect-face-landmarks.swift
Last active July 18, 2018 22:19
iOS 11 Vision. Face detection
import Vision
//1
let sourceImage = UIImage(named: "jony.jpg")
var resultImage = sourceImage
//2
let detectFaceRequest = VNDetectFaceLandmarksRequest { (request, error) in
//4
if let results = request.results as? [VNFaceObservation] {
//5
for faceObservation in results {