Text-to-Image
Diffusers
Safetensors
StableDiffusionXLPipeline
ultra-realistic
stable-diffusion
distilled-model
knowledge-distillation
Instructions to use segmind/SSD-1B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use segmind/SSD-1B with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("segmind/SSD-1B", 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
Setting seed, number of samples, batch size, or output resolution?
#17
by geoad - opened
Looked at the StableDiffusionXLPipeline source but cannot find out how to set basic parameters?
Could anyone offer a hint?
All the parameters work the similar way,
import torch
from torch import Generator
from diffusers import StableDiffusionXLPipeline
gen = Generator(f"cuda:{gpu}")
gen.manual_seed(0)
pipe = StableDiffusionXLPipeline.from_pretrained("segmind/SSD-1B", torch_dtype=torch.float16, variant="fp16", use_safetensors=True)
images = pipe(prompt = prompts, negative_prompt = negative_prompts, height = 1024, width = 1024, num_inference_steps = 50, guidance_scale = 9, num_images_per_prompt = 1,generator = gen).images
Here, prompts and negative_prompts are ordinary python lists. Batching is automatically handled when you supply the lists.
Hope this helps!
Thank you, that really helped a lot!
Warlord-K changed discussion status to closed