Views
No views yet
nitrosocke/Ghibli-Diffusion] and compiled on Inf2 neuronx devices with 🤗 optimum-neuron.



1from optimum.neuron import NeuronStableDiffusionPipeline
2
3model_id = "nitrosocke/Ghibli-Diffusion"
4input_shapes = {"batch_size": 1, "height": 512, "width": 512}
5compiler_args = {"auto_cast": "matmul", "auto_cast_type": "bf16"}
6
7pipe = NeuronStableDiffusionPipeline.from_pretrained(
8 model_id, export=True, dynamic_batch_size=False, **input_shapes, **compiler_args, device_ids=[0, 1]
9)
10pipe = pipe.to("cuda")
11
12prompt = "ghibli style magical princess with golden hair"
13image = pipe(prompt).images[0]
14
15image.save("./magical_princess.png")