File size: 648 Bytes
f205d49
 
 
 
ae143ff
f205d49
41b7f97
e01847c
 
 
f205d49
6a64212
f205d49
6a64212
f205d49
e01847c
6a64212
9f788a3
fe0eaf3
41b7f97
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import jax
import numpy as np
from flax.jax_utils import replicate
from flax.training.common_utils import shard
from diffusers import DiffusionPipeline

model_path = "sabman/map-diffuser-v3"
pipeline = DiffusionPipeline.from_pretrained(
    model_path,
    from_flax=True, safety_checker=None).to("cuda")

# prompt = "create a map with traffic signals, busway and residential buildings, in water color style"
def generate_images(prompt):

    prng_seed = jax.random.PRNGKey(-1)
    num_inference_steps = 20

    images = pipeline(prompt, width=512, num_inference_steps=num_inference_steps, num_images_per_prompt=1).images
    
    return images[0]