Run this model with HF Jobs
Run Milabench/stable-diffusion-2 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/Milabench/stable-diffusion-2. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/Milabench/stable-diffusion-2 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use Milabench/stable-diffusion-2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Milabench/stable-diffusion-2 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("Milabench/stable-diffusion-2", 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
Upload folder using huggingface_hub
Browse filesFiles changed (11)
- scheduler/scheduler_config.jsonAdded+14
- text_encoder/config.jsonAdded+25
- text_encoder/model.safetensorsAdded+3
- tokenizer/merges.txtAdded
- tokenizer/special_tokens_map.jsonAdded+24
- tokenizer/tokenizer_config.jsonAdded+34
- tokenizer/vocab.jsonAdded
- unet/config.jsonAdded+44
- unet/diffusion_pytorch_model.safetensorsAdded+3
- vae/config.jsonAdded+30
- vae/diffusion_pytorch_model.safetensorsAdded+3
1234567891011121314{ "_class_name": "DDIMScheduler", "_diffusers_version": "0.8.0", "beta_end": 0.012, "beta_schedule": "scaled_linear", "beta_start": 0.00085, "clip_sample": false, "num_train_timesteps": 1000, "prediction_type": "v_prediction", "set_alpha_to_one": false, "skip_prk_steps": true, "steps_offset": 1, "trained_betas": null}12345678910111213141516171819202122232425{ "_name_or_path": "hf-models/stable-diffusion-v2-768x768/text_encoder", "architectures": [ "CLIPTextModel" ], "attention_dropout": 0.0, "bos_token_id": 0, "dropout": 0.0, "eos_token_id": 2, "hidden_act": "gelu", "hidden_size": 1024, "initializer_factor": 1.0, "initializer_range": 0.02, "intermediate_size": 4096, "layer_norm_eps": 1e-05, "max_position_embeddings": 77, "model_type": "clip_text_model", "num_attention_heads": 16, "num_hidden_layers": 23, "pad_token_id": 1, "projection_dim": 512, "torch_dtype": "float32", "transformers_version": "4.25.0.dev0", "vocab_size": 49408}123version https://git-lfs.github.com/spec/v1oid sha256:cce6febb0b6d876ee5eb24af35e27e764eb4f9b1d0b7c026c8c3333d4cfc916csize 1361597018123456789101112131415161718192021222324{ "bos_token": { "content": "<|startoftext|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false }, "eos_token": { "content": "<|endoftext|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false }, "pad_token": "!", "unk_token": { "content": "<|endoftext|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false }}12345678910111213141516171819202122232425262728293031323334{ "add_prefix_space": false, "bos_token": { "__type": "AddedToken", "content": "<|startoftext|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false }, "do_lower_case": true, "eos_token": { "__type": "AddedToken", "content": "<|endoftext|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false }, "errors": "replace", "model_max_length": 77, "name_or_path": "hf-models/stable-diffusion-v2-768x768/tokenizer", "pad_token": "<|endoftext|>", "special_tokens_map_file": "./special_tokens_map.json", "tokenizer_class": "CLIPTokenizer", "unk_token": { "__type": "AddedToken", "content": "<|endoftext|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false }}1234567891011121314151617181920212223242526272829303132333435363738394041424344{ "_class_name": "UNet2DConditionModel", "_diffusers_version": "0.8.0", "_name_or_path": "hf-models/stable-diffusion-v2-768x768/unet", "act_fn": "silu", "attention_head_dim": [ 5, 10, 20, 20 ], "block_out_channels": [ 320, 640, 1280, 1280 ], "center_input_sample": false, "cross_attention_dim": 1024, "down_block_types": [ "CrossAttnDownBlock2D", "CrossAttnDownBlock2D", "CrossAttnDownBlock2D", "DownBlock2D" ], "downsample_padding": 1, "dual_cross_attention": false, "flip_sin_to_cos": true, "freq_shift": 0, "in_channels": 4, "layers_per_block": 2, "mid_block_scale_factor": 1, "norm_eps": 1e-05, "norm_num_groups": 32, "out_channels": 4, "sample_size": 96, "up_block_types": [ "UpBlock2D", "CrossAttnUpBlock2D", "CrossAttnUpBlock2D", "CrossAttnUpBlock2D" ], "use_linear_projection": true}123version https://git-lfs.github.com/spec/v1oid sha256:df895df60d360b4b18e9c05485080e3dd35691452460c7234031b64465120d5asize 3463726498123456789101112131415161718192021222324252627282930{ "_class_name": "AutoencoderKL", "_diffusers_version": "0.8.0", "_name_or_path": "hf-models/stable-diffusion-v2-768x768/vae", "act_fn": "silu", "block_out_channels": [ 128, 256, 512, 512 ], "down_block_types": [ "DownEncoderBlock2D", "DownEncoderBlock2D", "DownEncoderBlock2D", "DownEncoderBlock2D" ], "in_channels": 3, "latent_channels": 4, "layers_per_block": 2, "norm_num_groups": 32, "out_channels": 3, "sample_size": 768, "up_block_types": [ "UpDecoderBlock2D", "UpDecoderBlock2D", "UpDecoderBlock2D", "UpDecoderBlock2D" ]}123version https://git-lfs.github.com/spec/v1oid sha256:a1d993488569e928462932c8c38a0760b874d166399b14414135bd9c42df5815size 334643276scheduler/scheduler_config.jsonAdded+14
text_encoder/config.jsonAdded+25
text_encoder/model.safetensorsAdded+3
tokenizer/merges.txtAdded
tokenizer/special_tokens_map.jsonAdded+24
tokenizer/tokenizer_config.jsonAdded+34
tokenizer/vocab.jsonAdded
unet/config.jsonAdded+44
unet/diffusion_pytorch_model.safetensorsAdded+3
vae/config.jsonAdded+30
vae/diffusion_pytorch_model.safetensorsAdded+3