How to Setup Flux AI Model Locally with Pinokio

Posted on

If you want to try out the new Flux model locally and don’t want to waste hours trying to set up Python, Conda, PyTorch, etc., I’ve got just the thing for you! This guide will walk you through the Flux Pinokio setup, making local AI image generation a breeze.

With https://pinokio.computer/, you can easily install Flux and other models without risking your existing Python installation. It provides a nice, user-friendly interface to install, reset, and uninstall models.

What is Pinokio?

Pinokio is a self-contained platform that lets you install apps in an isolated manner.

  1. Isolated Environment: No need to worry about messing up your global system configurations and environments
  2. Batteries Included: No need to manually install required programs just to install something (such as ffmpeg, node.js, visual studio, conda, python, pip, etc.). Pinokio takes care of it automatically.

To achieve this, Pinokio stores everything under a single isolated folder (“pinokio home”), so it never has to rely on your system-wide configs and programs but runs everything in a self-contained manner.

You can set the pinokio home folder when you first set up Pinokio, as well as later change it to a new location from the settings tab.

Taken straight from here: https://program.pinokio.computer/#/?id=pinokio-file-system

Flux Pinokio setup: image generator interface
https://pinokio.computer/item?uri=https://github.com/pinokiofactory/flux-webui

There is a Gradio interface, which you can see above, with which you can install to use the Flux model with no knowledge of Python just by following the instructions.

Flux Pinokio Setup: Installation Steps

  1. First, download Pinokio by following the instructions on https://program.pinokio.computer/#/?id=install
  2. After installation, use the discover button on the menubar to get a list of installable apps:
    Discover button in Flux Pinokio setup
  3. Select the flux-webui and click on it:
    Selecting flux-webui for Flux Pinokio setup
  4. Press download on the next screen:
    Download screen in Flux Pinokio setup
  5. Confirm the directory and press download again. (No need to change the name, the default is fine.)
    Confirming directory in Flux Pinokio setup
  6. Press install again for a third time (I promise we’ll be done soon)
    Final install step in Flux Pinokio setup

Now Pinokio will download and install all needed software to run the model.

Installation process in Flux Pinokio setup

After it has downloaded everything, you should see the Gradio interface, which will appear automatically:

Gradio interface in Flux Pinokio setup

Here you can (1) input your prompt, (2) change the model, (3,4) configure the height, (5) select the number of images to generate and (6) choose how many inference steps the model should do.

Generating an Image with Flux Pinokio Setup

Now we’ll try to generate an image. I’ve chosen “a black forest cake with the words ‘it works’ written in icing” as my prompt, but you do as you like.

Image generation prompt in Flux Pinokio setup

The first time it runs, it will have to download the model, which can take a long time. You can watch the process and also check if you get errors by clicking on the Terminal entry on the left menubar.

Terminal view during Flux Pinokio setup

This might take a while (5-10 minutes depending on the internet connection), so lie back and get yourself some coffee or other beverage.

It won’t automatically switch back to the web UI, but when the last line looks like this:

“(…)pytorch_model-00002-of-00003.safetensors: 100%|█████████████████████████████████████████████████████████████▉| 9.94G/9.95G [04:49<00:00, 113MB/s]”

Then it should be done and we can switch back.

To switch back, press the “Open Web UI” in the menu on the left side.

Accessing Web UI in Flux Pinokio setup

Voilà, it works, and it even has great support for text and runs 100% locally. The first run took me around 377 seconds = 6 minutes on an M3 Max 128GB MacBook.

First image generated with Flux Pinokio setup

The next run only took me 20 seconds, with the model downloaded and cached:

Subsequent image generation with Flux Pinokio setup

And that’s it, you can now generate images locally with Flux.

There are a lot of other fun apps to run with Pinokio which you can find here: https://pinokio.computer/#explore

FAQ

Q: I found this by googling “flux + Error while deserializing header: MetadataIncompleteBuffer” because I used ComfyUI. What should I do?

A: You have two options:

  1. Use the easier interface “flux-webui” as described in this Flux Pinokio setup tutorial.
  2. If you prefer to stick with ComfyUI, try a few more times. For me, the error was resolved by restarting ComfyUI and dragging the image with the metadata in again.
Q: I want to run the flux-dev model.

A: The naming is confusing, but FLUX.1-merged is Flux.1-dev with 8 steps. https://github.com/pinokiofactory/flux-webui

Q: I get an error when trying to run Flux.1-merged.

A: There was an update that fixes that. Remove the app and reinstall it again according to the above instructions. Updating didn’t work for me and gave me a “optimum package missing” error when trying to start it. Might be because I messed around, you can try and update it (First you have to stop it, else the update button doesn’t appear). But if the updated version gives you an error, just try and reinstall it and it should fix it.

2 thoughts on “How to Setup Flux AI Model Locally with Pinokio

    1. Hey Jason, I updated the FAQ to answer the question. In short FLUX.1-merged is Flux.1-dev with 8 steps (https://github.com/pinokiofactory/flux-webui), but you need to update / remove and reinstall the script for it to work. (Not the whole app, just the flux-webui)

      I got it to work by removing and installing it again and it takes me around 50s on the M3 Max to generate an image, after the model is loaded for the first time.

Leave a Reply