Go to OpenArt main site
Upload workflow

Powder - A text-to-image workflow for better skin in high Flux guidance images

5.0

0 reviews
4
932
297
0
Description

Powder is a single-pass text-to-image workflow for Flux.1 [dev] based checkpoints. It is designed for photorealistic portraits that require high Flux guidance (3.5 or above) for the overall image. It aims to improve skin contrast and detail, avoiding the shiny, waxy, smoothed look.

High Flux guidance is required for good prompt adherence, image composition, colour saturation and close likeness with character Loras. Lower Flux guidance (1.7 to 2.2) improves skin contrast and detail but loses the mentioned benefits of high guidance for the overall image. Powder uses masked conditioning with varied Flux guidance according to a 3 phase schedule. It also uses masked noise injection to add skin blemishes. It can be run completely automatically, though there is a recommended optional step to manually edit the skin mask. Powder can be used with any Loras and controlnets that work with a standard KSampler, but it does not work with Flux.1 [schnell].

Powder uses an Ultralytics detector for skin image segments. Install the detector model using ComfyUI Manager > Model Manager and search for skin_yolov8n-seg_800.pt

Image inference uses a KSampler as usual, but the scheduled steps are split into 3 phases:

  • Phase 1: Each KSampler step uses a single (high) Flux guidance value for the whole image.
  • Phase 2: Latent noise is injected into the masked region. Then, inference proceeds like in Phase 1, except for a different (lower) Flux guidance value used for the masked region.
  • Phase 3: Similar to Phase 2, but using different settings for the injected noise and Flux guidance value applied to the masked region.

At the end of Phase 1, the workflow pauses. Right-click on the image in "Edit skin mask" and select "Open in MaskEditor". The image will be fuzzy because it is not fully resolved, but its composition should be apparent. A rough mask will have been automatically generated. The mask should cover skin only; ensure hair, eyes, lips, teeth, nails and jewellery are not masked. Make any corrections to the mask and click "Save to node". Queue another generation, and the workflow will complete the remaining phases.

To make a new image, click "New Fixed Random" in the "Seed - All phases" node before queueing another generation.

Tips:

  • "Schedule steps" is the total number of steps used for all phases. This should be at least 40; I recommend 50.
  • "Phase 1 steps proportion" ranges from 0 to 1 and controls the number of steps in Phase 1. Higher numbers ensure the image composition more closely matches a hypothetical image generated purely using the Flux guidance value for Phase 1, but at the cost of fewer steps in Phases 2 and 3 to impact the masked region. 0.24 seems to work well; for 50 schedule steps this gives 0.24 * 50 = 12 steps for Phase 1.
  • "Flux guidance - Phase 1" should be at least 3.5 for good prompt adherence, well-formed composition of all objects in the image, aesthetic colour saturation and good likeness when using character Loras.
  • You may need to experiment with "Flux guidance (masked) - Phases 2/3" settings to work well with your choice of checkpoint and style Lora, if any.
  • Latent noise is added to the masked region at the start of Phases 2 and 3. The noise strengths can be adjusted in the "Inject noise - Phase 2/3" nodes to vary the level of skin blemishes added.
  • To skip mask editing and use the automatically generated mask each time, click on "block" in the "Edit skin mask" node to select "never".
  • Consider excluding fingers or fingertips from the mask, particularly small ones. Images of fingers and small objects at lower Flux guidance are often posed incorrectly or crumble into a chaotic mess.
  • Feel free to change the sampler and scheduler. I find deis / ddim_uniform works well, as it converges sufficiently for Phase 1.
  • After completing all phases to generate a final image, you may fine-tune the mask by pasting the final image into the "Preview Bridge - Phase 1" node. To do this, right-click on "Preview Image - Powder" (right of this node group) and select "Copy (Clipspace)". Then right-click on "Preview Bridge - Phase 1" and select "Paste (Clipspace)". Queue a generation for a mask to be automatically generated and edit the mask as before. Then, queue another generation to restart the process from Phase 2.
  • Images should be larger than 1 megapixels in area for good results. I often use 1.6 megapixels.
  • Consider using a finetuned checkpoint. I find Acorn is Spinning gives good realistic results. https://civitai.com/models/673188?modelVersionId=757421
  • - Use Powder as a first step in a larger workflow. Powder is not designed to generate final completed images.
  • - Not every image can be improved satisfactorily. Sometimes a base image will be so saturated or lacking detail that it cannot be salvaged. Just reroll and try again!

I hope you find Powder useful!

- Steffan Westcott

Discussion

(No comments yet)

Loading...

Author

1
297
4
935

No reviews yet

  • - latest (21 hours ago)

Primitive Nodes (34)

CLIPTextEncodeFlux (1)

Context Big (rgthree) (5)

FluxGuidance (5)

Image Comparer (rgthree) (2)

InjectLatentNoise+ (2)

Lora Loader Stack (rgthree) (1)

Note (3)

Reroute (9)

Seed (rgthree) (1)

SimpleMathDual+ (1)

SimpleMathFloat+ (2)

SimpleMathInt+ (1)

UnetLoaderGGUF (1)

Custom Nodes (36)

ComfyUI

  • - SplitSigmas (2)

  • - InvertMask (1)

  • - DualCLIPLoader (1)

  • - KSamplerSelect (1)

  • - BasicScheduler (1)

  • - SamplerCustom (5)

  • - JoinImageWithAlpha (1)

  • - VAEDecode (4)

  • - ConditioningCombine (2)

  • - ConditioningSetMask (3)

  • - PreviewImage (1)

  • - VAELoader (1)

  • - EmptyLatentImage (1)

  • - CLIPTextEncode (1)

  • - UNETLoader (1)

ComfyUI Essentials

  • - SimpleMath+ (2)

  • - SegsToCombinedMask (1)

  • - SubtractMask (1)

  • - PreviewBridge (2)

  • - SegmDetectorCombined_v2 (1)

  • - ImpactSimpleDetectorSEGS (1)

  • - UltralyticsDetectorProvider (1)

  • - MediaPipeFaceMeshDetectorProvider //Inspire (1)

Checkpoints (0)

LoRAs (1)

marilyn-monroe-flux-m3r1l.safetensors