CoolFace
Modelpublic

GeorgeQi/Color-Palette-Flux_dev

sourceHugging Faceotherupdated 2y agoView on Hugging Face
0likes7downloads
Model Card

Color-Patette-Flux_dev

Text to Image

<Gallery />

python
import torch
from diffusers import FluxPipeline
  
prompt = "[COLOR_PALETTE] This two-part image showcases the transformation from a color palette to a image. \
          [LEFT] a color palette with five different colors. \
          [RIGHT] an intricately designed perfume bottle resting on a vintage carved dressing table, flanked by elegant makeup and jewelry, with a gilded mirror above and a vase of peonies adding a romantic ambiance, all depicted in a refined vintage style."

pipe_t2i = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16).to("cuda")
pipe_t2i.load_lora_weights("./color_palette_lora.safetensors")
pipe_t2i.enable_lora()
out = pipe_t2i(prompt=prompt, guidance_scale=3.5, height=768, width=512, num_inference_steps=50).images[0]
out.save("t2i_color_palette.png")

Conditional Generation

<table> <tr> <td><img src="./pictures/blue.png" style="width:100%;"></td> <td><img src="./pictures/red.png" style="width:100%;"></td> <td><img src="./pictures/yellow.png" style="width:100%;"></td> </tr> <tr> <td><img src="./pictures/inpaintingbottleblue.png" style="width:100%;"></td> <td><img src="./pictures/inpaintingbottlered.png" style="width:100%;"></td> <td><img src="./pictures/inpaintingbottleyellow.png" style="width:100%;"></td> </tr> <tr> <td><img src="./pictures/inpaintingbagblue.png" style="width:100%;"></td> <td><img src="./pictures/inpaintingbagred.png" style="width:100%;"></td> <td><img src="./pictures/inpaintingbagyellow.png" style="width:100%;"></td> </tr> <tr> <td><img src="./pictures/inpaintingbackpackblue.png" style="width:100%;"></td> <td><img src="./pictures/inpaintingbackpackred.png" style="width:100%;"></td> <td><img src="./pictures/inpaintingbackpackyellow.png" style="width:100%;"></td> </tr> </table>

python
import torch
import numpy as np
from PIL import Image
from diffusers.utils import load_image
from diffusers import FluxInpaintPipeline

prompt = "[COLOR_PALETTE] This two-part image showcases the transformation from a color palette to a image. \
          [LEFT] a color palette with five different colors. \
          [RIGHT] an intricately designed perfume bottle resting on a vintage carved dressing table, flanked by elegant makeup and jewelry, with a gilded mirror above and a vase of peonies adding a romantic ambiance, all depicted in a refined vintage style."

pipe_inpainting = FluxInpaintPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16).to("cuda")
pipe_inpainting.load_lora_weights("./color_palette_lora.safetensors")
mask = load_image("./mask.jpg").resize(size=(768, 512))
color_palette = load_image("./blue.png")
input_image = Image.new('RGB', (768, 512))
input_image.paste(color_palette.resize(size=(256, 512)), (0, 256))
input_image.paste(color_palette.resize(size=(512, 512)), (512, 256))
out = pipe_inpainting(prompt=prompt, image=color_palette, mask_image=mask, guidance_scale=3.5, height=768, width=512, num_inference_steps=50, max_sequence_length=256, strength=1).images[0]
out.save("conda_color_palette.png")

Model description

The model follows the idea of IC-Lora, image splicing is used for training and inferencing. The IC-Lora prompt template is like this👇

[COLOR_PALETTE] This two-part image showcases the transformation from a color palette to a image. [LEFT] a color palette with five different colors.  [RIGHT] xxxxx

Training

Training was done using https://github.com/XLabs-AI/x-flux