in Stable-Diffusion-Vertex/pipeline/pipeline.py [0:0]
def pipeline(build_image : bool,
):
from datetime import datetime
current = datetime.now()
current_str = current.strftime("%Y-%m-%d-%H-%M")
with Condition(build_image == "True", "image_build_enable"):
preprocess_task = image_build(project_id=PROJECT_ID, region=REGION, source_code_path=CODE_INPUT_DIR, image_uri=IMAGE_URI)
training_job_run_op = CustomTrainingJobOp(
project=preprocess_task.outputs["project_id"],
network="projects/153260248093/global/networks/default",
display_name=f"sd-model-training-{current_str}",
worker_pool_specs=job_spec,
)
with Condition(build_image == "False", "image_build_disable"):
training_job_run_op = CustomTrainingJobOp(
project=PROJECT_ID,
display_name=f"sd-model-training-{current_str}",
network="projects/153260248093/global/networks/default",
worker_pool_specs=job_spec,
)