DEV Community

AI-KSK
AI-KSK

Posted on

MOSS-Image Restoration + FLUX 3 Klein 4K in ComfyUI: One Complete AI-KSK Workflow

MOSS-Image Restoration + FLUX 3 Klein 4K in ComfyUI: An AI-KSK Workflow Walkthrough

An AI image-restoration workflow can do more than feed a photograph into a generic upscaler. Sometimes the goal is to reconstruct a reference image's composition and style—its people, typography, lighting, and spatial arrangement—using a new generative pass, and only then create a higher-resolution version. That is the design behind AI-KSK's video 325 workflow: MOSS-Image-SFT → optional FLUX 3 Image Klein reconstruction at a 3840-pixel longest side, with Gemini-powered visual description in both stages.

This tutorial is based on the creator's subtitle transcript and an inspection of the actual supplied ComfyUI graph (洗图最终 (4).json: 35 nodes, 43 serialized links), not an independent execution, benchmark, or review of the original video stream. The promotional cover is illustrative; it is not a verified before/after measurement. You receive one workflow, not separate MOSS and FLUX workflow files.

Start here: the workflow and the complete video

Run or inspect the creator's online workflow on RunningHub: MOSS-Image Wash/Rebuild — AI-KSK. The URL includes the creator's invitation code and may support the creator. RunningHub access, included nodes, charges, and current runtime availability are subject to the platform.

Full video lesson: AI-KSK video 325 on YouTube. Bilibili lesson is also available. The downloadable project contains the unmodified workflow JSON and its original 3:4 promotional cover; it does not contain the source reference image, generated results, model weights, or hosted-service credentials.

1. What “image washing” means here—and what it does not

In this workflow, “washing” describes image-to-image reconstruction driven by image analysis, not lossless repair. Gemini 3.1 Flash-Lite receives a preprocessed source image and produces a caption or a coordinate-based MOSS JSON Layout. The resulting text conditions MOSS-Image-SFT. The input image is also encoded into the MOSS latent space, but the MOSS sampler uses denoise=1.0: this is a complete generative denoising pass rather than a conservative pixel-perfect restoration. Treat it as reference-led regeneration, not an exact photographic clone.

MOSS-Image-SFT is the supervised fine-tuned MOSS-Image model, based on a 5-billion-parameter image-generation backbone. The OpenMOSS documentation describes natural-language prompting and structured layouts for spatial and text placement. In this project the input dimensions are read after preprocessing so the LLM can work with the relevant coordinate canvas, reducing—not eliminating—layout mismatch. https://huggingface.co/OpenMOSS-Team/MOSS-Image-SFT

The second pass is a different task: RealESRGAN first scales the MOSS result; ImageScaleToMaxDimension sets the longest edge to 3840, and FLUX 3 Image Klein then reconstructs the upscaled reference using another visual caption. 3840 on the longest side is not a promise of exactly 3840×2160, nor evidence of recovered lost real-world details. The final image is generative and may change tiny text, faces, objects, or logos.

2. The actual pipeline, node by node

The uploaded graph has 35 nodes and five functional stages:

LoadImage (source JPG not included)
  -> ImageScaleToTotalPixels (lanczos, 1 MP, resolution_steps=16)
  -> GetImageSize -> StringFormat (width, height, mode)
  -> RHLLMChatNode (Gemini 3.1 Flash-Lite preview)
  -> CLIPTextEncode (MOSS positive condition)
  -> MOSS-SFT KSampler -> VAEDecode -> SaveImage (MOSS output)
     |                  ^
     +-> VAEEncode -----+  (source image encoded; denoise=1.0)
     |
     +-> second RHLLMChatNode (caption of MOSS output)
     +-> RealESRGAN_x4plus -> longest edge 3840
         -> ReferenceMultiLatent + FLUX 3 Klein conditioning
         -> FLUX KSampler -> VAEDecode -> SaveImage (4K-labeled output)
Enter fullscreen mode Exit fullscreen mode

The graph also contains preview nodes, an easy showAnything text viewer, and a rgthree Image Comparer comparing the MOSS-stage and FLUX-stage images. The creator's video introduces an updated Midjourney-style MOSS LoRA as an optional idea; this particular supplied JSON contains no LoRA loader or LoRA application node. Do not advertise that LoRA as active in the downloadable graph.

Stage A — input normalization

Load your own image into LoadImage (node 272). The saved node points to a machine-specific JPG filename that is not included in the project. ImageScaleToTotalPixels (node 244) uses lanczos, megapixels=1 and resolution_steps=16. The preprocessed image is used for the reconstruction input, the vision call, and the measured dimensions. GetImageSize (254) provides the current width and height to StringFormat (255); these values are not manually locked to a fixed portrait/landscape shape.

