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
# Author: Gary A. Stafford | |
# Purpose: Delete all SageMaker Models | |
# Date: 2024-05-08 | |
# License: MIT License | |
# Based on https://gist.github.com/Nxtra/49cde5999de20023e2607433046ca6cf | |
import boto3 | |
client = boto3.client("sagemaker") |
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
# Author: Gary A. Stafford | |
# Purpose: Delete all SageMaker Endpoint Configs | |
# Date: 2024-05-08 | |
# License: MIT License | |
# Based on https://gist.github.com/Nxtra/49cde5999de20023e2607433046ca6cf | |
import boto3 | |
client = boto3.client("sagemaker") |
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
# For use with AUTOMATIC1111 on Ubuntu | |
# current install 2024-06-10: | |
# version: v1.8.0 | |
# python: 3.10.12 | |
# torch: 2.3.0+cu121 | |
# xformers: 0.0.26.post1 | |
# gradio: 3.41.2 | |
# checkpoint: e6bb9ea85b |
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) | |
# 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
subject_prompt = """oue, photo of a oue electric scooter in a brightly colored | |
neon-lite city at night, sleek design, smooth curves, colorful, nighttime, | |
urban environment, futuristic cityscape""" | |
subject_negative_prompt = """person, people, human, rider, floating objects, daytime, | |
sunlight, text, words, writing, letters, phrases, trademark, watermark, icon, logo, | |
banner, signature, username, monochrome, cropped, cut-off, patterned background""" | |
refiner_prompt = """ultra-high-definition, photorealistic, 8k uhd, high-quality, | |
ultra sharp detail""" |
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
subject_prompt = """oue, photo of a oue electric scooter, sleek, smooth curves, colorful, | |
daytime, urban, futuristic cityscape""" | |
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 = """ultra-high-definition, photorealistic, 8k uhd, high-quality, | |
ultra sharp detail""" |
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
!autotrain dreambooth \ | |
--model ${MODEL_NAME} \ | |
--project-name ${PROJECT_NAME} \ | |
--image-path "${IMAGE_PATH}" \ | |
--prompt "${INSTANCE_PROMPT}" \ | |
--class-prompt "${CLASS_PROMPT}" \ | |
--resolution ${RESOLUTION} \ | |
--batch-size ${BATCH_SIZE} \ | |
--num-steps ${NUM_STEPS} \ | |
--gradient-accumulation ${GRADIENT_ACCUMULATION} \ |
NewerOlder