Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Hugging Face 7 min read How-to mediumAdept

Deploying Hugging Face Models with BentoML: DeepFloyd IF in Action

DeepFloyd IF, a pixel-space text-to-image model with a T5-XXL text encoder and three cascaded diffusion stages (64px up to 1024px), can be packaged and served with BentoML by saving each stage's model to the BentoML Model Store, wrapping them as separate Runners in a Service, and building a Bento artifact. Because each stage is its own Runner, stages can be pinned to different GPUs (e.g. Stage 1 on one T4, Stages 2 and 3 on another) or scaled independently. Hardware guidance is at least 2x16GB or 1x40GB of VRAM. The resulting ~49 GiB Bento can be served directly, containerized with `bentoml containerize`, and deployed to Kubernetes.

Related posts

  • Running IF with 🧨 diffusers on a Free Tier Google Colab

    Hugging Face mediumAdept

    DeepFloyd's IF, a pixel-space text-to-image model built on a T5-XXL text encoder with over 10B parameters, can run on a free-tier Google Colab (13 GB CPU RAM, 15 GB T4 VRAM) by loading its components one at a time with diffusers. The recipe quantizes T5 to 8-bit with bitsandbytes, loads the UNets in fp16, and passes precomputed prompt embeddings between pipelines. Each component is freed with del, gc.collect and torch.cuda.empty_cache before the next one loads. These steps trade inference speed for memory, so for production the recommendation is a 40GB A100 with all components kept on the GPU. Image variation and inpainting are also covered.

  • Welcome FLUX.3 Image Klein in Diffusers

    Hugging Face mediumAdept

    FLUX.3 Image Klein from Black Forest Labs is supported in Diffusers from launch. It is a single model for text-to-image, multi-reference image-to-image, and bounding-box layout control, where regions are written as JSON with normalized 0–1000 boxes to place new content or move content from a reference image. The distilled checkpoint renders 1024×1024 in about 1.9 s on an H100 in 16 steps without CFG. Reference images roughly double the time because each adds 4,096 tokens to the transformer sequence. The post also covers FP8 and NVFP4 single-file variants that cut peak memory to about 15–16 GiB, DreamBooth LoRA training scripts, the VAE tokenization (one token per 16×16 patch), and Modular Diffusers pipeline usage.

  • Deploy LLMs with Hugging Face Inference Endpoints

    Hugging Face mediumAdept

    Falcon 40B Instruct can be deployed to Hugging Face Inference Endpoints through the web UI by choosing a repository, cloud, region and instance. For best performance the suggested 4x T4 instance should be switched to a single A100. Once the endpoint is live it can be called with cURL, and generation is controlled through parameters such as temperature, max_new_tokens (max 512), top_k/top_p, repetition_penalty and stop sequences. Tokens can be streamed to clients using huggingface_hub's InferenceClient in Python or HfInferenceEndpoint from @huggingface/inference in JavaScript, with code that skips special tokens and stops on stop sequences.

  • Run ComfyUI workflows for free with Gradio on Hugging Face Spaces

    Hugging Face mediumAdept

    A ComfyUI node workflow can be turned into a standalone Gradio app and hosted for free on Hugging Face Spaces' serverless ZeroGPU tier. The steps: export the workflow to Python with ComfyUI-to-Python-Extension, then rewrite its main() into a generate_image function whose hard-coded node values become UI inputs and which returns the saved image path. To prepare for Spaces, fetch the models with hf_hub_download instead of uploading them, wrap inference in the @spaces.GPU decorator, and merge the custom nodes' dependencies into one requirements.txt. Loading models in global scope, outside the decorated function, keeps ZeroGPU from reloading them from disk on every run.

  • Hugging Face Text Generation Inference available for AWS Inferentia2

    Hugging Face mediumAdept

    Text Generation Inference (TGI) is now generally available on AWS Inferentia2 through Amazon SageMaker, offering an alternative to GPUs for serving open LLMs such as Llama and Mistral. A walkthrough deploys Zephyr 7B on an ml.inf2.8xlarge using the TGI Neuronx container. Because Inferentia2 lacks dynamic shapes, batch size, sequence length, core count and cast type must be fixed at compile time. A neuron model cache provides pre-compiled configurations; compiling an uncached one with optimum-cli can take up to 45 minutes. The deployment environment variables (HF_NUM_CORES, HF_BATCH_SIZE, HF_SEQUENCE_LENGTH, MAX_TOTAL_TOKENS) must match those compile-time settings.

The quest for software engineering knowledge.

Look:
Layout: