Thafx commited on
Commit
ffe6452
1 Parent(s): fcc814c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +51 -51
app.py CHANGED
@@ -16,10 +16,10 @@ def get_prompts(prompt_text):
16
  else:
17
  return MagicPrompt('')
18
  logging.info('loading Dreamlike Diffusion')
19
- DreamDiffusion=App.Interface.load('models/SG161222/Realistic_Vision_V1.4') # Credits to SG161222
20
- logging.info('Loading Dreamlike PhotoReal')
21
- DreamPhotoReal = DreamDiffusion
22
- DreamPhotoReal=App.Interface.load('models/dreamlike-art/dreamlike-photoreal-2.0') # Credits to Dreamlike
23
 
24
  def RestartScript():
25
  while True:
@@ -95,45 +95,45 @@ def SendIt4(Inputs, NoiseLevel, DreamDiffusion=DreamDiffusion):
95
  logging.info('Done Creating Image On Thread 4')
96
  return Output4
97
 
98
- def SendIt5(Inputs, NoiseLevel, DreamDiffusion=DreamDiffusion):
99
- logging.info('Creating Image On Thread 5')
100
- NoisedPrompt = AddNoise(Inputs, NoiseLevel)
101
- while queue.qsize() >= queue_threshold:
102
- time.sleep(2)
103
- queue.put(NoisedPrompt)
104
- Output5 = DreamPhotoReal(NoisedPrompt)
105
- logging.info('Done Creating Image On Thread 5')
106
- return Output5
107
-
108
- def SendIt6(Inputs, NoiseLevel, DreamDiffusion=DreamDiffusion):
109
- logging.info('Creating Image On Thread 6')
110
- NoisedPrompt = AddNoise(Inputs, NoiseLevel)
111
- while queue.qsize() >= queue_threshold:
112
- time.sleep(2)
113
- queue.put(NoisedPrompt)
114
- Output6 = DreamPhotoReal(NoisedPrompt)
115
- logging.info('Done Creating Image On Thread 6')
116
- return Output6
117
-
118
- def SendIt7(Inputs, NoiseLevel, DreamDiffusion=DreamDiffusion):
119
- logging.info('Creating Image On Thread 7')
120
- NoisedPrompt = AddNoise(Inputs, NoiseLevel)
121
- while queue.qsize() >= queue_threshold:
122
- time.sleep(2)
123
- queue.put(NoisedPrompt)
124
- Output7 = DreamPhotoReal(NoisedPrompt)
125
- logging.info('Done Creating Image On Thread 7')
126
- return Output7
127
-
128
- def SendIt8(Inputs, NoiseLevel, DreamDiffusion=DreamDiffusion):
129
- logging.info('Creating Image On Thread 8')
130
- NoisedPrompt = AddNoise(Inputs, NoiseLevel)
131
- while queue.qsize() >= queue_threshold:
132
- time.sleep(2)
133
- queue.put(NoisedPrompt)
134
- Output8 = DreamPhotoReal(NoisedPrompt)
135
- logging.info('Done Creating Image On Thread 8')
136
- return Output8
137
 
138
  logging.info('Loading Interface')
139
  with App.Blocks(css='style.css') as demo:
@@ -206,10 +206,10 @@ with App.Blocks(css='style.css') as demo:
206
  Output2=App.Image(label='Dreamlike Diffusion 1.0',show_label=False)
207
  Output3=App.Image(label='Dreamlike Diffusion 1.0',show_label=False)
208
  Output4=App.Image(label='Dreamlike Diffusion 1.0',show_label=False)
209
- Output5=App.Image(label='Dreamlike PhotoReal 2.0',show_label=True)
210
- Output6=App.Image(label='Dreamlike PhotoReal 2.0',show_label=False)
211
- Output7=App.Image(label='Dreamlike PhotoReal 2.0',show_label=False)
212
- Output8=App.Image(label='Dreamlike PhotoReal 2.0',show_label=False)
213
 
214
 
215
  SeePrompts.click(get_prompts, inputs=[input_text], outputs=[prompt], queue=False)
@@ -218,10 +218,10 @@ with App.Blocks(css='style.css') as demo:
218
  Run.click(SendIt2, inputs=[prompt, neg_prompt, NoiseLevel], outputs=[Output2])
219
  Run.click(SendIt3, inputs=[prompt, neg_prompt, NoiseLevel], outputs=[Output3])
220
  Run.click(SendIt4, inputs=[prompt, neg_prompt, NoiseLevel], outputs=[Output4])
221
- Run.click(SendIt5, inputs=[prompt, neg_prompt, NoiseLevel], outputs=[Output5])
222
- Run.click(SendIt6, inputs=[prompt, neg_prompt, NoiseLevel], outputs=[Output6])
223
- Run.click(SendIt7, inputs=[prompt, neg_prompt, NoiseLevel], outputs=[Output7])
224
- Run.click(SendIt8, inputs=[prompt, neg_prompt, NoiseLevel], outputs=[Output8])
225
 
