How to use from the
Use from the
Diffusers library
pip install -U diffusers transformers accelerate
import torch
from diffusers import DiffusionPipeline

# switch to "mps" for apple devices
pipe = DiffusionPipeline.from_pretrained("eolecvk/model-test", dtype=torch.bfloat16, device_map="cuda")

prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
image = pipe(prompt).images[0]

Mini Stable Diffusion (miniSD)

MiniSD is a latent text-to-image diffusion model that has been conditionned on 256x256 images through finetuning.

Examples

WIP

Usage

!pip install diffusers==0.3.0
!pip install transformers scipy ftfy
import torch
from diffusers import StableDiffusionPipeline
from torch import autocast

# TODO: change model_id to "lambdalabs/miniSD"
pipe = StableDiffusionPipeline.from_pretrained("eolecvk/model-test", torch_dtype=torch.float16)  
pipe = pipe.to("cuda")

prompt = "Yoda"
scale = 10
n_samples = 4

# Sometimes the nsfw checker is confused, you can disable it at your own risk here
disable_safety = False

if disable_safety:
  def null_safety(images, **kwargs):
      return images, False
  pipe.safety_checker = null_safety

with autocast("cuda"):
  images = pipe(n_samples*[prompt], guidance_scale=scale).images

for idx, im in enumerate(images):
  im.save(f"{idx:06}.png")
Downloads last month
7
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support