Run this model with HF Jobs

Run woshin/FLUX.1-Canny-dev-redux on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/woshin/FLUX.1-Canny-dev-redux. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/woshin/FLUX.1-Canny-dev-redux on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Introduction

This model is fine-tuned based on black-forest-labs/FLUX.1-canny-dev.
The model enhances the performance when used with black-forest-labs/FLUX.1-Redux-dev.

Examples

shoe/clothe generate demo

shoe/clothe generate demo

texture generate demo

texture generate demo

finetuned vs original

finetuned vs original

Inference

import os
import torch
from diffusers import FluxPriorReduxPipeline, FluxPipeline, FluxControlPipeline, FluxTransformer2DModel
from diffusers.utils import load_image
from PIL import Image

pipe_prior_redux = FluxPriorReduxPipeline.from_pretrained(
  "black-forest-labs/FLUX.1-Redux-dev", 
  torch_dtype=torch.bfloat16).to("cuda")

pipe = FluxControlPipeline.from_pretrained(
  "black-forest-labs/FLUX.1-Canny-dev", 
  torch_dtype=torch.bfloat16
).to("cuda")

transformer = FluxTransformer2DModel.from_pretrained(
  "woshin/FLUX.1-Canny-dev-redux",
  subfolder="transformer",
  torch_dtype=torch.bfloat16
).to("cuda")

pipe.transformer = transformer


def inference_control_redux(style_image, control_image, save_image, size=(1024, 1024)):
  style_image = load_image(style_image).resize(size)
  control_image = load_image(control_image).resize(size)
  pipe_prior_redux_out = pipe_prior_redux(style_image, return_dict=False)
  prompt_embeds, pooled_prompt_embeds = pipe_prior_redux_out[0], pipe_prior_redux_out[1]
  image = pipe(
    control_image=control_image,
    height=size[1],
    width=size[0],
    num_inference_steps=50,
    guidance_scale=30.0,
    prompt_embeds=prompt_embeds,
    pooled_prompt_embeds=pooled_prompt_embeds,
  ).images[0]

  dst = Image.new('RGB', (size[0] * 3, size[1]))
  dst.paste(style_image, (0, 0))
  dst.paste(control_image, (size[0], 0))
  dst.paste(image, (size[0] * 2, 0))
  dst.save(save_image)

style_image = "style.png" # download from this repo
control_image = "control.png"
save_image = "save.png"
inference_control_redux(style_image, control_image, save_image)
Downloads last month
-
Safetensors
Model size
12B params
Tensor type
BF16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for woshin/FLUX.1-Canny-dev-redux

Finetuned
(3)
this model