jclyo1 commited on
Commit
e1da8ff
1 Parent(s): 973c655

model version fix

Browse files
Files changed (2) hide show
  1. main.py +9 -1
  2. static/index.html +3 -3
main.py CHANGED
@@ -21,6 +21,10 @@ app = FastAPI()
21
  def generate_image(prompt, model):
22
  torch.cuda.empty_cache()
23
 
 
 
 
 
24
  pipeline = StableDiffusionPipeline.from_pretrained(
25
  str(model), torch_dtype=torch.float16
26
  )
@@ -36,7 +40,11 @@ def generate_image(prompt, model):
36
  "assertions": [
37
  {
38
  "label": "com.truepic.custom.ai",
39
- "data": {"model_name": model, "model_version": "1.0", "prompt": prompt},
 
 
 
 
40
  }
41
  ]
42
  }
 
21
  def generate_image(prompt, model):
22
  torch.cuda.empty_cache()
23
 
24
+ modelArray = model.split(",")
25
+ modelName = modelArray[0]
26
+ modelVersion = modelArray[1]
27
+
28
  pipeline = StableDiffusionPipeline.from_pretrained(
29
  str(model), torch_dtype=torch.float16
30
  )
 
40
  "assertions": [
41
  {
42
  "label": "com.truepic.custom.ai",
43
+ "data": {
44
+ "model_name": modelName,
45
+ "model_version": modelVersion,
46
+ "prompt": prompt,
47
+ },
48
  }
49
  ]
50
  }
static/index.html CHANGED
@@ -140,13 +140,13 @@
140
  <div class="custom-select">
141
  <select id="model">
142
  <option disabled selected value>Select</option>
143
- <option value="runwayml/stable-diffusion-v1-5">
144
  runwayml/stable-diffusion-v1-5
145
  </option>
146
- <option value="CompVis/stable-diffusion-v1-4">
147
  CompVis/stable-diffusion-v1-4
148
  </option>
149
- <option value="stabilityai/stable-diffusion-2-1">
150
  stabilityai/stable-diffusion-2-1
151
  </option>
152
  </select>
 
140
  <div class="custom-select">
141
  <select id="model">
142
  <option disabled selected value>Select</option>
143
+ <option value="runwayml/stable-diffusion-v1-5,1.5">
144
  runwayml/stable-diffusion-v1-5
145
  </option>
146
+ <option value="CompVis/stable-diffusion-v1-4,1.4">
147
  CompVis/stable-diffusion-v1-4
148
  </option>
149
+ <option value="stabilityai/stable-diffusion-2-1,2.1">
150
  stabilityai/stable-diffusion-2-1
151
  </option>
152
  </select>