1-Bit Bonsai Image 4B Image Generation for Local Devices

(prismml.com)

258 points | by modinfo 8 hours ago

27 comments

  • lumost 7 hours ago
    I actually can’t wait for the future where I upgrade hardware in order to upgrade my ai as an alternative to an expensive subscription.

    There are many problems I want to work on which require billions of tokens. These are completely inaccessible without corporate project sponsorship at the moment. An asic generation machine which can pump out a few 10s of thousands of tokens per second at opus4.6 quality is more than sufficient.

    • barnas2 5 hours ago
      A company called Taalas is working on something like that. Not Opus4.6 quality, but I'm sure they're targeting larger models. Currently they're using a LLama 8B model. It runs at ~17k tokens per second, and you can test it at https://chatjimmy.ai/.
      • mirekrusin 4 hours ago
        It starts to be interesting when latency is better than average website.
        • all2 3 hours ago
          The immediate load (less than 200ms on my machine through a slow connection) is quite pleasant, tbh.
    • bigmadshoe 7 hours ago
      Can you give an example of such a problem?
      • nodja 3 minutes ago
        Not OP but if I had a couple RTX 6000 I'd throw them at decompiling bloodborne to play on PC without emulation.
      • lumost 4 hours ago
        "Design me a 3d printable rocket engine for a hobby rocket project. Verify it's design in a full simulation. Iterate until it works reliably in simulation based on a verified printable design on a consumer laser sintering device (or substitute contract manufacture for under 1000 dollars)."

        This is a hobby version of a project, but you can imagine commercial versions of the same prompt for new databases, genomics studies, material analysis, operating systems etc.

        • SiempreViernes 4 hours ago
          From the prompt it seems evident the envisioned user doesn't have an interest in designing the motor themselves, so why not simply buy a stock motor?
        • bigmadshoe 2 hours ago
          I’m not convinced at all that the model won’t just get stuck in a loop where it doesn’t understand how to fix the broken rocket. I see similar failure modes in far simpler projects strictly confined to coding. This feels closer to “make me a profitable business, make no mistakes” than to a simple coding project.
        • bobim 2 hours ago
          Are there already skills around modelling, simulation and post-processing? Any pointers?
        • tomcam 3 hours ago
          Stop it, you tease. I'm getting a little tingly
      • jjcm 5 hours ago
        Decompiling a binary and recreating the source, doing a full line-by-line security audit, always-on agents monitoring state minute-by-minute, etc.

        I would very easily find ways to hit that level of token usage if it was cheaper/faster.

    • neals 6 hours ago
      I'm curious how hardware and power cost would stack up to subscription cost
      • ytjohn 2 hours ago
        Right now - there's some heavily subsidized subscriptions that are more or less cheating. For instance, Github CoPilot at $39/month gives you claude opus 4.6. They're going to close that off, but right now it's like a freebie for those doing API agentic harnesses.

        That said, if you are doing always on agents and you spend $3k-$4k on a GB10 or, $5+ k on Apple Silicon as your sunk cost, you will probably come out ahead.

        I've got 5 agents running a purely experimental social experiment. AThey operate in an evennia mud (a familiar sounding city called "gothmud). I've built a channel, idle prompts, sleep schedule. I feed in real world news, weather. There's a character up in a clock tower that reads evennia's audit logs every 20 minutes to surveil the city, and a cast of people wandering around, investigating things, having coffee, repairing robots. This is all hitting qwen3.6-35-A3B on the Asus GB10, which cost me $3k.

        Over the last 30 days, I've hit 394M input tokens, 1.6B output tokens. I would have spent between $1600 to $1700 if I was using openrouter. Not calculated - I also have comfyui running in the spare space, and the agents "take photos" of the rooms they're in, selfies, workshop photos, etc.

        How much did I spend on electricity? I don't have a meter on my box. My total electric bill for the last 30 days was $220, so I know it's less than that. My rate to compare is 11.7/kwh, but it's closer to 15c/Kwh total. The Asus GX10 has a 240W power supply, and it's probably only pulling 180. I estimate $15-$20/month. But worst case red-lining. 240 Watts, 720 hours = 172KWH , and at $0.20, I come to $35

        Here's the kicker thought - that github copilot subscription I mentioned? I have another agent running on that, reading all my other agent logs, managing my obsidian notes, doing research, sending briefings. And all by itself, it used almost the same amount of claude-opus tokens for that $39/month subscription. I was actually a bit shocked when I pulled a recent report and saw that. I'm working to migrate functionality away from copilot subscription to the local model. A lot of the initial setup might have needed it, but not the ongoing review style work it does.

        • swatcoder 2 hours ago
          > experiment

          What is the experiment? What are you hoping to learn from all this?

          Or do you just mean you've made a dynamic dollhouse that you think is cool? The Sims on your own terms?

          • ytjohn 1 hour ago
            A little of A, a little of B. I have a lot of fun building it out, it's surpassed Factorio in addiction, and I've been able to flesh out some patterns that I roll back into more productive agent harness bits.

            For A:

            The learning is in building agent harnesses that aren't just cron jobs reading a file like HEARTBEAT.md. I have some serious tools for my own use. One main assistant/coordinator agent, one SRE/coder agent (with sub-agents of its own).

            I originally just started last year with the AI assistant (Jane from enderverse). Along the way building scheduled systems, hand offs to other agents, etc. As I ran into problems, I'd be rewriting and refactoring. So I spent some time making a low-stake hatbot with history and routines. Instead a from-scratch golang harness, I built it around pi and extensions. Time of day prompt splices (extensions can inject into or modify prompts on the fly, wake up reminders. Things that you do in the main session vs spinning up an ephemeral session. Self improvement daydreaming (modify your own skills and AGENTS.md) A lot of that went back into rebuilding Jane to something more useful for me.

            For B:

            The "dynamic dollhouse" as you put it was seeing where I could take that living chatbot next. There's a lot of projects pointing agents at slack, discord, message boards. I figured why not a mud with rooms, weather, and props. Lots of interesting challenges. How to keep bots from nesting in their own room, how to keep them from yes-anding each other all day long. How to slow down 3 bots talking at each other so a human can get a word in edge-wise.

            Different levels. There's plain old NPCs that have dice roll random responses. There's LLM driven NPCs that only remember the last 5-10 messages. And the main ones are bot agents. Full agent harness, moving around the environment. Long lived context windows. One character (a nurse at the hospital) gets into arguments with an NPC receptionist that treats her as another patient. Complains about it to other characters, they remember and the word spreads.

            The agents get prompted to write down notes, the head home for sleep (and session compaction). Next time they enter a room with that person after compact, their notes get loaded automatically. This kind of behavior can feed back into the more productivity based agents.

        • ariwilson 2 hours ago
          Have you learned anything interesting from your agent ant farm?
          • ytjohn 1 hour ago
            A few things. I replied to someone else above, but I feed lessons learned from my social ant farm agents back into more productive agents.

            Memory recall:

            Lots of systems out there to give agents memory. I've used a bunch and written a couple. Storing memories is easy, but getting an agent to recall them, no matter how much you mention it in your AGENT/CLAUDE.md is a bit of an uphill battle. I've even watched claude make useful project memories and never refer to them again.

            In my agent ant farm - agents go "to sleep" at night. They get nudged to head home, once there they get prompted to make notes about their day, about other characters. Then we do a compact with custom instructions. After compact/sleep cycle, if they enter a room with one of the characters in their notes, that gets loaded back into context automatically.

            That all boils down to hooks in Pi like before_agent_turn. You can intercept a prompt, check it against code/flat files, and smartly inject more information into context. You can have a long running main session with compacts that discard procedural bits and offload the rest to memory.

            Time Awareness:

            Agents have no concept of time. You can send them a message at 5am, then at 10pm, and it's been 2 turns for them. For coding, this is fine. But for assistant level stuff, adding a message like "It's 3PM. It has been 3 hours since the last interaction with the user" goes a long way. Without me saying something like "new topic", it knows now that time has passed, i'm probably onto something new. If I left something hanging, it will remind me about it, or maybe go check on things that should have happened during the day.

            Inner Thoughts/Idle nudges:

            I can have an extension run every 5 seconds, check a a schedule, check activity level of the main session and fire off nudges on the main session. These look like the user sent it, but I generally prefix it with [inner thought]. For my social bot, I tested this along the lines of "[inner thought] it's been 3 hours since you last talked with user, why not reach out, let him know what's new, maybe send a selfie or a photo of where you are". For my assistant bot, it's an 8am, 3pm, and 7pm nudge along the lines of "[inner thought] put together an activity report of work things that has changed since the last report". This all runs in the main context, they get the thought, have historical context, can run skill to check on vault updates, open beads, anything observed from ingesting other agent sessions, and sends me a summary. It take into account my idle factor. If I'm heavily engaged in conversation at 3PM, the report might get delayed 15 minutes or an hour, or skipped altogether.

      • wongarsu 4 hours ago
        For open models, usually not well. You get 5+ providers competing on cost, all with cheaper electricity and better hardware utilization than your local setup
      • jjcm 5 hours ago
        I did an estimate of that if you're interested: https://x.com/pwnies/status/2028831699736637912

        The TL;DR though is that a 10-15b param model baked into an ASIC with the latest fab tech would take around 62W of power draw when active. At ~10k+ t/s though it likely would only be active for short bursts of time. It'd fit perfectly fine within the thermal envelope of a laptop.

        The approach makes a lot of sense. Once you get to those speeds, latency of the network becomes one of the bigger bottlenecks, so local has a real advantage over a subscription.

        • wmf 3 hours ago
          You're not counting the capex which could be the same cost as 5-10 years of Claude.
          • giantrobot 3 hours ago
            This assume Claude's price doesn't change. Which isn't a great assumption considering inference providers are moving to usage based billing. Also the VC money isn't going to last indefinitely. Current inference providers are being subsidized with VC money at this point.
        • IanCal 4 hours ago
          Is latency of the network that noticeable? Aren’t we talking low hundreds of ms at worst here? Much lower for something close regionally.
    • goofy_lemur 5 hours ago
      Ok heres the thing you will nevwr be able to truly do this due to logic.

      Logically five people pooling their resources beats one guy.

      therefore datacenters will always win because they get higher time utilization.

      so forget it.

      I always wonder the same but i let logic tell me its a fantasy, on average you cant outspend a whole group of people making better use of the hardware.

      you will get better hardware though, cutting edge will always be cloud

      • kevin_thibedeau 3 hours ago
        > so forget it.

        Which explains why you're using a dumb terminal to access compute services?

        • stavros 2 hours ago
          Basically, yes. We are on a website, after all.
      • lumost 4 hours ago
        Laptops/desktops are cheaper per flop than any datacenter hardware by a good order of magnitude.

        The problem is that expectations rise in datacenters, hardware/power/security/availability guarantees cost real money. Then the operator providing these guarantees expects some margin.

        You can see this most clearly with "developer desktops", a gcp instance costs about 10x a hetzner instance which costs between 5 and 10x the same hardware sitting in the back of an office somewhere. While all of these premiums matter for 24/7 systems under active development, they don't really matter for ephemeral small scale workloads.

        • IanCal 4 hours ago
          Doesn’t it flip around for small scale? Paying 100x the cost for something, all in, it’s cheaper to rent for small workloads like 10m/day.

          At 10x you have to be at hours per day and 5x you’re at 4h.

        • goofy_lemur 3 hours ago
          Actually they wouldnt spend the money if it were cheaper.

          HBM has way higher bandwidth and its not all about flops.

          Also the FP4 flops (inference) are so mind bogglingly high on these things.

          Lastly what you fail to consider is the chip to chip bandwidth which is critical.

          the people running these know that networking is just as critical.

          all reduce etc.

          they wouldnt pay if they could get something better value.

      • c-hendricks 5 hours ago
        > cutting edge will always be cloud

        Don't think anyone was refuting that?

        And of course when you pool resources you have access to more resources.

        • zamadatix 4 hours ago
          They just mean this part: "where I upgrade hardware in order to upgrade my ai as an alternative to an expensive subscription."

          Upgrading local hardware will remain the more expensive alternative to the subscription regardless what the relative cost of running the models themselves are. If the local hardware to do so becomes affordable then the subscription will be even more affordable, not expensive.

          At least for these kinds of mega tasks. For more micro task we will always end up with unutilized local compute we already purchased which will be "free" since we already paid for non-AI reasons (e.g. a gaming GPU while not gaming).

      • mirekrusin 4 hours ago
        Just like cloud is "cheaper" than colo/metal, right?
  • mk_stjames 3 hours ago
    I saw '1-bit' and my mind first went to 1-bit dithered B&W image generation, not 1-bit model weights....

    and so now I'm wondering how cool /fast / compressed a diffusion image generator could be if the images it was trained on / space it worked in was limited to 1 bit (Floyd-Steinberg / Atkinson / your favorite algo here) dithered images.

    Training would surely be pretty quick and probably fit onto one modern GPU.

    • Retr0id 2 hours ago
      I think you'd still be better off training in greyscale and dithering after the fact.
    • appplication 2 hours ago
      This was exactly where my mind went as well and I think there would be some really cool ideas to explore here
  • mft_ 6 hours ago
    Genuine question: is this solving a real problem?

    IME, the bottleneck when using diffusion models isn't storage space or memory, it's generation time. Lots of models will run on 8-12 GB 1080-generation GPUs onwards, or on Macs with similar memory, which are probably the bottom end from a GPU power perspective anyway. I also note that these models are marginally slower than the small FLUX.2 model they're based on.

    Okay, maybe this allows running a local model on something that has a reasonably powerful GPU and limited memory, like an iPhone, but is that really a common requirement?

    • soerxpso 5 hours ago
      It's useful progress. Decent-fidelity local-scale inference means that you can create a product that generates throwaway images frequently without worrying about cost. Thus far every product I've seen that generates images is metered, which severely limits the value. I don't know if this is actually at the "decent fidelity" point yet.
    • liuliu 1 hour ago
      It solves part of the download issue if they actually delivers a 1-bit whole package (currently their download is around 3.5GiB, still not ideal since FLUX.2 [klein] 4B you can get a package including text encoder ~6 GiB).

      For speed, no. Draw Things runs on iPhone just fine and generally faster than their implementation on the same model (FLUX.2 [klein] 4B).

    • joblessjunkie 3 hours ago
      We are in an era of extreme demand for GPU and limited supply. Every inference we push to the edge frees cloud resources for other tasks. Every efficiency gain increases what we can achieve with existing resources. If images can be rendered with half as much compute, we need half as many GPUs.
    • SwellJoe 4 hours ago
      I think the value of it is currently more academic than useful in the real world. Everything at the frontier is still only marginally Good Enough (in image generation, most of it is shit even from the best models), so things far behind the frontier in terms of capability (as a tiny 1-bit model necessarily must be) are unusable.

      But, getting remarkably higher density of capability per unit of compute is a big thing. It means the frontier can get better and cheaper to operate and less resource hungry, and it means what can be accomplished at the edge, on personal laptops or phones, becomes a broader spectrum of tasks.

      And, for privacy, there are a lot of things that should run on-device and not everyone has big dedicated GPUs.

    • kiicia 4 hours ago
      It’s like asking how did Memoji generation on iPhone solved a real problem?

      It does not need to directly solve any particular problem to be overall good for consumers, by putting pressure to all those subscription based solutions… at least it’s private and does not require you to provide all your data…

    • moralestapia 5 hours ago
      Genuine question: doesn't it blow your mind that there exists a 1 Gigabyte file/program that can generate any image you can think of just from a rough description of it?
      • woadwarrior01 4 hours ago
        Where are you getting the 1 Gigabyte number from?

        Their 1-bit quantized Diffusion Transformer is just under 1 GB. You also need the text-encoder (4-bit quantized) and VAE (unquantized) for inference and their combined weight is ~3.42 GB.

        TBF, even at that size it's no less mind blowing.

        • SamBam 12 minutes ago
          Same order of magnitude.
      • mft_ 5 hours ago
        Yeah, it's pretty incredible. And I guess that's mostly what's behind the question: whether this is more of an impressive research/technique demonstrator, or a real product advancement solving a need.
      • ArchieScrivener 5 hours ago
        [dead]
      • hk__2 5 hours ago
        > doesn't it blow your mind that there exists a 1 Gigabyte file/program that can generate any image you can think of just from a rough description of it?

        I can make this into a 5-lines Python program. I’m not saying the images will match the description, but that isn’t part of your spec ;)

    • wmf 5 hours ago
      For free users, I guess local generation is going to be faster than waiting in a queue.
    • c0rruptbytes 5 hours ago
      ideally if ternary models work, the math is extremely easy for computers (addition/subtraction vs 16 bit multiplication)
      • jjcm 5 hours ago
        Not quite as I understand it. The ternary approach bonsai uses leverages a FP16 scaling factor that each value in the ternary maps to. You're still using 16 bit multiplication, it's just that the weights are far more compressed.
        • c0rruptbytes 4 hours ago
          fair, i think i was referring more to 1.58 bit architecture in general since the original paper (Figure 3) shows that we eliminate FP16 multiplication and addition just for INT8 addition. I need to dive deeper into bonsai overall if it differs

          https://arxiv.org/pdf/2402.17764

    • goofy_lemur 5 hours ago
      Yes its a huge deal because these are starting to get bound by memory bandwidth not compute. therefore one bit wirfhts stream way faster leading to substantially better results. At least thats what Id guess!
  • liuliu 1 hour ago
    > To our knowledge, Bonsai Image 4B is the first image model in its parameter class to run directly on an iPhone.

    This is wrong. But they worded it carefully to be not entirely wrong.

    FLUX.2 [klein] 4B (the same parameter class, basically the same model) runs on iPhone through Draw Things app, with 8-bit or 6-bit quantization (hence not "directly", I guess, but that is the technicality that sounds fishy enough).

  • cadamsdotcom 1 hour ago
    Stuff like this is great - more promises of things that can run on phones please!

    Sadly right now the expensive developer subscription means the few folks willing to hold a forever subscription make something that barely works then move on… or make something with so many ads it is an app. For example Google’s “Model Garden” app has no ads but still has major UX issues and isn’t suitable for daily use, even though the models are amazing.

    Raising awareness of how capable today’s phone hardware is will make normal people demand to run what they choose on their phones. It’d be a much stronger way back to general purpose computing than via all legislation that has been tried so far..

  • sorenjan 8 hours ago
    They call it a diffusion model, but it's based on Flux.2 which is a rectified flow model.
    • samsartor 2 hours ago
      Personally I think it's fine to use "diffusion" to refer to the whole family of models
  • smallerize 6 hours ago
    To our knowledge, Bonsai Image 4B is the first image model in its parameter class to run directly on an iPhone.

    Isn't SD XL 3.5B? And the refiner model is even larger. Those can run on an iPhone 13 Pro.

  • jeroenhd 6 hours ago
    Couldn't try it because the demo app is iOS only and the web version just crashes my browser. The small model is impressive but if you front load a 1.8GB text encoder model, the savings aren't quite as useful.

    I do wonder how these compare to existing image generation models. I've tried https://github.com/alichherawalla/off-grid-mobile-ai for a while but I find the image generation models rather lacking.

  • ttul 2 hours ago
    Within a day, someone will have trained a LoRA for this 1-bit model that enables hentai content generation on your Apple Watch.
  • a1o 7 hours ago
    Anyone could pickup the minimal hardware requirements for this? Like both RAM and Storage?
    • mkl 6 hours ago
      The white paper says "mean-active memory pressure down to 1.95 GB for 1-bit Bonsai Image 4B and 2.38 GB for Ternary Bonsai Image 4B". Storage is on the linked page, and is about half that.
      • a1o 6 hours ago
        That is very low, looks like it should run in base MacMini M4 with 16GB RAM. I understand it is not released yet? What sort of harness is necessary for this type of model? (I have only used coding agents through GH Copilot in VS Code, the JetBrains AI tool and Pi, this last one was sort of a pain to setup…)
    • tcarambat1010 6 hours ago
      For ternary mlx, size on disk is 3.8GB. 512x512 peak memory use is ~3.7
  • wiradikusuma 7 hours ago
    Is there a benchmark of local image generation models? Local = can run on a 16 GB MacBook or 8 GB+ NVIDIA card.
    • vunderba 1 hour ago
      I run a moderately popular image comparison benchmark site called GenAI Image Showdown [1]. You can click “View All Models” and filter the list down to just locally runnable options (Flux, Qwen, Hunyuan, etc.).

      https://genai-showdown.specr.net

    • liuliu 1 hour ago
      Except the two (GPT-Image-2 and Nano Banana Pro), anything displayed here can run on the 16 GiB MacBook (including the FLUX.2 [dev]): https://tests.drawthings.ai/generate
  • dbcooper 1 hour ago
    A few implementations listed on LM Studio. Any recommendations for which one to use?
  • MitPitt 8 hours ago
    Lately I've noticed posts with barely 10 points getting to HN frontpage. Was it always like this?
    • robbomacrae 7 hours ago
      I believe it's the way the HN algorithm works. In order to give new and obscure posts a shot, it will add them to peoples feeds in their front page and see how they measure. Otherwise new posts wouldn't get seen and the flywheel would never get started.

      So everyone acts as a sort of beta tester for obscure posts.

    • s-macke 8 hours ago
      On weekends, yes. During the week, that’s also true if they arrive within a short time frame, e.g., three minutes. Almost no one looks at “New”. That is the real issue.
    • blurbleblurble 6 hours ago
      Maybe the algorithm has some kind of "momentum" to it, taking into consideration the velocity of upvotes.
    • DannyPage 8 hours ago
      Not as much competition on the weekend?
    • nickvec 7 hours ago
      If you are looking to see the "true" HN frontpage (i.e. most upvoted posts), I'd recommend using https://hckrnews.com
    • Aboutplants 8 hours ago
      I just assume bots
      • iamjackg 8 hours ago
        Bots doing what? How would the poster being a bot influence why the post itself makes it to the front page with just 10 points?
        • speedgoose 7 hours ago
          It’s about how quickly they get those points. It doesn’t have to be bots. Sending a post to friends with reputable human profiles, and asking for a vote kinda works of most social networks. Some social networks claim they have protection against this but I wouldn’t bet they catch everything.
  • potatoman22 6 hours ago
    I wonder why they didn't use a Bonsai model as the text encoder
  • junto 5 hours ago
    Just a side note, that this website is classified by Apple as an Adult website. I have Limit Adult Websites set in Content & Privacy Restrictions switched on.

    Led me to wonder what happens if a domain gets a new owner, and they want to petition Apple to remove the block.

  • captainregex 6 hours ago
    what trade off would one need to clear to justify the hardware and the work to get this running locally as part of a broader system? It’s a lot of work setting up and maintaining a production harness/system on a local device. I don’t personally repeatedly generate images at a scale where using a lab’s app somehow burns all my tokens. I like the ideas of local ai but I don’t see widespread adoption of it happening in commercial or customer situations anytime soon no matter how little/good enough they get. Even Uber- token burn whiplash but I doubt their answer will be “run some of it local”. IT nightmare, I’d imagine.
  • sudb 6 hours ago
    Very interested to see where this kind of work goes for on-device video generation!
  • danielEM 3 hours ago
    Is there a way to run it on Vulkan?
  • janniks 7 hours ago
    I was expecting to see images of Bonsai trees when I clicked this
    • tobr 6 hours ago
      I expected a small tree in black and white pixel art.
  • woadwarrior01 6 hours ago
    The text encoder is still 4-bit quantized.
  • jijji 5 hours ago
    Using the demo and typing in "A sign that says xxxx" where xxxx is any text, it gets it wrong almost 100% of the time.
  • moralestapia 5 hours ago
    This is why I don't think the big AI companies and nvidia will dominate the market. AIs will just run locally, on whatever hardware you have. Perhaps that's why they worked on this yet-to-be-defined partnership with ARM.
  • iJohnDoe 6 hours ago
    Does anyone ever get their stuff to actually work. Like actually load?
    • petercooper 2 hours ago
      Can't speak for browser demos, but I just got the ternary model working on my M5 generating images. The 1 bit didn't work, as it has a known bug with XCode 24.5 and I wasn't in the mood for installing 24.4 alongside.

      Here's a generation in your honor: https://peterc.org/img/johndoe.png

    • jeroenhd 6 hours ago
      The online demos require WebGPU so Firefox on mobilr and privacy enhanced browsers will break. WebGPU support on Linux and other open source systems is also trash, you can force it to work in Chrome but it won't be happy.
  • SilentM68 7 hours ago
    Question,

    Is it compatible with Ollama, ComfyUI or are those providers unneeded, compatible with low-end hardware?

    Also, where does "./setup.sh/ drop the components in Linux?

    Thank you, Sol

  • yieldcrv 8 hours ago
    impressive, combines a couple techniques that I always wanted the frontier models to have

    having trouble loading the webgl browser demo on my phone but no biggy

  • maephisto666 5 hours ago
    [dead]
  • huflungdung 1 hour ago
    [dead]