Skip to content

Commit

Permalink
refine
Browse files Browse the repository at this point in the history
  • Loading branch information
ccssu committed Jul 8, 2024
1 parent ab5ad37 commit e33a07f
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
6 changes: 6 additions & 0 deletions onediff_comfy_nodes/benchmarks/scripts/run_oneflow_case_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,9 @@ python3 scripts/text_to_image.py \
-w $WORKFLOW_DIR/ComfyUI_IPAdapter_plus/ipadapter_advanced.json \
--baseline-dir $STANDARD_OUTPUT/test_ipa
# --output-images \

python3 scripts/text_to_image.py \
--comfy-port $COMFY_PORT \
-w $WORKFLOW_DIR/txt2img.json \
--ssim-threshold 0.7 \
--baseline-dir $STANDARD_OUTPUT/txt2img/imgs # --output-images
30 changes: 30 additions & 0 deletions onediff_comfy_nodes/benchmarks/src/input_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@
WORKFLOW_DIR = "resources/workflows"
FACE_IMAGE_DIR = "/share_nfs/hf_models/comfyui_resources/input/faces"
POSE_IMAGE_DIR = "/share_nfs/hf_models/comfyui_resources/input/poses"
SDXL_MODELS = [
"Juggernaut-XL_v9_RunDiffusionPhoto_v2.safetensors",
"Pony_Realism.safetensors",
"sdxl/dreamshaperXL_v21TurboDPMSDE.safetensors",
]
SD1_5_MODELS = [
"sd15/020.realisticVisionV51_v51VAE.safetensors",
"sd15/majicmixRealistic_v7.safetensors",
"sd15/v1-5-pruned-emaonly.ckpt",
"sd15/helloyoung25d_V10f.safetensors",
"sd15/RealCartoonSpecialPruned.safetensors",
]


class InputParams(NamedTuple):
graph: ComfyGraph
Expand Down Expand Up @@ -46,6 +59,23 @@ def _(workflow_path, *args, **kwargs):
yield InputParams(graph=graph)


@register_generator(
[f"{WORKFLOW_DIR}/baseline/txt2img.json", f"{WORKFLOW_DIR}/oneflow/txt2img.json"]
)
def _(workflow_path, *args, **kwargs):
with open(workflow_path, "r") as fp:
workflow = json.load(fp)
graph = ComfyGraph(graph=workflow, sampler_nodes=["3"])
for sdxl_model in SDXL_MODELS:
graph.set_image_size(height=1024, width=1024)
graph.graph["31"]["inputs"]["ckpt_name"] = sdxl_model
yield InputParams(graph)
for sd1_5_model in SD1_5_MODELS:
graph.set_image_size(height=768, width=512)
graph.graph["31"]["inputs"]["ckpt_name"] = sd1_5_model
yield InputParams(graph)


SD3_WORKFLOWS = [
f"{WORKFLOW_DIR}/baseline/sd3_baseline.json",
f"{WORKFLOW_DIR}/nexfort/sd3_unet_speedup.json",
Expand Down

0 comments on commit e33a07f

Please sign in to comment.