File size: 670 Bytes
d5fb696
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import time
import replicate



start_time = time.time()
temp_image_path = "./image_temp/"

def preview_and_generate_image(image_subject ,sd_prompt):    
    
    output = replicate.run(
    "stability-ai/stable-diffusion-3",
    input={
        "cfg": 3.5,
        "steps": 28,
        "prompt": f"This is a {image_subject} it looks likes {sd_prompt} ",
        "aspect_ratio": "1:1",
        "output_format": "webp",
        "output_quality": 90,
        "negative_prompt": "",
        "prompt_strength": 0.85
    }
)
    print(output)
    image_url = output[0]  # Assume the first output is the image URL
    
    return image_url