Instructions to use HorizonRobotics/RoboTransfer with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use HorizonRobotics/RoboTransfer with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image, export_to_video # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("HorizonRobotics/RoboTransfer", torch_dtype=torch.bfloat16, device_map="cuda") pipe.to("cuda") prompt = "A man with short gray hair plays a red electric guitar." image = load_image( "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/guitar-man.png" ) output = pipe(image=image, prompt=prompt).frames[0] export_to_video(output, "output.mp4") - Notebooks
- Google Colab
- Kaggle
| import torch.nn as nn | |
| from diffusers.configuration_utils import ConfigMixin, register_to_config | |
| from diffusers.models.modeling_utils import ModelMixin | |
| class GuiderNet(ModelMixin, ConfigMixin): | |
| def __init__(self, in_channels=3, mid_channels=4, out_channels=8): | |
| super().__init__() | |
| self.layers = nn.Sequential( | |
| nn.Conv2d(in_channels, mid_channels, 4, 2, 1), | |
| nn.SiLU(), | |
| nn.Conv2d(mid_channels, mid_channels, 4, 2, 1), | |
| nn.SiLU(), | |
| nn.Conv2d(mid_channels, out_channels, 4, 2, 1), | |
| ) | |
| def forward(self, x): | |
| return self.layers(x) | |