AmirMoris commited on
Commit
1e50263
·
1 Parent(s): 2209df5

fix: random seed

Browse files
Files changed (2) hide show
  1. .idea/workspace.xml +21 -20
  2. app.py +2 -2
.idea/workspace.xml CHANGED
@@ -31,26 +31,26 @@
31
  <option name="hideEmptyMiddlePackages" value="true" />
32
  <option name="showLibraryContents" value="true" />
33
  </component>
34
- <component name="PropertiesComponent"><![CDATA[{
35
- "keyToString": {
36
- "ASKED_ADD_EXTERNAL_FILES": "true",
37
- "Python.app.executor": "Run",
38
- "RunOnceActivity.OpenProjectViewOnStart": "true",
39
- "RunOnceActivity.ShowReadmeOnStart": "true",
40
- "git-widget-placeholder": "main",
41
- "kotlin-language-version-configured": "true",
42
- "last_opened_file_path": "C:/Users/Amir/anaconda3/envs/env",
43
- "node.js.detected.package.eslint": "true",
44
- "node.js.detected.package.tslint": "true",
45
- "node.js.selected.package.eslint": "(autodetect)",
46
- "node.js.selected.package.tslint": "(autodetect)",
47
- "nodejs_package_manager_path": "npm",
48
- "project.structure.last.edited": "Modules",
49
- "project.structure.proportion": "0.0",
50
- "project.structure.side.proportion": "0.0",
51
- "vue.rearranger.settings.migration": "true"
52
  }
53
- }]]></component>
54
  <component name="SharedIndexes">
55
  <attachedChunks>
56
  <set>
@@ -68,7 +68,8 @@
68
  <updated>1713919907805</updated>
69
  <workItem from="1713919910236" duration="1099000" />
70
  <workItem from="1713921043559" duration="495000" />
71
- <workItem from="1714055653743" duration="1934000" />
 
72
  </task>
73
  <servers />
74
  </component>
 
31
  <option name="hideEmptyMiddlePackages" value="true" />
32
  <option name="showLibraryContents" value="true" />
33
  </component>
34
+ <component name="PropertiesComponent">{
35
+ &quot;keyToString&quot;: {
36
+ &quot;ASKED_ADD_EXTERNAL_FILES&quot;: &quot;true&quot;,
37
+ &quot;Python.app.executor&quot;: &quot;Run&quot;,
38
+ &quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
39
+ &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
40
+ &quot;git-widget-placeholder&quot;: &quot;main&quot;,
41
+ &quot;kotlin-language-version-configured&quot;: &quot;true&quot;,
42
+ &quot;last_opened_file_path&quot;: &quot;C:/Users/Amir/anaconda3/envs/env&quot;,
43
+ &quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
44
+ &quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
45
+ &quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
46
+ &quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
47
+ &quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
48
+ &quot;project.structure.last.edited&quot;: &quot;Modules&quot;,
49
+ &quot;project.structure.proportion&quot;: &quot;0.0&quot;,
50
+ &quot;project.structure.side.proportion&quot;: &quot;0.0&quot;,
51
+ &quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
52
  }
53
+ }</component>
54
  <component name="SharedIndexes">
55
  <attachedChunks>
56
  <set>
 
68
  <updated>1713919907805</updated>
69
  <workItem from="1713919910236" duration="1099000" />
70
  <workItem from="1713921043559" duration="495000" />
71
+ <workItem from="1714055653743" duration="2106000" />
72
+ <workItem from="1714065328028" duration="48000" />
73
  </task>
74
  <servers />
75
  </component>
app.py CHANGED
@@ -46,7 +46,7 @@ def generate_button_clicked(*args):
46
  values[key] = DEFAULT_VALUES[key]
47
 
48
  if values["randomize_seed"]:
49
- values["randomize_seed"] = random.randint(1, 100000)
50
 
51
  if values["randomize_cfg"]:
52
  values["text_cfg_scale"] = round(random.uniform(6.0, 9.0), ndigits=2)
@@ -64,7 +64,7 @@ def generate_button_clicked(*args):
64
  if input_image is None:
65
  raise gr.Error("Missing Input: input_image")
66
  if len(edit_instruction) == 0:
67
- raise gr.Error("Missing Input: edit_instruction")
68
 
69
  GoogleDrive_connection_Path = ""
70
  # GoogleDrive_connection_Path = "service_account.json"
 
46
  values[key] = DEFAULT_VALUES[key]
47
 
48
  if values["randomize_seed"]:
49
+ values["seed"] = random.randint(1, 100000)
50
 
51
  if values["randomize_cfg"]:
52
  values["text_cfg_scale"] = round(random.uniform(6.0, 9.0), ndigits=2)
 
64
  if input_image is None:
65
  raise gr.Error("Missing Input: input_image")
66
  if len(edit_instruction) == 0:
67
+ return input_image
68
 
69
  GoogleDrive_connection_Path = ""
70
  # GoogleDrive_connection_Path = "service_account.json"