Instructions to use d-wang26/mk1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use d-wang26/mk1 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("d-wang26/mk1", 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
Download diffusers/docs/source/en/api/pipelines/auto_pipeline.md from d-wang26/mk1: direct link, hf CLI and curl.
- Browser
- Download file 2.33 kB
-
https://huggingface.co/d-wang26/mk1/resolve/main/diffusers/docs/source/en/api/pipelines/auto_pipeline.md
- Command line
-
hf download hf://d-wang26/mk1/diffusers/docs/source/en/api/pipelines/auto_pipeline.md
-
curl -L -o auto_pipeline.md https://huggingface.co/d-wang26/mk1/resolve/main/diffusers/docs/source/en/api/pipelines/auto_pipeline.md
AutoPipeline
AutoPipeline is designed to:
- make it easy for you to load a checkpoint for a task without knowing the specific pipeline class to use
- use multiple pipelines in your workflow
Based on the task, the AutoPipeline class automatically retrieves the relevant pipeline given the name or path to the pretrained weights with the from_pretrained() method.
To seamlessly switch between tasks with the same checkpoint without reallocating additional memory, use the from_pipe() method to transfer the components from the original pipeline to the new one.
from diffusers import AutoPipelineForText2Image
import torch
pipeline = AutoPipelineForText2Image.from_pretrained(
"runwayml/stable-diffusion-v1-5", torch_dtype=torch.float16, use_safetensors=True
).to("cuda")
prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
image = pipeline(prompt, num_inference_steps=25).images[0]
Check out the AutoPipeline tutorial to learn how to use this API!
AutoPipeline supports text-to-image, image-to-image, and inpainting for the following diffusion models:
AutoPipelineForText2Image
[[autodoc]] AutoPipelineForText2Image - all - from_pretrained - from_pipe
AutoPipelineForImage2Image
[[autodoc]] AutoPipelineForImage2Image - all - from_pretrained - from_pipe
AutoPipelineForInpainting
[[autodoc]] AutoPipelineForInpainting - all - from_pretrained - from_pipe