MCPcopy
hub / github.com/vladmandic/sdnext / end

Method end

modules/shared_state.py:229–244  ·  view source on GitHub ↗
(self, task_id=None, api=None)

Source from the content-addressed store, hash-verified

227 return self.id
228
229 def end(self, task_id=None, api=None):
230 import modules.devices
231 if debug_output:
232 log.trace(f'State end: {self}')
233 if task_id is not None:
234 prev_job = self.find(task_id)
235 if prev_job is not None:
236 self.id = prev_job['id']
237 self.job = prev_job['job']
238 self.duration = round(time.time() - prev_job['timestamp'], 3) if prev_job['timestamp'] is not None else None
239 self.time_start = time.time()
240 if api is not None:
241 self.api = api
242 self.history('end', task_id or self.id)
243 self.clear()
244 modules.devices.torch_gc()
245
246 def step(self, step:int=1):
247 self.sampling_step += step

Callers 15

load_modelFunction · 0.45
vae_decodeFunction · 0.45
vae_encodeFunction · 0.45
generate_click_generatorFunction · 0.45
generate_clickFunction · 0.45
parse_prompt_attentionFunction · 0.45
resize_hiresFunction · 0.45
load_image_encoderFunction · 0.45
load_feature_extractorFunction · 0.45
sha256Function · 0.45
failFunction · 0.45
run_modelmergerFunction · 0.45

Calls 3

findMethod · 0.95
historyMethod · 0.95
clearMethod · 0.95

Tested by

no test coverage detected