The prompt asks Gemini to preserve observable subject count, spatial relationships, original visual medium, lighting and legible words. It expressly requests no user-side modification. This is a helpful default for rebuilding an existing composition; it is not a guarantee that text or faces will be exact.

Stage B — Gemini caption or MOSS JSON Layout

PrimitiveBoolean (271) controls format. In the actual supplied file, it is True: JSON Layout is enabled. This contradicts an older embedded Markdown note claiming the default is off. False requests an English scene caption; True requests JSON with summary, items, bbox_coord_space="abs_centralized" and bbox_format="yxyx". Item boxes are center-origin pixel coordinates [y_min, x_min, y_max, x_max], calculated against the measured target width/height. A structured prompt helps reason about placement, but the graph does not show a separate programmatic JSON validator.

The node is RHLLMChatNode (276), with model identifier google/gemini-3.1-flash-lite-preview, temperature 0.2, maximum tokens 4096, top-p 0.9, and fixed seed 9527. Its response goes to the MOSS text encoder and the easy showAnything viewer. The model identifier and service integration are as serialized, not a promise that the same endpoint is accessible through arbitrary local Gemini credentials. Image content is treated as data rather than instructions in its built-in system prompt.

Stage C — MOSS-Image-SFT regeneration

The actual loaders and sampler settings are:

Component Saved value
Diffusion model moss_image_sft_int8_convrot.safetensors
Text encoder qwen3.5_9b_bf16.safetensors, CLIP type moss_image
VAE flux2-vae.safetensors
Skip-layer guidance SkipLayerGuidanceDiTSimple, single layer 22, start 0, end 1
Sampling KSampler, seed 9527 fixed, 20 steps, CFG 3, euler, sgm_uniform, denoise 1.0
Negative text nsfw, worst quality, bad anatomy, watermark, jpeg artifact
Original-size-stage output prefix AIKSK_MOSS_03_SINGLE

The source image reaches VAEEncode, providing the latent input. The text/JSON response supplies positive conditioning; the encoded source is not the same as adding a separate MOSS image-vision conditioning node. The embedded project note mentions a “Vision route,” but TextEncodeMOSSImageVision does not exist in this actual 35-node graph. This is the standard-VAE version, not a separate vision-conditioned workflow.

The OpenMOSS model card documents a 50-step / CFG 3 reference example with layer-22 skipping. Twenty steps is this creator's saved configuration, not an official guarantee of equivalent fidelity. The creator describes personal experiments down to 20 steps in the supplied subtitles; the package provides no reproduced performance numbers. https://huggingface.co/OpenMOSS-Team/MOSS-Image-SFT

Stage D — optional RealESRGAN → FLUX 3 Image Klein reconstruction

The MOSS decoded result is reused, not a new upload. ImageUpscaleWithModel uses RealESRGAN_x4plus.pth; ImageScaleToMaxDimension (264) then sets lanczos, largest_size=3840. A second RHLLMChatNode (268) looks at the MOSS output, not the initial input image, and writes a grounded full-scene caption emphasizing plausible material and detail improvements without deliberate composition changes. Saved settings: google/gemini-3.1-flash-lite-preview, temperature 0.1, max tokens 3200, top-p 1, seed 9527.

The FLUX stage is:

Component Saved value
Diffusion model flux3_image_klein_sd_int8_convrot.safetensors
Text encoder qwen3vl_4b_int8_convrot.safetensors, CLIP type flux3
VAE flux2-vae.safetensors
Reference composition ReferenceMultiLatent, resolution="keep resolution", one input image
Sampling KSampler, seed 9527 fixed, 16 steps, CFG 1, euler, simple scheduler, denoise 1.0
High-resolution output prefix AIKSK_MOSS_03_4K

Black Forest Labs identifies the 16-step distilled FLUX 3 Image Klein as a text/image editing and multi-reference model; the vendor's license terms are distinct from MOSS-Image's terms. https://bfl.ai/blog/flux-3-image-klein The subtitle says “Euler + Beta” for this stage; the actual saved JSON is Euler + simple, which is what this tutorial reports. The saved graph has the right-hand FLUX section enabled; it is optional by selectively disabling that stage, not because it ships switched off.

3. Run it on RunningHub

  1. Open the AI-KSK RunningHub workflow. The link points to the creator's published workflow; check available execution permissions and any applicable charges on the service.
  2. Supply an image you own or have permission to transform. Start with an image where subject count and text are easy to inspect. Do not rely on the JPG path embedded in the author's JSON.
  3. Locate PrimitiveBoolean. Keep True if you want Gemini to return a spatial JSON Layout; switch to False for a prose caption. Both settings still invoke an LLM; the switch does not bypass the vision-model call.
  4. Check the loaded MOSS checkpoint, Qwen text encoder, VAE and two Gemini nodes. If you want only the first-stage result, disable the entire FLUX reconstruction group, including its LLM and output nodes; do not indiscriminately bypass model loaders.
  5. Queue the graph. The MOSS stage saves AIKSK_MOSS_03_SINGLE; the optional FLUX stage saves AIKSK_MOSS_03_4K. Use Image Comparer to inspect differences, including changed lettering, face structure, edges, and objects.

