stable diffusion base 2.0 text to image 04

Providermhbkb
Categoryimage-generation
Licensecreativeml-openrail-m
Downloads8
Stars0

Overview

Stable Diffusion v2.0 is a latent diffusion model designed for high-fidelity text-to-image synthesis. Unlike its predecessor, this version utilizes a redesigned text encoder and an improved VAE, resulting in better anatomical accuracy and higher resolution output. For developers, it offers a versatile foundation for building creative tools, from automated asset generation to custom fine-tuning via LoRA or ControlNet. It is particularly effective for photorealistic rendering and stylized art, providing a balance between inference speed and visual quality. Integration is straightforward through standard PyTorch environments or Hugging Face Diffusers, making it a reliable choice for scalable image pipelines.

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
# Install Hugging Face transformers
pip install transformers torch
SDK Usage
# 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:

Guidance
pip install -U huggingface_hub

CLI Download

Download the full repository

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)

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

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 Download
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:

Skip LFS
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

Install Transformers
pip install -U transformers torch

Load the model and run inference

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

来源: HuggingFace

---
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']:

!val_imgs_grid

Pipeline usage

You can use the pipeline like so:

python
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

python
# 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]

Join our Telegram