stable diffusion base 2.0 text to image 04
Overview
Highlights
- Enhanced text encoder for better prompt adherence
- Native support for high-resolution image synthesis
- Compatible with LoRA and ControlNet extensions
- Open-source weights for flexible local deployment
- Efficient inference optimized for consumer-grade GPUs
Usage
# Install Hugging Face transformers
pip install transformers torch
# Load model with transformers
from transformers import AutoModel, AutoTokenizer
model = AutoModel.from_pretrained("mhbkb/stable-diffusion-base-2.0-text-to-image-04")
tokenizer = AutoTokenizer.from_pretrained("mhbkb/stable-diffusion-base-2.0-text-to-image-04")
Hugging Face Download
We recommend downloading the model via the Hugging Face CLI or Hub SDK.
Guidance:Before downloading, install huggingface_hub with:
pip install -U huggingface_hub
CLI Download
Download the full repository
huggingface-cli download mhbkb/stable-diffusion-base-2.0-text-to-image-04
Download a single file to a local folder (e.g. config.json into ./dir)
huggingface-cli download mhbkb/stable-diffusion-base-2.0-text-to-image-04 config.json --local-dir ./dir
See the official docs for more CLI options
SDK Download
# 模型下载
from huggingface_hub import snapshot_download
model_dir = snapshot_download('mhbkb/stable-diffusion-base-2.0-text-to-image-04')
Git Download
Make sure git-lfs is installed first
git lfs install
git clone https://huggingface.co/mhbkb/stable-diffusion-base-2.0-text-to-image-04
To skip LFS large-file downloads, use:
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/mhbkb/stable-diffusion-base-2.0-text-to-image-04
Model files are hosted on the Hugging Face Hub — download directly via HF CLI / SDK / Git, not through this site.
PyTorch / Transformers Usage
Install Transformers
pip install -U transformers torch
Load the model and run inference
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained('mhbkb/stable-diffusion-base-2.0-text-to-image-04')
tokenizer = AutoTokenizer.from_pretrained('mhbkb/stable-diffusion-base-2.0-text-to-image-04')
Full Documentation
---
base_model: stabilityai/stable-diffusion-2
library_name: diffusers
license: creativeml-openrail-m
inference: true
tags:
- stable-diffusion
- stable-diffusion-diffusers
- text-to-image
- diffusers
- diffusers-training
---
<!-- This model card has been generated automatically according to the information the training script had access to. You
should probably proofread and complete it, then remove this comment. -->
Text-to-image finetuning - mhbkb/stable-diffusion-base-2.0-text-to-image-04
This pipeline was finetuned from stabilityai/stable-diffusion-2 on the None dataset. Below are some example images generated with the finetuned pipeline using the following prompts: ['a photo of a dog']:
Pipeline usage
You can use the pipeline like so:
from diffusers import DiffusionPipeline
import torch
pipeline = DiffusionPipeline.from_pretrained("mhbkb/stable-diffusion-base-2.0-text-to-image-04", torch_dtype=torch.float16)
prompt = "a photo of a dog"
image = pipeline(prompt).images[0]
image.save("my_image.png")
Training info
These are the key hyperparameters used during training:
- Epochs: 8
- Learning rate: 0.0001
- Batch size: 1
- Gradient accumulation steps: 4
- Image resolution: 768
- Mixed-precision: fp16
More information on all the CLI arguments and the environment are available on your wandb run page.
Intended uses & limitations
#### How to use
# TODO: add an example code snippet for running this diffusion pipeline#### Limitations and bias
[TODO: provide examples of latent issues and potential remediations]
Training details
[TODO: describe the data used to train the model]