Skip to content

Instantly share code, notes, and snippets.

@Pyr-000
Pyr-000 / $README.md
Last active October 1, 2024 16:12
Convert original Stable Diffusion checkpoints and safetensors to diffusers

Stable Diffusion model conversion script

Convert from the 'original implementation' to Huggingface diffusers. Both .safetensors and .ckpt checkpoints are supported.

The script is adapted from the diffusers conversion script: https://github.com/huggingface/diffusers/blob/main/scripts/convert_original_stable_diffusion_to_diffusers.py

Usage:

python enhanced_convert_original_stable_diffusion_to_diffusers.py --checkpoint_path "<input_model_filepath>" --dump_path "<output_directory_path>" --extract_ema

For inference use, extracting with --extract_ema is usually recommended. This will be ignored if the source model does not contain both EMA and non-EMA weights.

@Pyr-000
Pyr-000 / OpenCLIP_ViT-H14_rev3_adjectives_map_cluster.html
Created December 21, 2022 22:30
OpenCLIP ViT-H/14 text encoding representations: UMAP+Clustering rev3
This file has been truncated, but you can view the full file.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>adjectives (UMAP+k_means)</title>
<script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-2.4.3.min.js"></script>
<script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.4.3.min.js"></script>
<script type="text/javascript">
Bokeh.set_log_level("info");
</script>
@Pyr-000
Pyr-000 / $Text.md
Last active December 10, 2022 18:24
Stable-Dreamfusion 3d-printing example

Created with stable-dreamfusion

Test-Hamburger:

  • Created via the example args main.py --text "a hamburger" --workspace trial -O --gui, stopped early after about 20-30 minutes of running on a 3080
  • Cleaned up via Meshmixer (making solid, removing floating 'motes' by separating shells, smoothing and flattening the bottom surface)
  • 3d-printed
@Pyr-000
Pyr-000 / 2022821235113_adjectives_map_cluster.html
Created August 21, 2022 22:01
CLIP ViT-L/14 text encoding representations: UMAP+Clustering rev4
This file has been truncated, but you can view the full file.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>adjectives (UMAP+k_means)</title>
<script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-2.4.3.min.js"></script>
<script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.4.3.min.js"></script>
<script type="text/javascript">
Bokeh.set_log_level("info");
@Pyr-000
Pyr-000 / 2022821213945_adjectives_map_cluster.html
Created August 21, 2022 20:16
CLIP ViT-L/14 text encoding representations: UMAP+Clustering rev3
This file has been truncated, but you can view the full file.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>adjectives (UMAP+k_means)</title>
<script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-2.4.3.min.js"></script>
<script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.4.3.min.js"></script>
<script type="text/javascript">
Bokeh.set_log_level("info");
</script>
@Pyr-000
Pyr-000 / 1_H14.md
Last active September 22, 2023 22:56
UMAP maps of internal CLIP text representations (direct viewable links)

UMAP maps of internal OpenCLIP ViT-H/14 text representations. Colors are derived from k_means clustering on the unprocessed (1024-dimensional) CLIP feature tensors.

This variant of CLIP is used in StableDiffusion version 2.x. (https://huggingface.co/laion/CLIP-ViT-H-14-laion2B-s32B-b79K)

"by <artist>": https://gist.githack.com/Pyr-000/90503e58688a7827278ea801096da933/raw/cd7f59e3d7d25800329ef0213d352e7e8ca8e8c9/OpenCLIP_ViT-H14_rev3_artists_by_map_cluster.html

"in the style of <artist>": https://gist.githack.com/Pyr-000/90503e58688a7827278ea801096da933/raw/cd7f59e3d7d25800329ef0213d352e7e8ca8e8c9/OpenCLIP_ViT-H14_rev3_artists_st_map_cluster.html

@Pyr-000
Pyr-000 / 202282117725_adjectives_map_cluster.html
Last active August 21, 2022 20:07
CLIP ViT-L/14 text encoding representations: UMAP+Clustering rev2
This file has been truncated, but you can view the full file.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>adjectives (UMAP+k_means)</title>
<script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-2.4.3.min.js"></script>
<script type="text/javascript">
Bokeh.set_log_level("info");
</script>
</head>
@Pyr-000
Pyr-000 / 2022821162046_adjectives_map_cluster.html
Created August 21, 2022 14:33
CLIP ViT-L/14 text encoding representations: UMAP+Clustering
This file has been truncated, but you can view the full file.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>adjectives (UMAP+k_means)</title>
<script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-2.4.3.min.js"></script>
<script type="text/javascript">
Bokeh.set_log_level("info");
</script>
</head>
@Pyr-000
Pyr-000 / 2022821162046_artists_by_map_cluster.html
Created August 21, 2022 14:30
CLIP ViT-L/14 representation UMAP of 'by <artist name>'
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>artists_by (UMAP+k_means)</title>
<script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-2.4.3.min.js"></script>
<script type="text/javascript">
Bokeh.set_log_level("info");
</script>
</head>