Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Potential Task Loss in Queue Execution #42

Open
5 tasks done
BaiMoHan opened this issue Dec 17, 2024 · 1 comment
Open
5 tasks done

[Bug]: Potential Task Loss in Queue Execution #42

BaiMoHan opened this issue Dec 17, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@BaiMoHan
Copy link

Checklist

  • The issue has not been resolved by following the troubleshooting guide
  • The issue exists on a clean installation of Fooocus
  • The issue exists in the current version of Fooocus
  • The issue has not been reported before recently
  • The issue has been reported before but has not been fixed yet

What happened?

It seems that there is an issue with task loss in the queue management within the code. While I had an ongoing task running, I triggered two different rendering tasks consecutively, each time setting async_process to true.

At that point, there were a total of three tasks queued for execution. However, after approximately 15 minutes, when I checked back, I noticed that the last task had never been executed — its start_mills value was null.

Steps to reproduce the problem

  1. Start a task that is running.
  2. Initiate two additional rendering tasks with async_process set to true.
  3. Wait for about 15 minutes.
  4. Check the status of the tasks.

What should have happened?

All task should be finished.

What browsers do you use to access Fooocus?

No response

Where are you running Fooocus?

Locally with virtualization (e.g. Docker)

What operating system are you using?

Linux

Console logs

Query the last task 

