Download examples/hidream_o1_image/model_training/special/split_training/validate.py from ymyy307/diffsynth: direct link, hf CLI and curl.
- Browser
- Download file 776 Bytes
-
https://huggingface.co/ymyy307/diffsynth/resolve/main/examples/hidream_o1_image/model_training/special/split_training/validate.py
- Command line
-
hf download hf://ymyy307/diffsynth/examples/hidream_o1_image/model_training/special/split_training/validate.py
-
curl -L -o validate.py https://huggingface.co/ymyy307/diffsynth/resolve/main/examples/hidream_o1_image/model_training/special/split_training/validate.py
776 Bytes
| import torch | |
| from diffsynth.pipelines.hidream_o1_image import HiDreamO1ImagePipeline, ModelConfig | |
| pipe = HiDreamO1ImagePipeline.from_pretrained( | |
| torch_dtype=torch.bfloat16, | |
| device="cuda", | |
| model_configs=[ | |
| ModelConfig(model_id="HiDream-ai/HiDream-O1-Image", origin_file_pattern="model-*.safetensors"), | |
| ], | |
| processor_config=ModelConfig(model_id="HiDream-ai/HiDream-O1-Image", origin_file_pattern="./"), | |
| ) | |
| pipe.load_lora(pipe.dit, './models/train/HiDream-O1-Image_split/epoch-4.safetensors') | |
| image = pipe( | |
| prompt="dog,white and brown dog, sitting on wall, under pink flowers", | |
| negative_prompt=" ", | |
| cfg_scale=4.0, | |
| height=2048, | |
| width=2048, | |
| seed=42, | |
| num_inference_steps=50, | |
| ) | |
| image.save('split_training_HiDream-O1-Image.jpg') | |