Powered by AppSignal & Oban Pro
Would you like to see your link here? Contact us

Playing with stable diffusion

playing_with_stable_diffusion.livemd

Playing with stable diffusion

Setup

alias AIPlayground.Models.StableDiffusion

stable_diffusion_model = StableDiffusion.init()
stable_diffusion_ui = fn player_name, text ->
  title = Kino.HTML.new("

FROM #{player_name}:

"
) frame = Kino.Frame.new() results = StableDiffusion.run(stable_diffusion_model, text) for result <- results do Kino.Image.new(result.image) end |> Kino.Layout.grid(columns: 2) |> then(&amp;Kino.Frame.render(frame, &amp;1)) Kino.Layout.grid([title, frame], boxed: true, gap: 16) end

Play

stable_diffusion_ui.("arnold", "numbat, forest, high quality, detailed, digital art")