Run this model with HF Jobs
Run zecloud/mechas 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/zecloud/mechas. 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/zecloud/mechas 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 zecloud/mechas with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use zecloud/mechas with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("zecloud/mechas", 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
Update README.md
Browse files9 unmodified lines1011121314151617184 unmodified lines232425262728293031323334353637383940419 unmodified lines# Load the motion adapteradapter = MotionAdapter.from_pretrained("guoyww/animatediff-motion-adapter-v1-5-2", torch_dtype=torch.float16)# load SD 1.5 based finetuned modelmodel_id = "zecloud/mechas"pipe = AnimateDiffPipeline.from_pretrained(model_id, motion_adapter=adapter, torch_dtype=torch.float16)scheduler = DDIMScheduler.from_pretrained(model_id,subfolder="scheduler",4 unmodified lines)pipe.scheduler = scheduler# enable memory savingspipe.enable_vae_slicing()pipe.enable_model_cpu_offload()output = pipe(prompt=("half body portrait of man smiling with a mysterious gaze, mecha, science_fiction, city, realistic,mecha, a futuristic eiffel tower in the background "),negative_prompt="(worst quality, low quality:1.4), (bad_prompt_version2:0.8), EasyNegative, badhandv4, text, name, letters, watermark, two tower",num_frames=16,guidance_scale=7.0,num_inference_steps=32,generator=torch.Generator("cpu").manual_seed(42),)frames = output.frames[0]export_to_gif(frames, "animation.gif")9 unmodified lines10111213141516171819202122234 unmodified lines2829303132333435363738394041424344454647484950515253549 unmodified lines# Load the motion adapteradapter = MotionAdapter.from_pretrained("guoyww/animatediff-motion-adapter-v1-5-2", torch_dtype=torch.float16)# Load SD 1.5 based finetuned modelmodel_id = "zecloud/mechas"pipe = AnimateDiffPipeline.from_pretrained(model_id,motion_adapter=adapter,torch_dtype=torch.float16)scheduler = DDIMScheduler.from_pretrained(model_id,subfolder="scheduler",4 unmodified lines)pipe.scheduler = scheduler# Enable memory savingspipe.enable_vae_slicing()pipe.enable_model_cpu_offload()# Define the input prompts and generate the outputoutput = pipe(prompt=("half body portrait of man smiling with a mysterious gaze, mecha, science_fiction, city, realistic,mecha, ""a futuristic eiffel tower in the background "),negative_prompt=("(worst quality, low quality:1.4), (bad_prompt_version2:0.8), EasyNegative, badhandv4, text, name, letters, ""watermark, two tower"),num_frames=16,guidance_scale=7.0,num_inference_steps=32,generator=torch.Generator("cpu").manual_seed(42),)# Extract frames and export to GIFframes = output.frames[0]export_to_gif(frames, "animation.gif")
README.md+18-5