The accompanying subtitles show the creator using RunningHub and describe the workflow as published there. This write-up did not run a new job on that service, so current job availability, API credits and completion behavior should be checked by the operator.

4. Install locally: file locations and portability

ComfyUI can load the unmodified JSON through its workflow import function, but local execution is not simply a matter of copying a 54-KB JSON. The saved graph references third-party model files and two RHLLMChatNode calls. These require a compatible runtime, available checkpoints and an authorized LLM backend.

Install compatible model files under the normal ComfyUI model directories (model availability and compatibility must be checked in each installation):

ComfyUI/models/diffusion_models/
  moss_image_sft_int8_convrot.safetensors
  flux3_image_klein_sd_int8_convrot.safetensors
ComfyUI/models/text_encoders/
  qwen3.5_9b_bf16.safetensors
  qwen3vl_4b_int8_convrot.safetensors
ComfyUI/models/vae/
  flux2-vae.safetensors
ComfyUI/models/upscale_models/
  RealESRGAN_x4plus.pth
Enter fullscreen mode Exit fullscreen mode

These are required filenames from the JSON, not embedded files, verified download links, or a universal recommendation for memory capacity. For official upstream information, see MOSS-Image, MOSS SFT weights, and FLUX 3 Image Klein. The submitted file requires RHLLMChatNode, the easy showAnything display node (Easy-Use) and Image Comparer (rgthree) (rgthree); also confirm the availability of GetImageSize, PrimitiveBoolean, StringFormat, ImageScaleToMaxDimension, ReferenceMultiLatent, and MOSS/FLUX loader choices in your exact ComfyUI build. Do not substitute arbitrary “similar” node implementations without testing the graph.

The RunningHub-specific Gemini node may be unavailable outside that service. Replacing it with a local/API LLM requires rewiring the workflow, verifying image input/output text interfaces, and checking the JSON layout schema. Such a conversion is not included in the distributed original JSON. The workflow also contains a serialized input JPG name absent from this package; re-upload your own image. Each LLM stage may incur provider costs when activated.

5. A sensible comparison and quality-control procedure

Keep the original image, the MOSS stage and the FLUX stage side by side. Look at (a) main subjects and counts, (b) framing and cropping, (c) readable Chinese/English text, (d) small accessories, (e) visual style, (f) watermarks and marks, and (g) hallucinated detail. Compare MOSS-only against FLUX-enabled before deciding whether the more expensive second stage is worthwhile for your subject. A larger output is not necessarily a more faithful output.

The workflow prompt requests reproduction of clearly visible text, which can include watermark-like markings. Do not treat reproducing or obscuring another person's watermark as proof of ownership or authorize use of protected materials. Use sources you may legally edit and publish. If exact text is mission-critical, verify it manually or use a layout/typography stage after generation.

Known limitations and evidence boundary: The uploaded ZIP contains one ComfyUI JSON and one promotional cover only. It contains no sample JPG, no model weights, no generated image exports, no GPU logs, no latency tables, and no complete local/GPU acceptance report. The serialized metadata itself says static_only_no_GPU_or_target_object_info_validation; static inspection is not successful execution. No measured speed, VRAM requirement, quality ranking, or guaranteed 4K outcome is claimed here.

6. Which part should you use?

Use MOSS only when you need a new image built around the reference's content, text arrangement and visual style, and you are willing to inspect changes. Enable FLUX reconstruction when you also want a large-edge output with a second generative refinement pass, accepting extra model loads, a second LLM call, processing time, and fidelity risk. Set JSON Layout when spatial structure matters; choose caption mode when the source does not need rigid region descriptions or the JSON parser behavior becomes fragile.

This is a practical example of composing a vision-capable description service, a generative image model and a reference-guided enhancer in one graph. The most important operator skill is not a secret sampling preset: it is checking what was actually preserved after each stage.

Resources and credits

AI-KSK distributes the supplied workflow configuration and cover, not the model weights. MOSS SFT and FLUX 3 Klein have different upstream license terms; the workflow package does not override either model's license. Credit: AI-KSK / KSK, video 325.

Workflow access and downloads

Workflow RunningHub Civitai
MOSS-Image Wash + FLUX 3 Klein 4K RunningHub Workflow

Collection downloads: Hugging Face · ModelScope.

Top comments (0)