Instructions to use pruna-test/test-save-tiny-stable-diffusion-pipe-smashed-pro with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use pruna-test/test-save-tiny-stable-diffusion-pipe-smashed-pro with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("pruna-test/test-save-tiny-stable-diffusion-pipe-smashed-pro", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Pruna AI
How to use pruna-test/test-save-tiny-stable-diffusion-pipe-smashed-pro with Pruna AI:
from pruna_pro import PrunaProModel pip install -U diffusers transformers accelerate
from pruna_pro import PrunaProModel import torch # switch to "mps" for apple devices pipe = PrunaProModel.from_pretrained("pruna-test/test-save-tiny-stable-diffusion-pipe-smashed-pro", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
Add files using upload-large-folder tool
Browse files- README.md +3 -4
- model_index.json +7 -7
- scheduler/scheduler_config.json +4 -4
- smash_config.json +1 -0
- text_encoder/config.json +4 -5
- text_encoder/model.safetensors +2 -2
- tokenizer/tokenizer.json +1 -1
- tokenizer/tokenizer_config.json +1 -0
- unet/config.json +6 -6
- unet/diffusion_pytorch_model.safetensors +2 -2
- vae/config.json +5 -5
- vae/diffusion_pytorch_model.safetensors +2 -2
README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
---
|
| 2 |
-
|
| 3 |
tags:
|
| 4 |
- safetensors
|
| 5 |
- pruna-ai
|
|
@@ -18,7 +18,7 @@ First things first, you need to install the pruna library:
|
|
| 18 |
pip install pruna_pro
|
| 19 |
```
|
| 20 |
|
| 21 |
-
You can [use the
|
| 22 |
|
| 23 |
To ensure that all optimizations are applied, use the pruna library to load the model using the following code:
|
| 24 |
|
|
@@ -31,8 +31,6 @@ loaded_model = PrunaProModel.from_pretrained(
|
|
| 31 |
# we can then run inference using the methods supported by the base model
|
| 32 |
```
|
| 33 |
|
| 34 |
-
|
| 35 |
-
For inference, you can use the inference methods of the original model like shown in [the original model card](https://huggingface.co/hf-internal-testing/tiny-stable-diffusion-pipe?library=diffusers).
|
| 36 |
Alternatively, you can visit [the Pruna documentation](https://docs.pruna.ai/en/stable/) for more information.
|
| 37 |
|
| 38 |
## Smash Configuration
|
|
@@ -48,6 +46,7 @@ The compression configuration of the model is stored in the `smash_config.json`
|
|
| 48 |
"c_generate": false,
|
| 49 |
"c_translate": false,
|
| 50 |
"c_whisper": false,
|
|
|
|
| 51 |
"deepcache": false,
|
| 52 |
"diffusers_higgs": false,
|
| 53 |
"diffusers_int8": false,
|
|
|
|
| 1 |
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
tags:
|
| 4 |
- safetensors
|
| 5 |
- pruna-ai
|
|
|
|
| 18 |
pip install pruna_pro
|
| 19 |
```
|
| 20 |
|
| 21 |
+
You can [use the library_name library to load the model](https://huggingface.co/pruna-test/test-save-tiny-stable-diffusion-pipe-smashed-pro?library=library_name) but this might not include all optimizations by default.
|
| 22 |
|
| 23 |
To ensure that all optimizations are applied, use the pruna library to load the model using the following code:
|
| 24 |
|
|
|
|
| 31 |
# we can then run inference using the methods supported by the base model
|
| 32 |
```
|
| 33 |
|
|
|
|
|
|
|
| 34 |
Alternatively, you can visit [the Pruna documentation](https://docs.pruna.ai/en/stable/) for more information.
|
| 35 |
|
| 36 |
## Smash Configuration
|
|
|
|
| 46 |
"c_generate": false,
|
| 47 |
"c_translate": false,
|
| 48 |
"c_whisper": false,
|
| 49 |
+
"custom_schedule": false,
|
| 50 |
"deepcache": false,
|
| 51 |
"diffusers_higgs": false,
|
| 52 |
"diffusers_int8": false,
|
model_index.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
{
|
| 2 |
"_class_name": "StableDiffusionPipeline",
|
| 3 |
-
"_diffusers_version": "0.
|
| 4 |
-
"_name_or_path": "
|
| 5 |
"feature_extractor": [
|
| 6 |
-
|
| 7 |
-
|
| 8 |
],
|
| 9 |
"image_encoder": [
|
| 10 |
null,
|
|
@@ -12,12 +12,12 @@
|
|
| 12 |
],
|
| 13 |
"requires_safety_checker": true,
|
| 14 |
"safety_checker": [
|
| 15 |
-
|
| 16 |
-
|
| 17 |
],
|
| 18 |
"scheduler": [
|
| 19 |
"diffusers",
|
| 20 |
-
"
|
| 21 |
],
|
| 22 |
"text_encoder": [
|
| 23 |
"transformers",
|
|
|
|
| 1 |
{
|
| 2 |
"_class_name": "StableDiffusionPipeline",
|
| 3 |
+
"_diffusers_version": "0.41.0",
|
| 4 |
+
"_name_or_path": "dg845/tiny-random-stable-diffusion",
|
| 5 |
"feature_extractor": [
|
| 6 |
+
null,
|
| 7 |
+
null
|
| 8 |
],
|
| 9 |
"image_encoder": [
|
| 10 |
null,
|
|
|
|
| 12 |
],
|
| 13 |
"requires_safety_checker": true,
|
| 14 |
"safety_checker": [
|
| 15 |
+
null,
|
| 16 |
+
null
|
| 17 |
],
|
| 18 |
"scheduler": [
|
| 19 |
"diffusers",
|
| 20 |
+
"DDPMScheduler"
|
| 21 |
],
|
| 22 |
"text_encoder": [
|
| 23 |
"transformers",
|
scheduler/scheduler_config.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
-
"_class_name": "
|
| 3 |
-
"_diffusers_version": "0.
|
| 4 |
"beta_end": 0.012,
|
| 5 |
"beta_schedule": "scaled_linear",
|
| 6 |
"beta_start": 0.00085,
|
|
@@ -11,9 +11,9 @@
|
|
| 11 |
"prediction_type": "epsilon",
|
| 12 |
"rescale_betas_zero_snr": false,
|
| 13 |
"sample_max_value": 1.0,
|
| 14 |
-
"set_alpha_to_one": true,
|
| 15 |
"steps_offset": 1,
|
| 16 |
"thresholding": false,
|
| 17 |
"timestep_spacing": "leading",
|
| 18 |
-
"trained_betas": null
|
|
|
|
| 19 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"_class_name": "DDPMScheduler",
|
| 3 |
+
"_diffusers_version": "0.41.0",
|
| 4 |
"beta_end": 0.012,
|
| 5 |
"beta_schedule": "scaled_linear",
|
| 6 |
"beta_start": 0.00085,
|
|
|
|
| 11 |
"prediction_type": "epsilon",
|
| 12 |
"rescale_betas_zero_snr": false,
|
| 13 |
"sample_max_value": 1.0,
|
|
|
|
| 14 |
"steps_offset": 1,
|
| 15 |
"thresholding": false,
|
| 16 |
"timestep_spacing": "leading",
|
| 17 |
+
"trained_betas": null,
|
| 18 |
+
"variance_type": "fixed_small"
|
| 19 |
}
|
smash_config.json
CHANGED
|
@@ -6,6 +6,7 @@
|
|
| 6 |
"c_generate": false,
|
| 7 |
"c_translate": false,
|
| 8 |
"c_whisper": false,
|
|
|
|
| 9 |
"deepcache": false,
|
| 10 |
"diffusers_higgs": false,
|
| 11 |
"diffusers_int8": false,
|
|
|
|
| 6 |
"c_generate": false,
|
| 7 |
"c_translate": false,
|
| 8 |
"c_whisper": false,
|
| 9 |
+
"custom_schedule": false,
|
| 10 |
"deepcache": false,
|
| 11 |
"diffusers_higgs": false,
|
| 12 |
"diffusers_int8": false,
|
text_encoder/config.json
CHANGED
|
@@ -4,21 +4,20 @@
|
|
| 4 |
],
|
| 5 |
"attention_dropout": 0.0,
|
| 6 |
"bos_token_id": 0,
|
| 7 |
-
"dropout": 0.0,
|
| 8 |
"dtype": "float32",
|
| 9 |
"eos_token_id": 2,
|
| 10 |
"hidden_act": "quick_gelu",
|
| 11 |
"hidden_size": 32,
|
| 12 |
"initializer_factor": 1.0,
|
| 13 |
"initializer_range": 0.02,
|
| 14 |
-
"intermediate_size":
|
| 15 |
"layer_norm_eps": 1e-05,
|
| 16 |
"max_position_embeddings": 77,
|
| 17 |
"model_type": "clip_text_model",
|
| 18 |
-
"num_attention_heads":
|
| 19 |
-
"num_hidden_layers":
|
| 20 |
"pad_token_id": 1,
|
| 21 |
"projection_dim": 512,
|
| 22 |
-
"transformers_version": "5.
|
| 23 |
"vocab_size": 1000
|
| 24 |
}
|
|
|
|
| 4 |
],
|
| 5 |
"attention_dropout": 0.0,
|
| 6 |
"bos_token_id": 0,
|
|
|
|
| 7 |
"dtype": "float32",
|
| 8 |
"eos_token_id": 2,
|
| 9 |
"hidden_act": "quick_gelu",
|
| 10 |
"hidden_size": 32,
|
| 11 |
"initializer_factor": 1.0,
|
| 12 |
"initializer_range": 0.02,
|
| 13 |
+
"intermediate_size": 64,
|
| 14 |
"layer_norm_eps": 1e-05,
|
| 15 |
"max_position_embeddings": 77,
|
| 16 |
"model_type": "clip_text_model",
|
| 17 |
+
"num_attention_heads": 8,
|
| 18 |
+
"num_hidden_layers": 3,
|
| 19 |
"pad_token_id": 1,
|
| 20 |
"projection_dim": 512,
|
| 21 |
+
"transformers_version": "5.16.1",
|
| 22 |
"vocab_size": 1000
|
| 23 |
}
|
text_encoder/model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5edffee1c2ae276b4ecf6e6fc290c2da8224cda3a5a57d1d86a468e8d7e70b62
|
| 3 |
+
size 246416
|
tokenizer/tokenizer.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
| 18 |
"single_word": false,
|
| 19 |
"lstrip": false,
|
| 20 |
"rstrip": false,
|
| 21 |
-
"normalized":
|
| 22 |
"special": true
|
| 23 |
}
|
| 24 |
],
|
|
|
|
| 18 |
"single_word": false,
|
| 19 |
"lstrip": false,
|
| 20 |
"rstrip": false,
|
| 21 |
+
"normalized": true,
|
| 22 |
"special": true
|
| 23 |
}
|
| 24 |
],
|
tokenizer/tokenizer_config.json
CHANGED
|
@@ -2,6 +2,7 @@
|
|
| 2 |
"add_prefix_space": false,
|
| 3 |
"backend": "tokenizers",
|
| 4 |
"bos_token": "<|startoftext|>",
|
|
|
|
| 5 |
"do_lower_case": true,
|
| 6 |
"eos_token": "<|endoftext|>",
|
| 7 |
"errors": "replace",
|
|
|
|
| 2 |
"add_prefix_space": false,
|
| 3 |
"backend": "tokenizers",
|
| 4 |
"bos_token": "<|startoftext|>",
|
| 5 |
+
"clean_up_tokenization_spaces": true,
|
| 6 |
"do_lower_case": true,
|
| 7 |
"eos_token": "<|endoftext|>",
|
| 8 |
"errors": "replace",
|
unet/config.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
{
|
| 2 |
"_class_name": "UNet2DConditionModel",
|
| 3 |
-
"_diffusers_version": "0.
|
| 4 |
-
"_name_or_path": "/home/runner/.cache/huggingface/hub/models--
|
| 5 |
"act_fn": "silu",
|
| 6 |
"addition_embed_type": null,
|
| 7 |
"addition_embed_type_num_heads": 64,
|
|
@@ -9,8 +9,8 @@
|
|
| 9 |
"attention_head_dim": 8,
|
| 10 |
"attention_type": "default",
|
| 11 |
"block_out_channels": [
|
| 12 |
-
|
| 13 |
-
|
| 14 |
],
|
| 15 |
"center_input_sample": false,
|
| 16 |
"class_embed_type": null,
|
|
@@ -31,12 +31,12 @@
|
|
| 31 |
"flip_sin_to_cos": true,
|
| 32 |
"freq_shift": 0,
|
| 33 |
"in_channels": 4,
|
| 34 |
-
"layers_per_block":
|
| 35 |
"mid_block_only_cross_attention": null,
|
| 36 |
"mid_block_scale_factor": 1,
|
| 37 |
"mid_block_type": "UNetMidBlock2DCrossAttn",
|
| 38 |
"norm_eps": 1e-05,
|
| 39 |
-
"norm_num_groups":
|
| 40 |
"num_attention_heads": null,
|
| 41 |
"num_class_embeds": null,
|
| 42 |
"only_cross_attention": false,
|
|
|
|
| 1 |
{
|
| 2 |
"_class_name": "UNet2DConditionModel",
|
| 3 |
+
"_diffusers_version": "0.41.0",
|
| 4 |
+
"_name_or_path": "/home/runner/.cache/huggingface/hub/models--dg845--tiny-random-stable-diffusion/snapshots/af67c4fb4c7a3153cbabb98a478207e792628eb2/unet",
|
| 5 |
"act_fn": "silu",
|
| 6 |
"addition_embed_type": null,
|
| 7 |
"addition_embed_type_num_heads": 64,
|
|
|
|
| 9 |
"attention_head_dim": 8,
|
| 10 |
"attention_type": "default",
|
| 11 |
"block_out_channels": [
|
| 12 |
+
4,
|
| 13 |
+
8
|
| 14 |
],
|
| 15 |
"center_input_sample": false,
|
| 16 |
"class_embed_type": null,
|
|
|
|
| 31 |
"flip_sin_to_cos": true,
|
| 32 |
"freq_shift": 0,
|
| 33 |
"in_channels": 4,
|
| 34 |
+
"layers_per_block": 1,
|
| 35 |
"mid_block_only_cross_attention": null,
|
| 36 |
"mid_block_scale_factor": 1,
|
| 37 |
"mid_block_type": "UNetMidBlock2DCrossAttn",
|
| 38 |
"norm_eps": 1e-05,
|
| 39 |
+
"norm_num_groups": 2,
|
| 40 |
"num_attention_heads": null,
|
| 41 |
"num_class_embeds": null,
|
| 42 |
"only_cross_attention": false,
|
unet/diffusion_pytorch_model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8f2a2ce8d55801238ff2bb5280338ed494b8256a5208af6e70ec39cf38625d46
|
| 3 |
+
size 96000
|
vae/config.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
| 1 |
{
|
| 2 |
"_class_name": "AutoencoderKL",
|
| 3 |
-
"_diffusers_version": "0.
|
| 4 |
-
"_name_or_path": "/home/runner/.cache/huggingface/hub/models--
|
| 5 |
"act_fn": "silu",
|
| 6 |
"block_out_channels": [
|
| 7 |
-
|
| 8 |
-
|
| 9 |
],
|
| 10 |
"down_block_types": [
|
| 11 |
"DownEncoderBlock2D",
|
|
@@ -18,7 +18,7 @@
|
|
| 18 |
"latents_std": null,
|
| 19 |
"layers_per_block": 1,
|
| 20 |
"mid_block_add_attention": true,
|
| 21 |
-
"norm_num_groups":
|
| 22 |
"out_channels": 3,
|
| 23 |
"sample_size": 32,
|
| 24 |
"scaling_factor": 0.18215,
|
|
|
|
| 1 |
{
|
| 2 |
"_class_name": "AutoencoderKL",
|
| 3 |
+
"_diffusers_version": "0.41.0",
|
| 4 |
+
"_name_or_path": "/home/runner/.cache/huggingface/hub/models--dg845--tiny-random-stable-diffusion/snapshots/af67c4fb4c7a3153cbabb98a478207e792628eb2/vae",
|
| 5 |
"act_fn": "silu",
|
| 6 |
"block_out_channels": [
|
| 7 |
+
4,
|
| 8 |
+
8
|
| 9 |
],
|
| 10 |
"down_block_types": [
|
| 11 |
"DownEncoderBlock2D",
|
|
|
|
| 18 |
"latents_std": null,
|
| 19 |
"layers_per_block": 1,
|
| 20 |
"mid_block_add_attention": true,
|
| 21 |
+
"norm_num_groups": 2,
|
| 22 |
"out_channels": 3,
|
| 23 |
"sample_size": 32,
|
| 24 |
"scaling_factor": 0.18215,
|
vae/diffusion_pytorch_model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b023ca2edc02c318f3c46b7c8c05d21c188724d40b51855065fec0f91bf950ef
|
| 3 |
+
size 59772
|