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(&Kino.Frame.render(frame, &1))
Kino.Layout.grid([title, frame], boxed: true, gap: 16)
end
Play
stable_diffusion_ui.("arnold", "numbat, forest, high quality, detailed, digital art")