|
import torch |
|
import kiui |
|
import numpy as np |
|
import argparse |
|
from pipeline_mvdream import MVDreamPipeline |
|
|
|
import ipdb |
|
pipe = MVDreamPipeline.from_pretrained( |
|
|
|
'/mnt/cfs/home/liweiyu/codes/3DNativeGeneration/ckpts/pretrained_weights/huggingface/hub/models--ashawkey--mvdream-sd2.1-diffusers/snapshots/503bb19fc2b2bc542c2afdb7d73ac87a7cbc2253', |
|
torch_dtype=torch.float16, |
|
|
|
) |
|
|
|
pipe = pipe.to("cuda") |
|
|
|
|
|
parser = argparse.ArgumentParser(description="MVDream") |
|
parser.add_argument("prompt", type=str, default="a cute owl 3d model") |
|
args = parser.parse_args() |
|
|
|
for i in range(5): |
|
image = pipe(args.prompt, guidance_scale=5, num_inference_steps=30, elevation=0) |
|
ipdb.set_trace() |
|
grid = np.concatenate( |
|
[ |
|
np.concatenate([image[0], image[2]], axis=0), |
|
np.concatenate([image[1], image[3]], axis=0), |
|
], |
|
axis=1, |
|
) |
|
|
|
kiui.write_image(f'test_mvdream_{i}.jpg', grid) |
|
|