226
 
227
  with App.Row():
 
16
  else:
17
  return MagicPrompt('')
18
  logging.info('loading Dreamlike Diffusion')
19
+ DreamDiffusion=App.Interface.load('models/dreamlike-art/dreamlike-photoreal-2.0') # Credits to SG161222
20
+ #logging.info('Loading Dreamlike PhotoReal')
21
+ #DreamPhotoReal = DreamDiffusion
22
+ #DreamPhotoReal=App.Interface.load('models/dreamlike-art/dreamlike-photoreal-2.0') # Credits to Dreamlike
23
 
24
  def RestartScript():
25
  while True:
 
95
  logging.info('Done Creating Image On Thread 4')
96
  return Output4
97
 
98
+ #def SendIt5(Inputs, NoiseLevel, DreamDiffusion=DreamDiffusion):
99
+ # logging.info('Creating Image On Thread 5')
100
+ # NoisedPrompt = AddNoise(Inputs, NoiseLevel)
101
+ # while queue.qsize() >= queue_threshold:
102
+ # time.sleep(2)
103
+ # queue.put(NoisedPrompt)
104
+ # Output5 = DreamPhotoReal(NoisedPrompt)
105
+ # logging.info('Done Creating Image On Thread 5')
106
+ # return Output5
107
+ #
108
+ #def SendIt6(Inputs, NoiseLevel, DreamDiffusion=DreamDiffusion):
109
+ # logging.info('Creating Image On Thread 6')
110
+ # NoisedPrompt = AddNoise(Inputs, NoiseLevel)
111
+ # while queue.qsize() >= queue_threshold:
112
+ # time.sleep(2)
113
+ # queue.put(NoisedPrompt)
114
+ # Output6 = DreamPhotoReal(NoisedPrompt)
115
+ # logging.info('Done Creating Image On Thread 6')
116
+ # return Output6
117
+ #
118
+ #def SendIt7(Inputs, NoiseLevel, DreamDiffusion=DreamDiffusion):
119
+ # logging.info('Creating Image On Thread 7')
120
+ # NoisedPrompt = AddNoise(Inputs, NoiseLevel)
121
+ # while queue.qsize() >= queue_threshold:
122
+ # time.sleep(2)
123
+ # queue.put(NoisedPrompt)
124
+ # Output7 = DreamPhotoReal(NoisedPrompt)
125
+ # logging.info('Done Creating Image On Thread 7')
126
+ # return Output7
127
+ #
128
+ #def SendIt8(Inputs, NoiseLevel, DreamDiffusion=DreamDiffusion):
129
+ # logging.info('Creating Image On Thread 8')
130
+ # NoisedPrompt = AddNoise(Inputs, NoiseLevel)
131
+ # while queue.qsize() >= queue_threshold:
132
+ # time.sleep(2)
133
+ # queue.put(NoisedPrompt)
134
+ # Output8 = DreamPhotoReal(NoisedPrompt)
135
+ # logging.info('Done Creating Image On Thread 8')
136
+ # return Output8
137
 
138
  logging.info('Loading Interface')
139
  with App.Blocks(css='style.css') as demo:
 
206
  Output2=App.Image(label='Dreamlike Diffusion 1.0',show_label=False)
207
  Output3=App.Image(label='Dreamlike Diffusion 1.0',show_label=False)
208
  Output4=App.Image(label='Dreamlike Diffusion 1.0',show_label=False)
209
+ # Output5=App.Image(label='Dreamlike PhotoReal 2.0',show_label=True)
210
+ # Output6=App.Image(label='Dreamlike PhotoReal 2.0',show_label=False)
211
+ # Output7=App.Image(label='Dreamlike PhotoReal 2.0',show_label=False)
212
+ # Output8=App.Image(label='Dreamlike PhotoReal 2.0',show_label=False)
213
 
214
 
215
  SeePrompts.click(get_prompts, inputs=[input_text], outputs=[prompt], queue=False)
 
218
  Run.click(SendIt2, inputs=[prompt, neg_prompt, NoiseLevel], outputs=[Output2])
219
  Run.click(SendIt3, inputs=[prompt, neg_prompt, NoiseLevel], outputs=[Output3])
220
  Run.click(SendIt4, inputs=[prompt, neg_prompt, NoiseLevel], outputs=[Output4])
221
+ # Run.click(SendIt5, inputs=[prompt, neg_prompt, NoiseLevel], outputs=[Output5])
222
+ # Run.click(SendIt6, inputs=[prompt, neg_prompt, NoiseLevel], outputs=[Output6])
223
+ # Run.click(SendIt7, inputs=[prompt, neg_prompt, NoiseLevel], outputs=[Output7])
224
+ # Run.click(SendIt8, inputs=[prompt, neg_prompt, NoiseLevel], outputs=[Output8])
225
 
226
 
227
  with App.Row():