dribnet / pixray

neural image generation
Other
402 stars 53 forks source link

Add transparency support for pixel drawer #32

Closed rvorias closed 3 years ago

rvorias commented 3 years ago

This introduces transparency mask optimisation inspired by https://distill.pub/2018/differentiable-parameterizations/#section-rgba.

It adds a boolean setting called "transparency".

dribnet commented 3 years ago

I was going to go ahead and clean this up and merge it in. But now we are feeling ... drafty?

rvorias commented 3 years ago

I felt the draft creep in; after the twitter post I decided I might as well also implement the gaussian weights. I'll add it to this PR after some experiments. Should make it a lot cleaner / without corner artifacts.

dribnet commented 3 years ago

I've merged this in since it seemed to be backward compatible and I had gone ahead and made a light change to the transparent setting. feel free to continue to tweak this of course but I wanted to get this first version in and play with it a bit.

dribnet commented 2 years ago

update: I've pulled in the latest changes from your branch so master now also has the latest alpha gaussian changes and also confirmed that this works with the new edge custom loss

treehouse_15_16

python pixray.py \
  --aspect square \
  --size 256 256 \
  --pixel_size 64 64 \
  --seed 42 \
  --drawer pixel \
  --quality better \
  --transparent 1 \
  --alpha_use_g 1 \
  --custom_loss edge:4 \
  --edge_color black \
  --edge_thickness 10 \
  --prompt 'treehouse in the style of studio ghibli animation' \
  --output outputs/nov21/treehouse_15_16.png
rvorias commented 2 years ago

Sweet! The noisy border didn't render on my phone though o: