Run this model with HF Jobs
Run Gustavosta/MagicPrompt-Stable-Diffusion 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 and TRL to fine-tune https://huggingface.co/Gustavosta/MagicPrompt-Stable-Diffusion. 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/Gustavosta/MagicPrompt-Stable-Diffusion 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.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/Gustavosta/MagicPrompt-Stable-Diffusion. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/Gustavosta/MagicPrompt-Stable-Diffusion. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use Gustavosta/MagicPrompt-Stable-Diffusion with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Gustavosta/MagicPrompt-Stable-Diffusion with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Gustavosta/MagicPrompt-Stable-Diffusion")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Gustavosta/MagicPrompt-Stable-Diffusion") model = AutoModelForCausalLM.from_pretrained("Gustavosta/MagicPrompt-Stable-Diffusion", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Gustavosta/MagicPrompt-Stable-Diffusion with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Gustavosta/MagicPrompt-Stable-Diffusion" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Gustavosta/MagicPrompt-Stable-Diffusion", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Gustavosta/MagicPrompt-Stable-Diffusion
- SGLang
How to use Gustavosta/MagicPrompt-Stable-Diffusion with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Gustavosta/MagicPrompt-Stable-Diffusion" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Gustavosta/MagicPrompt-Stable-Diffusion", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Gustavosta/MagicPrompt-Stable-Diffusion" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Gustavosta/MagicPrompt-Stable-Diffusion", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Gustavosta/MagicPrompt-Stable-Diffusion with Docker Model Runner:
docker model run hf.co/Gustavosta/MagicPrompt-Stable-Diffusion
Commit ·
6ce4e46
1
Parent(s): ac13a58
Update model
Browse filesFiles changed (5)
- README.md+25-3
- config.json+4-6
- pytorch_model.bin+2-2
- tokenizer_config.json+1-1
- training_args.bin+1-1
123---license: mit---12345678910111213141516171819202122232425# MagicPrompt - Stable DiffusionThis is a model from the MagicPrompt series of models, which are [GPT-2](https://huggingface.co/gpt2) models intended to generate prompt texts for imaging AIs, in this case: [Stable Diffusion](https://huggingface.co/CompVis/stable-diffusion).## 🖼️ Here's an example:<img src="https://files.catbox.moe/ac3jq7.png">This model was trained with 150,000 steps and a set of about 80,000 data filtered and extracted from the image finder for Stable Diffusion: "[Lexica.art](https://lexica.art/)". It was a little difficult to extract the data, since the search engine still doesn't have a public API without being protected by cloudflare, but if you want to take a look at the original dataset, you can have a look here: [Gustavosta/MagicPrompt-Dalle](https://huggingface.co/Gustavosta/MagicPrompt-Dalle).If you want to test the model with a demo, you can go to: "[Gustavosta/spaces/MagicPrompt-Dalle](https://huggingface.co/Gustavosta/spaces/MagicPrompt-Stable_diffusion)".## 💻 You can see other MagicPrompt models:- For Dall-E 2: [Gustavosta/MagicPrompt-Dalle](https://huggingface.co/Gustavosta/MagicPrompt-Dalle)- For Midjourney: [Gustavosta/MagicPrompt-Midourney](https://huggingface.co/Gustavosta/MagicPrompt-Midjourney)- MagicPrompt full: [Gustavosta/MagicPrompt](https://huggingface.co/Gustavosta/MagicPrompt)## ⚖️ Licence:[MIT](https://huggingface.co/models?license=license:mit)When using this model, please credit: [Gustavosta](https://huggingface.co/Gustavosta)**Thanks for reading this far! :)**
123456 unmodified lines12131415161718192021222324{"_name_or_path": "gpt2-medium","activation_function": "gelu_new","architectures": ["GPT2LMHeadModel"6 unmodified lines"layer_norm_epsilon": 1e-05,"model_type": "gpt2","n_ctx": 1024,"n_embd": 1024,"n_head": 16,"n_inner": null,"n_layer": 24,"n_positions": 1024,"n_special": 0,"predict_special_tokens": true,"reorder_and_upcast_attn": false,"resid_pdrop": 0.1,"scale_attn_by_inverse_layer_idx": false,123456 unmodified lines1213141516171819202122{"_name_or_path": "gpt2","activation_function": "gelu_new","architectures": ["GPT2LMHeadModel"6 unmodified lines"layer_norm_epsilon": 1e-05,"model_type": "gpt2","n_ctx": 1024,"n_embd": 768,"n_head": 12,"n_inner": null,"n_layer": 12,"n_positions": 1024,"reorder_and_upcast_attn": false,"resid_pdrop": 0.1,"scale_attn_by_inverse_layer_idx": false,
123version https://git-lfs.github.com/spec/v1oid sha256:0798154f31c6204bdcd13e9a1852335207cba11624d57c346aaff358fcc317d6size 1444566873123version https://git-lfs.github.com/spec/v1oid sha256:749116704f061992e879013cb4433f9e093f385dd5a807b20ac7d226c5f53926size 510396521
2 unmodified lines34567892 unmodified lines"bos_token": "<|endoftext|>","eos_token": "<|endoftext|>","model_max_length": 1024,"name_or_path": "gpt2-medium","special_tokens_map_file": null,"tokenizer_class": "GPT2Tokenizer","unk_token": "<|endoftext|>"2 unmodified lines34567892 unmodified lines"bos_token": "<|endoftext|>","eos_token": "<|endoftext|>","model_max_length": 1024,"name_or_path": "gpt2","special_tokens_map_file": null,"tokenizer_class": "GPT2Tokenizer","unk_token": "<|endoftext|>"
123version https://git-lfs.github.com/spec/v1oid sha256:5c9cbb0e886fec856200e407be281337a89e1673ff724aa10d72e571f508489esize 3375123version https://git-lfs.github.com/spec/v1oid sha256:f8d232c6d8bad47a89e6e1288360216bdb7652ddaa31c885db847aa20b29fd85size 3375
README.md+25-3
config.json+4-6
pytorch_model.bin+2-2
tokenizer_config.json+1-1
training_args.bin+1-1