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 dependencies | |
# | |
# python -m venv venv | |
# source ./venv/bin/activate # linux | |
# call ./venv/scripts/Activate.bat # windows? | |
# | |
# pip install transformers peft datasets | |
# | |
# Use the PyTorch instructions for your machine: | |
# [Get started — PyTorch](https://pytorch.org/get-started/locally/) |
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 argparse | |
import torch | |
from safetensors.torch import load_file, safe_open | |
from library import model_util | |
def load_state_dict(file_name, dtype): | |
if model_util.is_safetensors(file_name): |
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
# Copyright © 2023 Dave Lage | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
# | |
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
# | |
# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE U |
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 | |
from datasets import Dataset, Image, load_dataset | |
from torchmetrics.image.fid import FrechetInceptionDistance | |
from diffusers import StableDiffusionPipeline, DPMSolverMultistepScheduler | |
from torchvision import transforms | |
import random | |
from matplotlib import pyplot as plt | |
import argparse | |
from pathlib import Path | |
import numpy |
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 torchmetrics.functional.multimodal import clip_score | |
from functools import partial | |
import torch | |
from datasets import load_dataset | |
from diffusers import StableDiffusionPipeline, DPMSolverMultistepScheduler | |
import random | |
from pathlib import Path | |
import argparse | |
import numpy |
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
# Original from https://gist.github.com/Poiuytrezay1/db6b98672675456bed39d45077d44179 | |
# Credit to Poiuytrezay1 | |
import argparse | |
import os | |
from collections import defaultdict | |
from pathlib import Path | |
import numpy as np | |
import torch |
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
# Original from https://gist.github.com/Poiuytrezay1/db6b98672675456bed39d45077d44179 | |
# Credit to Poiuytrezay1 | |
import argparse | |
import os | |
from collections import defaultdict | |
from pathlib import Path | |
import numpy as np | |
import torch |
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 argparse | |
import os | |
from collections import defaultdict | |
from pathlib import Path | |
import numpy as np | |
import torch | |
import tqdm | |
from PIL import Image | |
from torchvision import transforms |
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
5 Digital Painting | |
2 Fantasy Lands | |
3 Anime Art Style | |
4 Surreal Style | |
6 Scenic | |
9 Realistic | |
20 Modern Computer Animation | |
10 SciFi | |
11 Dreamlike | |
15 Interior Views |
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
cloudcore | |
ulzzang | |
70's disco | |
2-tone | |
1950's suburbia | |
2000's autmn | |
2014 girly tumblr | |
2k animecore | |
Abstract Tech | |
Acid Pixie |
NewerOlder