149 lines
3.6 KiB
Dart
149 lines
3.6 KiB
Dart
/// Test data for ComfyUI API tests
|
|
class TestData {
|
|
/// Mock queue response
|
|
static final Map<String, dynamic> queueResponse = {
|
|
'queue_running': 0,
|
|
'queue': [],
|
|
'queue_pending': {}
|
|
};
|
|
|
|
/// Mock history response
|
|
static final Map<String, dynamic> historyResponse = {
|
|
'History': {
|
|
'123456789': {
|
|
'prompt': {
|
|
// Prompt data
|
|
},
|
|
'outputs': {
|
|
'8': {
|
|
'images': {
|
|
'filename': 'ComfyUI_00001_.png',
|
|
'subfolder': '',
|
|
'type': 'output',
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
|
|
/// Mock history item
|
|
static final Map<String, dynamic> historyItemResponse = {
|
|
'prompt_id': '123456789',
|
|
'prompt': {
|
|
// Prompt data
|
|
},
|
|
'outputs': {
|
|
'8': {
|
|
'images': {
|
|
'filename': 'ComfyUI_00001_.png',
|
|
'subfolder': '',
|
|
'type': 'output',
|
|
}
|
|
}
|
|
}
|
|
};
|
|
|
|
/// Mock checkpoints response
|
|
static final Map<String, dynamic> checkpointsResponse = {
|
|
'models/checkpoints/dreamshaper_8.safetensors': {
|
|
'filename': 'dreamshaper_8.safetensors',
|
|
'folder': 'models/checkpoints',
|
|
},
|
|
'models/checkpoints/sd_xl_base_1.0.safetensors': {
|
|
'filename': 'sd_xl_base_1.0.safetensors',
|
|
'folder': 'models/checkpoints',
|
|
}
|
|
};
|
|
|
|
/// Mock checkpoint metadata response
|
|
static final Map<String, dynamic> checkpointMetadataResponse = {
|
|
'model': {
|
|
'type': 'checkpoint',
|
|
'title': 'Dreamshaper 8',
|
|
'filename': 'dreamshaper_8.safetensors',
|
|
'hash': 'abcdef1234567890',
|
|
}
|
|
};
|
|
|
|
/// Mock LoRAs response
|
|
static final Map<String, dynamic> lorasResponse = {
|
|
'models/loras/example_lora.safetensors': {
|
|
'filename': 'example_lora.safetensors',
|
|
'folder': 'models/loras',
|
|
}
|
|
};
|
|
|
|
/// Mock VAE response
|
|
static final Map<String, dynamic> vaeResponse = {
|
|
'models/vae/example_vae.safetensors': {
|
|
'filename': 'example_vae.safetensors',
|
|
'folder': 'models/vae',
|
|
}
|
|
};
|
|
|
|
/// Mock object info response (simplified)
|
|
static final Map<String, dynamic> objectInfoResponse = {
|
|
'CheckpointLoaderSimple': {
|
|
'input': {
|
|
'required': {'ckpt_name': 'STRING'}
|
|
},
|
|
'output': ['MODEL', 'CLIP', 'VAE'],
|
|
'output_is_list': [false, false, false]
|
|
},
|
|
'KSampler': {
|
|
'input': {
|
|
'required': {
|
|
'model': 'MODEL',
|
|
'seed': 'INT',
|
|
'steps': 'INT',
|
|
'cfg': 'FLOAT',
|
|
'sampler_name': 'STRING',
|
|
'scheduler': 'STRING',
|
|
'positive': 'CONDITIONING',
|
|
'negative': 'CONDITIONING',
|
|
'latent_image': 'LATENT'
|
|
},
|
|
'optional': {'denoise': 'FLOAT'}
|
|
},
|
|
'output': ['LATENT'],
|
|
'output_is_list': [false]
|
|
}
|
|
};
|
|
|
|
/// Mock prompt request
|
|
static final Map<String, dynamic> promptRequest = {
|
|
'prompt': {
|
|
'3': {
|
|
'inputs': {
|
|
'seed': 123456789,
|
|
'steps': 20,
|
|
'cfg': 7,
|
|
'sampler_name': 'euler_ancestral',
|
|
'scheduler': 'normal',
|
|
'denoise': 1,
|
|
'model': ['4', 0],
|
|
'positive': ['6', 0],
|
|
'negative': ['7', 0],
|
|
'latent_image': ['5', 0]
|
|
},
|
|
'class_type': 'KSampler'
|
|
}
|
|
},
|
|
'client_id': 'test-client-id'
|
|
};
|
|
|
|
/// Mock prompt response
|
|
static final Map<String, dynamic> promptResponse = {
|
|
'prompt_id': '123456789',
|
|
'number': 1,
|
|
'status': 'success'
|
|
};
|
|
|
|
/// Mock progress update response
|
|
static final Map<String, dynamic> progressUpdateResponse = {
|
|
'type': 'execution_start',
|
|
'data': {'prompt_id': '123456789'}
|
|
};
|
|
}
|