Text-to-Image
Diffusers
English
stable-diffusion-xl
huggingface-inference-endpoints
custom-inference
Run this model with HF Jobs
Run msgxai/msgxai-hg-api on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/msgxai/msgxai-hg-api. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/msgxai/msgxai-hg-api on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use msgxai/msgxai-hg-api with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use msgxai/msgxai-hg-api with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("msgxai/msgxai-hg-api", 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
chore: fix code
Browse filesFiles changed (2)
- README.md+23-1
- handler.py+1-2
261 unmodified lines262263264265261 unmodified lines1. Send a request to your endpoint2. Download the generated image3. Save it to the specified output directory4. Display the seed used for generation261 unmodified lines262263264265266267268269270271272273274275276277278279280281282283284285286287261 unmodified lines1. Send a request to your endpoint2. Download the generated image3. Save it to the specified output directory4. Display the seed used for generation## Troubleshooting### Error: "You are trying to load the model files of the `variant=fp16`, but no such modeling files are available"If you encounter this error when deploying your endpoint, it means the model you're trying to use doesn't have an fp16 variant explicitly available. To fix this:1. Open `handler.py`2. Find the `StableDiffusionXLPipeline.from_pretrained` call3. Remove the `variant="fp16"` parameterThe corrected code should look like:```pythonpipe = StableDiffusionXLPipeline.from_pretrained(ckpt_dir,vae=vae,torch_dtype=torch.float16,use_safetensors=self.cfg.get("use_safetensors", True))```This change allows the model to be loaded with fp16 precision without requiring a specific fp16 variant of the model weights.
102 unmodified lines103104105106107108109110102 unmodified linesckpt_dir,vae=vae,torch_dtype=torch.float16,use_safetensors=self.cfg.get("use_safetensors", True),variant="fp16")# Move model to GPUpipe = pipe.to("cuda")102 unmodified lines103104105106107108109102 unmodified linesckpt_dir,vae=vae,torch_dtype=torch.float16,use_safetensors=self.cfg.get("use_safetensors", True))# Move model to GPUpipe = pipe.to("cuda")
README.md+23-1
handler.py+1-2