{
    "req_params": {
        "prompt": "safe_pos,sfw,1female,wearing clothes,wearing tops,with clothes on,dressed elegantly,dressed normally,fully dressed,looking at viewer,natural light,highly detailed,masterwork,photograph,ultra realistic,perfect details,random background,looking at viewer,shirt,dress,wearing shorts,cami,seductive pose,beautiful face,bedroom,indoors,blurry,baggy clothes,blurry background,off shoulder,lingerie,Lace Sling,pyjamas,vibrant and elegant style,nighty,bedgown,(((beautiful woman 1.6))), (((indonesian))), pink long hair,on the bedroom, dressed in sized see-through neglise, legs a  spread inviting me in!,fully dressed,dynamic pose,dynamic angle,highly detailed,RAW photo,photorealistic,candid camera,eye catchlights,imperfections,natural,John Singer Sargent Style",
        "negative_prompt": "nsfw,explicit,exposed nipples,topless,bottomless,exposed ass,nudity,sexy,nude,child,teenager,underaged,loli,pussy,no clothes,",
        "style_selections": [],
        "performance_selection": "Speed",
        "aspect_ratios_selection": "800×1200",
        "image_number": 6,
        "output_format": "jpeg",
        "image_seed": 948962,
        "read_wildcards_in_order": false,
        "sharpness": 0.0,
        "guidance_scale": 4.0,
        "base_model_name": "epicrealismXL_v8Kiss.safetensors",
        "refiner_model_name": "None",
        "refiner_switch": 0.1,
        "loras": [
            false,
            "",
            0.0,
            true,
            "None",
            1.0,
            true,
            "None",
            1.0,
            true,
            "None",
            1.0,
            true,
            "None",
            1.0
        ],
        "input_image_checkbox": true,
        "current_tab": "ip",
        "uov_method": "Disabled",
        "uov_input_image": "",
        "outpaint_selections": [],
        "inpaint_input_image": "",
        "inpaint_additional_prompt": "",
        "inpaint_mask_image_upload": "",
        "disable_preview": true,
        "disable_intermediate_results": true,
        "disable_seed_increment": false,
        "black_out_nsfw": false,
        "adm_scaler_positive": 1.5,
        "adm_scaler_negative": 0.8,
        "adm_scaler_end": 0.3,
        "adaptive_cfg": 7.0,
        "clip_skip": 2,
        "sampler_name": "dpmpp_2m_sde_gpu",
        "scheduler_name": "karras",
        "vae_name": "Default (model)",
        "overwrite_step": -1,
        "overwrite_switch": -1,
        "overwrite_width": -1,
        "overwrite_height": -1,
        "overwrite_vary_strength": -1.0,
        "overwrite_upscale_strength": -1.0,
        "mixing_image_prompt_and_vary_upscale": false,
        "mixing_image_prompt_and_inpaint": false,
        "debugging_cn_preprocessor": false,
        "skipping_cn_preprocessor": false,
        "canny_low_threshold": 64,
        "canny_high_threshold": 128,
        "refiner_swap_method": "joint",
        "controlnet_softness": 0.25,
        "freeu_enabled": false,
        "freeu_b1": 1.01,
        "freeu_b2": 1.02,
        "freeu_s1": 0.99,
        "freeu_s2": 0.95,
        "debugging_inpaint_preprocessor": false,
        "inpaint_disable_initial_latent": false,
        "inpaint_engine": "v2.6",
        "inpaint_strength": 1.0,
        "inpaint_respective_field": 0.618,
        "inpaint_advanced_masking_checkbox": true,
        "invert_mask_checkbox": false,
        "inpaint_erode_or_dilate": 0,
        "save_final_enhanced_image_only": false,
        "save_metadata_to_images": false,
        "metadata_scheme": "fooocus",
        "controlnet_image": [
            {
                "cn_img": "http://127.0.0.1:9092/inputs/cad484376bab9af15bbb236fe35b0a7d7b8baffb661c8c164719a20c38af5607.png",
                "cn_stop": 0.9,
                "cn_weight": 0.75,
                "cn_type": "FaceSwap"
            },
            {
                "cn_img": "",
                "cn_stop": 0.6,
                "cn_weight": 0.6,
                "cn_type": "ImagePrompt"
            },
            {
                "cn_img": "",
                "cn_stop": 0.6,
                "cn_weight": 0.6,
                "cn_type": "ImagePrompt"
            },
            {
                "cn_img": "",
                "cn_stop": 0.6,
                "cn_weight": 0.6,
                "cn_type": "ImagePrompt"
            }
        ],
        "debugging_dino": false,
        "dino_erode_or_dilate": 0,
        "debugging_enhance_masks_checkbox": false,
        "enhance_input_image": "",
        "enhance_checkbox": false,
        "enhance_uov_method": "Disabled",
        "enhance_uov_processing_order": "Before First Enhancement",
        "enhance_uov_prompt_type": "Original Prompts",
        "enhance_ctrls": [
            {
                "enhance_enabled": false,
                "enhance_mask_dino_prompt": "",
                "enhance_prompt": "",
                "enhance_negative_prompt": "",
                "enhance_mask_model": "sam",
                "enhance_mask_cloth_category": "full",
                "enhance_mask_sam_model": "vit_b",
                "enhance_mask_text_threshold": 0.25,
                "enhance_mask_box_threshold": 0.3,
                "enhance_mask_sam_max_detections": 0,
                "enhance_inpaint_disable_initial_latent": false,
                "enhance_inpaint_engine": "v2.6",
                "enhance_inpaint_strength": 1.0,
                "enhance_inpaint_respective_field": 0.618,
                "enhance_inpaint_erode_or_dilate": 0.0,
                "enhance_mask_invert": false
            },
            {
                "enhance_enabled": false,
                "enhance_mask_dino_prompt": "",
                "enhance_prompt": "",
                "enhance_negative_prompt": "",
                "enhance_mask_model": "sam",
                "enhance_mask_cloth_category": "full",
                "enhance_mask_sam_model": "vit_b",
                "enhance_mask_text_threshold": 0.25,
                "enhance_mask_box_threshold": 0.3,
                "enhance_mask_sam_max_detections": 0,
                "enhance_inpaint_disable_initial_latent": false,
                "enhance_inpaint_engine": "v2.6",
                "enhance_inpaint_strength": 1.0,
                "enhance_inpaint_respective_field": 0.618,
                "enhance_inpaint_erode_or_dilate": 0.0,
                "enhance_mask_invert": false
            },
            {
                "enhance_enabled": false,
                "enhance_mask_dino_prompt": "",
                "enhance_prompt": "",
                "enhance_negative_prompt": "",
                "enhance_mask_model": "sam",
                "enhance_mask_cloth_category": "full",
                "enhance_mask_sam_model": "vit_b",
                "enhance_mask_text_threshold": 0.25,
                "enhance_mask_box_threshold": 0.3,
                "enhance_mask_sam_max_detections": 0,
                "enhance_inpaint_disable_initial_latent": false,
                "enhance_inpaint_engine": "v2.6",
                "enhance_inpaint_strength": 1.0,
                "enhance_inpaint_respective_field": 0.618,
                "enhance_inpaint_erode_or_dilate": 0.0,
                "enhance_mask_invert": false
            }
        ],
        "generate_image_grid": false,
        "save_name": "bca7ce60-06f8-4e0b-804f-df6940c11e67",
        "outpaint_distance": [
            0,
            0,
            0,
            0
        ],
        "upscale_multiple": 1.0,
        "preset": "initial",
        "stream_output": false,
        "require_base64": false,
        "async_process": true,
        "webhook_url": "http://localhost:3009/focus/webhook"
    },
    "task_id": "4d6b6d2b97394c5b9465c9fec11eb81e",
    "start_mills": null,
    "task_status": null,
    "webhook_url": "http://localhost:3009/focus/webhook",
    "in_queue_mills": 1734388880364,
    "id": 197,
    "finish_mills": null,
    "progress": null,
    "result": null
}

Additional information

4090

@BaiMoHan BaiMoHan added the bug Something isn't working label Dec 17, 2024
@BaiMoHan
Copy link
Author

BaiMoHan commented Dec 17, 2024

await asyncio.sleep(0.2)

if len(task.yields) > 0:

My intuition tells me that there might be an issue with this line of code. 😳🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant