Last active
April 3, 2026 04:37
-
-
Save hathibelagal-dev/89ac4dba0f30ab4fd3f676ebdcaea746 to your computer and use it in GitHub Desktop.
Testing diffusers with makrell-py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {import torch} | |
| {import diffusers@[StableDiffusionPipeline]} | |
| # segmind/tiny-sd is a very small distilled model (~600MB) | |
| model_id = "segmind/tiny-sd" | |
| {print "Loading Tiny-SD pipeline..."} | |
| pipe = {StableDiffusionPipeline.from_pretrained | |
| model_id | |
| torch_dtype=torch.float32 | |
| low_cpu_mem_usage=true} | |
| device = "cpu" | |
| pipe = {pipe.to device} | |
| {pipe.enable_attention_slicing} | |
| prompt = "A simple drawing of a makrell fish" | |
| {print "Generating image (256x256)..."} | |
| result = {pipe | |
| prompt=prompt | |
| num_inference_steps=5 | |
| height=256 | |
| width=256} | |
| # result.images is a list. Let's get the first one using @ operator. | |
| image = result.images@0 | |
| {image.save "makrell_fish.png"} | |
| {print "Image saved to makrell_fish.png"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment