Run this model with HF Jobs

Run OzzyGT/jeveration_custom_blocks 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/OzzyGT/jeveration_custom_blocks. 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/OzzyGT/jeveration_custom_blocks 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.
jeveration_custom_blocks / modular_blocks_jeveration.py
OzzyGT's picture
OzzyGT HF Staff
use modular model index
a8b3b33
Raw History Blame Contribute Delete
3.97 kB
# Copyright 2026 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0. See the LICENSE file in this repository.
from diffusers.modular_pipelines import AutoPipelineBlocks, ModularPipeline, SequentialPipelineBlocks
from diffusers.modular_pipelines.modular_pipeline_utils import InsertableDict, OutputParam
# The remote-code loader only copies modules the entry module imports, so every module of this repository is named
# here, including the ones only imported by others.
from .components import JEVERATION_WEIGHTS_REPO
from .decide import JeverationDecideStep
from .decoders import JeverationDecodeStep, JeverationDensePostprocessStep, JeverationSourceDecodeStep
from .dense import JeverationDensePredictStep
from .encoders import JeverationDenseInputStep, JeverationImageInputStep, JeverationTextInputStep
from .image_decoder_jeveration import JeverationImageDecoder # noqa: F401
from .prompts_jeveration import NYU13 # noqa: F401
from .transformer_jeveration import JeverationTransformer # noqa: F401
class JeverationText2ImageBlocks(SequentialPipelineBlocks):
model_name = "jeveration"
block_classes = [JeverationTextInputStep(), JeverationDecideStep(), JeverationDecodeStep()]
block_names = ["text_input", "decide", "decode"]
@property
def description(self) -> str:
return "Text-to-image: one forward pass decides the 128 codes of a 512 x 512 image, then the decoder draws it."
@property
def outputs(self):
return [OutputParam("images", description="The generated images.")]
class JeverationImage2ImageBlocks(SequentialPipelineBlocks):
model_name = "jeveration"
block_classes = [JeverationImageInputStep(), JeverationDecideStep(), JeverationSourceDecodeStep()]
block_names = ["image_input", "decide", "decode"]
@property
def description(self) -> str:
return (
"Image-to-image with one of the six trained tasks: edge map or depth map to image (`hed`, `depth`), "
"`colorize`, or the `anime`, `ghibli` and `watercolor` styles."
)
@property
def outputs(self):
return [OutputParam("images", description="The generated images.")]
class JeverationDenseBlocks(SequentialPipelineBlocks):
model_name = "jeveration"
block_classes = [JeverationDenseInputStep(), JeverationDensePredictStep(), JeverationDensePostprocessStep()]
block_names = ["dense_input", "predict", "postprocess"]
@property
def description(self) -> str:
return "Dense prediction: indoor segmentation, depth and surface normals of a picture."
@property
def outputs(self):
return [
OutputParam("predictions", description="Task -> the predicted maps."),
OutputParam("prediction_images", description="Task -> pictures of the predictions."),
]
JeverationBlocksDict = InsertableDict(
[
("dense", JeverationDenseBlocks()),
("image2image", JeverationImage2ImageBlocks()),
("text2image", JeverationText2ImageBlocks()),
]
)
class JeverationBlocks(AutoPipelineBlocks):
"""Jeveration: text-to-image, image-to-image and dense prediction, each in one forward pass of one model."""
model_name = "jeveration"
_requirements = {"diffusers": ">=0.41.0", "transformers": ">=5.14.0", "ftfy": ">=6.0"}
block_classes = list(JeverationBlocksDict.values())
block_names = list(JeverationBlocksDict.keys())
block_trigger_inputs = ["dense_tasks", "image", None]
def __init__(self):
super().__init__()
try:
ModularPipeline.load_config(JEVERATION_WEIGHTS_REPO)
except OSError:
pass
@property
def description(self) -> str:
return (
"Jeveration, a Qwen3.5-4B fine-tuned to answer in one forward pass. Pass `prompt` for "
"text-to-image, `image` (+ `task`) for image-to-image, `image` + `dense_tasks` for dense prediction."
)