This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For use with AUTOMATIC1111 on Ubuntu | |
# current install: | |
# version: v1.8.0 | |
# python: 3.10.12 | |
# torch: 2.1.2+cu121 | |
# xformers: 0.0.25.post1+cu118 | |
# gradio: 3.41.2 | |
# checkpoint: 6ce0161689 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install ComfyUI on Ubuntu | |
apt install python3-pip | |
sudo apt install python3-pip | |
git clone https://github.com/comfyanonymous/ComfyUI.git | |
cd ComfyUI/ | |
pip install -r requirements.txt | |
pip install torchvision # error message in terminal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Simple HTTP server that returns random HTTP status code, written in Go. | |
// Author: Gary A. Stafford <garystafford@rochester.rr.com> | |
// Created: 11/04/2016 | |
package main | |
import ( | |
"io" | |
"math/rand" | |
"net/http" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
print(torch.__version__) # e.g., 2.0.0 (at the time of the post) | |
print(torch.cuda.get_device_name(0)) # e.g., NVIDIA A10G |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipeline = DiffusionPipeline.from_pretrained( | |
model_name_base, | |
torch_dtype=torch.float16, | |
).to(device) | |
pipeline.load_lora_weights( | |
project_name, | |
weight_name="pytorch_lora_weights.safetensors" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipeline = DiffusionPipeline.from_pretrained( | |
model_name_base, | |
torch_dtype=torch.float16, | |
).to(device) | |
# new LoRA weights from fine-tuning process | |
pipeline.load_lora_weights( | |
project_name, | |
weight_name="pytorch_lora_weights.safetensors" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from diffusers import DiffusionPipeline, StableDiffusionXLImg2ImgPipeline | |
device = "cuda" # cpu or cuda | |
pipeline = DiffusionPipeline.from_pretrained( | |
model_name_base, | |
torch_dtype=torch.float16, | |
).to(device) | |
refiner = StableDiffusionXLImg2ImgPipeline.from_pretrained( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%%sh | |
export PIP_ROOT_USER_ACTION=ignore | |
pip install -Uq pip # optional | |
pip install -Uq autotrain-advanced | |
pip install -q ipywidgets==7.8.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
# project configuration | |
project_name = "mb_amg_gt_oue_dreambooth" | |
model_name_base = "stabilityai/stable-diffusion-xl-base-1.0" | |
model_name_refiner = "stabilityai/stable-diffusion-xl-refiner-1.0" | |
# fine-tuning prompts | |
# 'oue' is a rare tokens, 'car' is a class | |
instance_prompt = "photo of oue car" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# optional descriptive terms: sleek, futuristic, metallic, colorful, urban | |
subject_prompt = """oue, marker rendering of oue electric scooter, concept art, | |
futuristic cityscape, solid color background, bright vibrant colors, marker, sketch, | |
illustration, illustrative, marker drawing, expressive strokes, graphic""" | |
subject_negative_prompt = """person, people, human, rider, floating objects, text, | |
words, writing, letters, phrases, trademark, watermark, icon, logo, banner, signature, | |
username, monochrome, cropped, cut-off, patterned background""" | |
refiner_prompt = """sharp, crisp, in-focus, uncropped, high-quality""" |
NewerOlder