CarstenF commited on
Commit
81581a5
·
1 Parent(s): 9d99333
Files changed (1) hide show
  1. app.py +21 -24
app.py CHANGED
@@ -11,31 +11,28 @@ DEPLOYMENT_URIS = {
11
 
12
 
13
  def generate_image(model_selection, lora_scale, guidance_scale, prompt_strength, num_steps, prompt):
14
- # deployment_uri = DEPLOYMENT_URIS[model_selection]
15
- # deployment = replicate.deployments.get(deployment_uri)
16
- #
17
- # prediction = deployment.predictions.create(
18
- # input={
19
- # "model": "dev",
20
- # "lora_scale": lora_scale,
21
- # "num_outputs": 1,
22
- # "aspect_ratio": "1:1",
23
- # "output_format": "webp",
24
- # "guidance_scale": guidance_scale,
25
- # "output_quality": 90,
26
- # "prompt_strength": prompt_strength,
27
- # "extra_lora_scale": 1,
28
- # "num_inference_steps": num_steps,
29
- # "prompt": prompt
30
- # }
31
- # )
32
-
33
- # prediction.wait()
34
- # output = prediction.output
35
- # image_url = output[0] if output else None
36
 
37
- time.sleep(20)
38
- image_url = "https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fi1.sndcdn.com%2Fartworks-000207677710-z7mg8u-t500x500.jpg&f=1&nofb=1&ipt=54d62f19e1816c166bec632275277c4118a940853b2cd93d1c673ea487d9dfee&ipo=images"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
 
40
  return image_url
41
 
 
11
 
12
 
13
  def generate_image(model_selection, lora_scale, guidance_scale, prompt_strength, num_steps, prompt):
14
+ deployment_uri = DEPLOYMENT_URIS[model_selection]
15
+ deployment = replicate.deployments.get(deployment_uri)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
 
17
+ prediction = deployment.predictions.create(
18
+ input={
19
+ "model": "dev",
20
+ "lora_scale": lora_scale,
21
+ "num_outputs": 1,
22
+ "aspect_ratio": "1:1",
23
+ "output_format": "webp",
24
+ "guidance_scale": guidance_scale,
25
+ "output_quality": 90,
26
+ "prompt_strength": prompt_strength,
27
+ "extra_lora_scale": 1,
28
+ "num_inference_steps": num_steps,
29
+ "prompt": prompt
30
+ }
31
+ )
32
+
33
+ prediction.wait()
34
+ output = prediction.output
35
+ image_url = output[0] if output else None
36
 
37
  return image_url
38